So I have start button with code:
GameControlScr gameControlScr;
void Start () {
gameControlScr = GameObject.Find ("GameControl").GetComponent<GameControlScr>();
}
void OnMouseDown()
{
gameControlScr.testMethod();
}
When I test it from unity editor it works fine. It calls testMethod() and new scene is loaded. But when I build project into android or pc versions it won’t call this method. It seems like it can’t access gameControlScr. I also tried making gameControlSrc a static reference and it won’t work as well. Btw testMethod() just have this line of code:
public void testMethod(){
Application.LoadLevel("Test01Level01");
}