Object A have C# Script name “Script_C” with Function1()
I want call Function1() from other JS script.
var cs = GameObject.Find("ObjectA");
var script = cs.GetComponent("Script_C");
script.Function1();
Object A have C# Script name “Script_C” with Function1()
I want call Function1() from other JS script.
var cs = GameObject.Find("ObjectA");
var script = cs.GetComponent("Script_C");
script.Function1();
Make sure the c# compiles first and you’re good to go
Attach js script to some object
var objectA :GameObject;// objectA contains C# script
function Start()
{
objectA.gameObject.SendMessage(“Check”);
}
In C#
void Check()
{
Debug.Log(“its working”);
}
R u looking for this only…
I know JavaScipt but C# not.
Thanks but in C# I have more function, I want run only Function1 from JS.
How ?