void OnGUI() { width = Screen.width / 12; height = Screen.height / 12; if (sceneController.isStarted == false) { if (GUI.Button(new Rect(castw(2f) + 20, casth(6f) + 60, 50, 50), "Start")) { action.StartGame(); } } else { if (GUI.Button(new Rect(width + 120, height, 60, 30), "Restart")) { action.Restart(); } if (GUI.Button(new Rect(width + 200, height, 80, 30), "Change")) { action.ChangeActionManager(); action.Restart(); } if (sceneController.isPaused == true) { if (GUI.Button(new Rect(castw(2f) + 20, casth(6f) + 60, 100, 50), "Next Round")) { // if (sceneController.score >= sceneController.round*50) action.Resume(); // if (GUI.Button(new Rect(castw(2f) + 20, casth(6f) + 60, 50, 50), "GameOver")) // { // action.Restart(); // } // } } } GUI.TextArea(new Rect(width, height, 100, 30), "Score:" + sceneController.score.ToString()); GUI.TextArea(new Rect(width, height + 50, 100, 30), "Round : " + sceneController.round.ToString()); } }
void OnGUI() { if (isStart == false) { if (GUI.Button(new Rect(200, 200, 240, 80), "Start Game")) { controller.LoadResources(); isStart = true; } } else { if (isPause == true) { GUI.Label(new Rect(310, 400, 120, 20), "waiting!!!"); } if (GUI.Button(new Rect(570, 5, 60, 20), "Resume")) { controller.Resume(); isPause = false; } if (GUI.Button(new Rect(505, 5, 60, 20), "Pause")) { controller.Pause(); isPause = true; } if (isPause == false) { if (GUI.Button(new Rect(5, 5, 100, 20), "Speed Up")) { action.SpeedUp(); } if (GUI.Button(new Rect(110, 5, 100, 20), "Speed Down")) { action.SpeedDown(); } if (GUI.Button(new Rect(215, 5, 100, 20), "Restart")) { isStart = false; isPause = false; action.GameOver(); } } } }