|
I'm in the process of making a Serious Game for a class I have, and I'm trying to display a box or a panel when I click one of the 4 GUI buttons. What would be the easiest way to make a panel be displayed when a certain button is clicked? Also, could I have 4 different panels? For example, if I click one button, Panel A shows up. If I click another button, Panel B shows up. Is that possible?
(comments are locked)
|
|
It's possible and there is many ways to do it. You could have everything in one script and display the correct panel depending on an enum Or you could use a separate script for the pannels and enable the one you need UnityGUI (this is the name of what's happening in OnGUI()) takes care of how it is displayed. You need to attach a script to a gameobject that implement the function OnGUI. Inside, you need can call GUI.Label, Button, Box etc. That gameObject doesn't need a mesh or anything else. Could use comments instead of answer please ?
May 18 '12 at 07:43 PM
Berenger
(comments are locked)
|
|
So essentially I will have to create 4 panels or planes and name them accordingly, correct?
(comments are locked)
|
|
Bare with me, I'm not a very strong programmer or scripter :/ haha
(comments are locked)
|
