Displaying a panel on GUI click

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?

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

public enum PanelType{ Apple, Banana, Orange, None }

// class, OnGUI ans stuff ...

if( GUI.Button(...) ) type = PanelType.Apple;


if( type == PanelType.Apple ) DisplayApplePanel();
else ...

Or you could use a separate script for the pannels and enable the one you need

public MyPannel one, two, three, four;

// ...

if( GUI.Button(...) ) // Disable last one and enable new one

So essentially I will have to create 4 panels or planes and name them accordingly, correct?

Bare with me, I’m not a very strong programmer or scripter :confused: haha