- Home /
Close GUI help.
I want to close the GUI button that I am clicking. Basically a main menu. I've read through the scripting but not quite understanding the logic.
I want to have two buttons: START GAME and END GAME When you click START GAME, both buttons should disapear and another set of buttons will appear.
When you click END GAME, the application will end.
I can make something appear, but not disappear...
Thanks.
Answer by sriram90 · Apr 08, 2011 at 04:44 AM
hey,
just you can control with boolean variables...
private bool isButton = true;
void OnGUI() { if(isButton) { if(GUI.Button(new Rect(20,20,100,30),"Start Game")) { //doSomething Here(); isButton = false; } } }
Here,if you click start game button the button will disappear...try this..
Your answer
Follow this Question
Related Questions
Passing a variable through the main menu 2 Answers
FadeIn/FadeOut GUI Menu and Text 1 Answer
When I pause my game and enable canvas and then resume my keyboard starts controlling the menu... 1 Answer
How to use options in the Dropdown menu UI? 2 Answers
How can I make the in-game menu remains unchange while changing scenes? 3 Answers