I want to figure out a way to open and close different gui objects in a script by clicking in game. I cant find it in the manual so any help would be appreciated.
There are several ways:
Use an if:
if(doInventory) {
GUI.Button(…
}
use a switch and enums or ints:
switch(guimode) {
case GUIMode.Inventory:
…
case GUIMode.Spells:
…
}
or use delegates , which is nicely outlined in this thread:
http://forum.unity3d.com/threads/22252-Friday-Treat-GUI-Menu-System-(C-)
thanks a lot!