void menu() { //GameObject handCursor = GameObject.Find("HandCursor"); pMenu = GetComponent<pauseMenu>(); opMenu = GetComponent<optionsMenu>(); //layout start GUI.BeginGroup(new Rect(Screen.width / 2 - 150, 50, 300, 300)); //the menu background box GUI.Box(new Rect(0, 0, 300, 300), ""); //logo picture //GUI.Label(new Rect(15, 10, 300, 68), logoTexture); ///////main menu buttons //options button kinectRect = new Rect(55, 50, 180, 40); if(GUI.Button(kinectRect, "Using Kinect - "+ (PlayerPrefs.GetInt("useKinect") == 1))) //true if currently using the Kinect. Else false. We want to toggle this. { toggleKinect(); } //back button backRect = new Rect(55, 100, 180, 40); if(GUI.Button(backRect, "Back")) { back (); } //layout end GUI.EndGroup(); }
void menu() { //GameObject handCursor = GameObject.Find("HandCursor"); pMenu = GetComponent<pauseMenu>(); opMenu = GetComponent<optionsMenu>(); //layout start GUI.BeginGroup(new Rect(Screen.width / 2 - 150, 50, 300, 300)); //the menu background box GUI.Box(new Rect(0, 0, 300, 300), ""); //logo picture //GUI.Label(new Rect(15, 10, 300, 68), logoTexture); ///////main menu buttons //resume button resumeRect = new Rect(55, 50, 180, 40); if(GUI.Button(resumeRect, "Resume")) { resume (); } //options button optionsRect = new Rect(55, 100, 180, 40); if(GUI.Button(optionsRect, "Options")) //TODO: should only appear when there is a game to be continued { options(); } //help button helpRect = new Rect(55, 150, 180, 40); if(GUI.Button(helpRect, "Help")) { help (); } //exit button exitRect = new Rect(55, 200, 180, 40); string buttonText = "Exit Level"; if (worldIndex == 0) //level is levelSelect { buttonText = "Exit to Main Menu"; } if(GUI.Button(exitRect, buttonText)) { exitLevel(); } //layout end GUI.EndGroup(); }