function OnGUI () {
if (GUI.Button (Rect (10,70,70,20), "test" )) {
var ball = gameObject.Find("ball main"); // find game object
var com = ball.GetComponent("interestDrug"); // get javascript component
com.test(); // test is com correct object - all right
com.enable = false; // try turn off component
}
}
and I get follow error:
MissingFieldException: Field 'interestDrug.enable' not found.
Boo.Lang.Runtime.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates)
Boo.Lang.Runtime.PropertyDispatcherFactory.Create (SetOrGet gos)
What is the problem? I’m looking for this forum and found such script, don’t understand where is my misstake. Could you help me?