Hello everyone, I am having trouble scripting a menue. it is supposed to have 4 buttones on the top and if you click on one of them it opens a window with the sub-menu for the option you clicked. (i am currently working on the menue for the campeign and if i can get some help with that i can finish the others) basically what the sub-menu will do is it will have a button for each level that you can click to take you too that level, but when i try to click on one of the buttons it prints a message in the console (not an error like with a print command)
here is the code (im sorry for the crappyness i am really new to coding with java+unity)
private var selectedToolbar : int = 0;
private var toolbarStrings = ["Campain", "Multiplayer","Options","Quit"];
var windowRect : Rect = Rect (20, 20, 120, 50);
function OnGUI () {
// Determine which button is active, whether it was clicked this frame or not
selectedToolbar = GUI.Toolbar (Rect (50, 10, Screen.width - 100, 30), selectedToolbar, toolbarStrings);
// If the user clicked a new Toolbar button this frame, we'll process their input
if (GUI.changed)
{
print ("The toolbar was clicked");
if (selectedToolbar == 0);
{
GUI.Window(0, Rect (50, 10, Screen.width -100, Screen.width -100), ((GUI.Button (Rect (25, 25, 100, 30), "LEVEL 1", Application.LoadLevel(1);), "Campain");
}
else if (selectedToolbar == 1);
{
print("multiplayer")
}
else if (selectedToolbar == 2);
{
print("options")
}
else
{
Application.Quit;
}
}
}