When trying to work my main menu for one of my creations, I was repeatedly getting this error/warning, that did although lead into a larger problem. I do not understand what I am doing wrong… If anyone can help, it would be greatly appreciated… The error occurs on line 10 below
function OnGUI(){
if(menu){
GUI.Box(new Rect(Screen.width /2 -100,Screen.height /2 -120,200,160), "Game Over");
if(GUI.Button(new Rect(Screen.width /2 -80,Screen.height /2 -80,160,40), "Retry")) {
LoadData();
}
if(GUI.Button(new Rect(Screen.width /2 -80,Screen.height /2 -20,160,40), "Quit Game")) {
mainCam = GameObject.FindWithTag ("MainCamera").transform;
Destroy(mainCam.gameObject); //Destroy Main Camera
Application.LoadLevel ("Title");
//Application.Quit();
}
}
}