Пример #1
0
 //checks whether the answer that is pressed is correct or not.
 public void AnswerButtonClicked(bool isCorrect)
 {
     if (isCorrect)
     {
         audio.clip = RightAnswer;
         audio.Play();
         scoreTracker.AddToTotalAnswers();
         playerScore += allRoundData.pointsAddedForCorrectAnswer;
         scoreDisplayText.text = "Questions Correctly Answered: " + playerScore.ToString();
     }
     if (questionPool.Length > questionIndex + 1)
     {
         questionIndex++;
         ShowQuestion();
     }
     else
     {
         EndRound();
     }
 }