- Home /
Question by
rishabhvinod · Oct 09, 2013 at 07:30 AM ·
gui-button
I have two buttons in my c# script, i want to make invissible one button and make it vissible on click of another button at runtime. Can anyone please show me the way for the proper solution.
Please explain with some example, it will great help for me. Thanks in advance.
Comment
Best Answer
Answer by Azrapse · Oct 09, 2013 at 08:21 AM
public class Example : MonoBehaviour { public bool showHiddenButton = false; void OnGUI() { // Hidden button if (showHiddenButton) { if (GUI.Button(new Rect(10, 10, 50, 50), "Hidden Button")) { // Do Hidden Button stuff }
}
if (GUI.Button(new Rect(10, 70, 50, 30), "Other Button"))
{
showHiddenButton = true;
}
}
}
Your answer
Follow this Question
Related Questions
turn on off particle system 1 Answer
A node in a childnode? 1 Answer
Unity Texture import Setting For Android Game 0 Answers
How to change a string into integer 2 Answers
Texture2d.Readpixel slow down performance while stand-alone exe is minimize 0 Answers