void OnGUI() { userAction.Check(); //小字体初始化 GUIStyle style = new GUIStyle(); style.normal.textColor = Color.white; style.fontSize = 30; //大字体初始化 GUIStyle bigStyle = new GUIStyle(); bigStyle.normal.textColor = Color.white; bigStyle.fontSize = 50; GUI.Label(new Rect(200, 30, 50, 200), "Priests & Devils", bigStyle); GUI.Label(new Rect(320, 100, 50, 200), gameMessage, style); GUI.Label(new Rect(0, 0, 100, 50), "Time: " + time, style); if (GUI.Button(new Rect(340, 160, 100, 50), "Restart")) { userAction.Restart(); } }
// Update is called once per frame void OnGUI() { userAction.Check(); GUI.Label(new Rect(160, Screen.height * 0.1f, 50, 200), "Preists and Devils", bigstyle); GUI.Label(new Rect(250, 100, 50, 200), gameMessage, style); GUI.Label(new Rect(0, 0, 100, 50), "Time: " + time, style); }
void OnGUI() { userAction.Check(); GUIStyle style = new GUIStyle(); GUIStyle style2 = new GUIStyle(); style.normal.textColor = style2.normal.textColor = Color.white; style.fontSize = 20; style2.fontSize = 50; GUI.Label(new Rect(25, 20, 100, 50), "Time: " + time, style); GUI.Label(new Rect(190, 50, 50, 200), "Priests and Devils", style2); GUI.Label(new Rect(330, 140, 50, 200), result, style); if (GUI.Button(new Rect(690, 20, 60, 30), "Restart", style)) { userAction.Restart(); } }
void OnGUI() { if (GUI.Button(new Rect(300, 50, 150, 50), "RESTART")) { action.Restart(); } if (state != 0) { if (state == 1) { GUI.color = Color.green; GUI.Label(new Rect(400, 105, 50, 50), "Win."); } else { GUI.color = Color.red; GUI.Label(new Rect(400, 105, 50, 50), "Lose."); } return; } if (Input.GetMouseButtonDown(0)) { flag = true; } else if (Input.GetMouseButtonUp(0) && flag) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hitInfo; if (Physics.Raycast(ray, out hitInfo)) { GameObject gameObj = hitInfo.collider.gameObject; //action.Clicked (gameObj); state = action.Check(); if (state != 0) { action.GameOver(); } } } }
void OnGUI() { GUIStyle text_style; GUIStyle button_style; text_style = new GUIStyle() { fontSize = 30 }; button_style = new GUIStyle("button") { fontSize = 15 }; sign = action.Check(); if (sign == 0) { if (GUI.Button(new Rect(Screen.width / 2 - 30, 80, 60, 60), "Go!")) { action.MoveBoat(); } } else if (sign == -1) { GUI.Label(new Rect(Screen.width / 2 - 75, 100, 120, 50), "You Failed!", text_style); if (GUI.Button(new Rect(Screen.width / 2 - 50, 150, 100, 50), "Try Agian", button_style)) { action.Restart(); sign = 0; } } else if (sign == 1) { GUI.Label(new Rect(Screen.width / 2 - 60, 100, 120, 50), "You Win!", text_style); if (GUI.Button(new Rect(Screen.width / 2 - 50, 150, 100, 50), "Restart", button_style)) { action.Restart(); sign = 0; } } }
void OnGUI() { float width = Screen.width / 6; float height = Screen.height / 12; action.Check(); GUIStyle style = new GUIStyle(); style.normal.textColor = Color.red; style.fontSize = 30; GUI.Label(new Rect(320, 100, 50, 200), gameMessage, style); if (GUI.Button(new Rect(0, 0, width, height), "Restart")) { action.Restart(); } string paused_title = SSDirector.getInstance().Paused ? "Resume" : "Pause!"; if (GUI.Button(new Rect(width, 0, width, height), paused_title)) { SSDirector.getInstance().Paused = !SSDirector.getInstance().Paused; } }