Esempio n. 1
0
 private void CheckIfSumIsOK()
 {
     if (number1 != null && number2 != null && number3 != null)
     {
         int one   = ConvertStringToInt(number1);
         int two   = ConvertStringToInt(number2);
         int three = ConvertStringToInt(number3);
         if (mathController.CheckIfMathIsOk(one, two, three))
         {
             longerAudio.clip = rightAnswerSounds[Random.Range(0, rightAnswerSounds.Count)];
             longerAudio.Play();
             SetPoints();
             RemoveAllNumberBoxes();
             timerController.RestartTimerAndReduceTime();
         }
         else
         {
             StartCoroutine(WrongNumberAnswer());
             longerAudio.clip = wrongAnswerSounds[Random.Range(0, wrongAnswerSounds.Count)];
             longerAudio.Play();
         }
     }
 }