make sure you’ve put the files in the right places per this document:
http://unity3d.com/support/documenta…dvanced29.htmlNext, try this code. It works with both scripts are components on the same object:
C#:
Code:using UnityEngine; using System.Collections; public class FrameCounter : MonoBehaviour { public int frameCount = 0; // Update is called once per frame void Update () { if ( (++frameCount % 100) == 0) { Debug.Log( "frameCounter = " + frameCount ); } } }UnityScript:
Code:function Update () { if ( Input.GetKeyDown( KeyCode.S ) ) { var fc : FrameCounter; fc = gameObject.GetComponent("FrameCounter"); fc.enabled = false; } }
Posted via email from Next Level with Brandon
Categories
Submit a Comment