- Home /
Answer by NerdGameStudio · May 31, 2015 at 08:51 PM
Hi. You should call a function OnGUI() and make a button to click. Within your button you can determine what should happen when the button is clicked. An example would be:
function OnGUI()
{
if (GUI.Button (Rect (50, 50, 50, 50), "this is a button"))
{
print (" you pressed a button, do something here");
}
}
In case you want the button only to appear when a boolean is set to true or false, just type whatever boolean you have in front of the GUI button using:
if (some_boolean == true)
{
}