EditI updated the script to
function OnMouseDown () {
GetComponent("StartGame").enabled = false;
}
////////////////////////////////////////////////////////////
My Gui Menu is in my Script
var mySkin : GUISkin[];
private var cont : int = 0;
function OnGUI(){ GUI.skin = mySkin[cont%mySkin.Length]; if (GUI.Button(Rect(200, 70, 200, 50), "Start Game")){ Application.LoadLevel(""); Debug.Log("Let the Game Begin"); }
}
Now I want to be able to have an options in my menu as well. The problem is, If I click my Options Gui button, I want to disable all my other gui buttons. Here is the test code I have.
function Start() {
if(Input.GetMouseButtonUp(0))
script = GetComponent("Start Game").enabled = false;
}
What do I need to add to disable my other scripts that contain my gui menu. Right now it doesn’t work. My start game script still works even after I press it.