Hey Guys
Im working on a small horror game at the moment based off the anime, Hetalia and im having trouble with the main menu. See it has 3 buttons. One to start the game. One to exit and one thats a level select. When i click the level select i want it to bring up a new GUI box next to the main menu gui and display the levels. But so far. It doesnt draw the box when i click the level select or bring up the new buttons!
Here IS My Code
#pragma strict
function Start () {
}
function Update () {
}
// JavaScript
function OnGUI () {
// Make a background box
GUI.Box (Rect (350,100,200,100), "Canada's Nightmare");
GUI.Box (Rect (150,100,200,100), "Choose Your Nightmare");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if (GUI.Button (Rect (350,120,200,20), "Enter The Nightmare")) {
Application.LoadLevel (1);
}
if (GUI.Button (Rect (350,150,200,20), "Choose The Nightmare")) { // Level Select begins
if (GUI.Button (Rect (150,130,200,90), "Britains Coal Mines")) {
Application.LoadLevel (1);
}
if (GUI.Button (Rect (150,160,200,90), "No Level Here")){
}
} // Level Select Ends
if (GUI.Button (Rect (350,180,200,20), "Wake Up...")) {
Application.Quit();
}
}
Thanks in advance!