I’m writing a script that when a person clicks a GUI button , it then disappears. How can I do this?
My GUI Code is this.
function OnGUI () {
GUI.skin = theme;
GUI.BeginGroup (new Rect (Screen.width / 2 - 320, Screen.height / 2 - 240, 640, 480));
if (GUI.Button (Rect (10,30,620,30), button1text)) {
print("You clicked 1");
response = answer1;
}
GUI.EndGroup();
}
How can I get that button to disappear until the next time the script is activated? So it’s unclickable, not even visible, even. Any ideas?