How to make GUI Transition?

I have a main menu, and a button using GUI.
I want that when the player click on the gui make a transition to another screen showing options.

How to make this?
I’m beginner at programming and need your help.

I know two ways to do that.

  1. Make a seperate scene with your options GUI, and when button is clicked load that scene.
if(GUI.Button(Rect(10, 10, 125, 25), "Options")) {
    Application.LoadLevel(1);
}
  1. Make booleans for every menu “page”, for example:
var showMainMenu : boolean = true;
var showOptions : boolean = false;

function OnGUI() {
    if(showMainMenu) {
        // Main menu GUI code
    }

    if(showOptions) {
        // Options GUI code
    }

    // Show options on button press
    if(GUI.Button(Rect(10, 10, 125, 25), "Options")) {
        showMainMenu = false;
        showOptions = true;
    }
}

I personally prefer second option, but choice is yours :slight_smile:

Work 100% correctly .

Thank You!

UnityGUI menus should really be a part of the first scene only. There’s no reason why to separate it into multiple scenes. So, the second option is sure the best.

The first option should be taken into the account when using non-UnityGUI frameworks, i.e. when GUI elements are the part of the #D scene.