Beispiel #1
0
    private void checkAnswer_Main()
    {
        int userAnswer = Int32.Parse(answerString);

        if (userAnswer.Equals(correctAnswer))
        {
            refreshQuestionAndAnswer();
        }
        else
        {
            mainGameController.gameOver();
        }
    }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     time -= Time.deltaTime;
     countdownText.text = Mathf.Round(time).ToString();
     if (gameController != null)
     {
         if (time < 1 || gameController.gameDone)
         {
             gameController.gameOver();
             countdownText.text = "done";
         }
     }
     else
     {
         if (time < 1 || mainGameCtrl.gameDone)
         {
             mainGameCtrl.gameOver();
             countdownText.text = "done";
         }
     }
 }