private IEnumerator ShowNextQuestionCoroutine() { yield return(new WaitForSeconds(AnswerShowTime)); CurrentQuestion++; if (CurrentQuestion > m_QuizQuestions.Count - 1) { QuizEvents.QuizFinishedEvent(m_Points); } else { UIController.SetupUIForQuestion(m_QuizQuestions[CurrentQuestion]); } }
public void SubmitAnswer(int answerNumber) { bool isCorrect = answerNumber == m_QuizQuestions[CurrentQuestion].CorrectAnswer; if (isCorrect) { QuizEvents.AnswerCorrectEvent(answerNumber); m_Points++; } else { QuizEvents.AnswerIncorrectEvent(m_QuizQuestions[CurrentQuestion].CorrectAnswer, answerNumber); } ShowNextQuestion(); }
private void Update() { if (!m_Running) { return; } if (m_CurrentTime >= m_MaxTime) { StopTimer(); m_Slider.value = 1f; QuizEvents.TimeOutEvent(); return; } m_Slider.value = m_CurrentTime / m_MaxTime; m_CurrentTime += Time.unscaledDeltaTime; }