void Check(int n) { isCheck = true; Debug.Log("n: " + n); if (answer == n) { CommonData.Score += 1; Game3PanelText.text = "맞았어요!"; } else { CommonData.Score -= 1; Game3PanelText.text = "틀렸어요!"; } gameState = CommonData.State.GAME2; gameTime = 0; }
void Update() { gameTime -= Time.deltaTime; TimerSlider.value = gameTime / totalGameTime; if (TimerSlider.value <= 0.3) { Client.instance.SendMsg("1"); } if (TimerSlider.value <= 0) { switch (gameState) { case CommonData.State.GAME1: gameTime = 3f; Game1Panel.SetActive(false); PausePanel.SetActive(true); Game2Panel.SetActive(false); Game3Panel.SetActive(false); gameState = CommonData.State.PAUSE; break; case CommonData.State.PAUSE: gameTime = 3f; gameState = CommonData.State.GAME2; Game2(); break; case CommonData.State.GAME2: gameTime = 3f; Game1Panel.SetActive(false); PausePanel.SetActive(false); Game2Panel.SetActive(false); Game3Panel.SetActive(true); for (int i = 0; i < allGameObject.Count; i++) { Destroy(allGameObject[i]); } allGameObject.Clear(); if (isCheck == false) { CommonData.Score -= 2; Game3PanelText.text = "시간초과ㅠㅠ"; } gameState = CommonData.State.GAME3; break; case CommonData.State.GAME3: gameTime = 3f; if (count >= 15) { SceneManager.LoadScene("End"); } else { ExampleFigures = new List <int>(); QuestionFigures = new List <int>(); gameState = CommonData.State.GAME1; Debug.Log(CommonData.Score); Game1(); } break; } } }
public void EndGame() { count = 15; gameState = CommonData.State.GAME3; }