public void NextQuestion(QuestionData nextQuestion)
 {
     currentQuestionIndex++;
     if (currentQuestionIndex < m_QuestionList.Count)
     {
         currentQuestion = nextQuestion;
         questionPanel.LoadQuestion(nextQuestion);
     }
     else
     {
         EndQuestions();
     }
 }
 public void NextQuestion()
 {
     currentQuestionIndex++;
     if (currentQuestionIndex < m_QuestionList.Count)
     {
         currentQuestion = m_QuestionList[currentQuestionIndex];
         questionPanel.LoadQuestion(currentQuestionIndex);
     }
     else
     {
         EndQuestions();
     }
 }
Example #3
0
 public void LoadQuestion(QuestionData questionData)
 {
     RemoveAnswerButtons();
     questionText.text = questionData.questionText;
     for (int i = 0; i < questionData.answerList.Count; i++)
     {
         GameObject answerButtonGameObject = answerButtonObjectPool.GetObject();
         answerButtonGameObjects.Add(answerButtonGameObject);
         AnswerSelectButton answerButton = answerButtonGameObject.GetComponent <AnswerSelectButton>();
         answerButton.Initialize(questionData.answerList[i]);
         answerButton.transform.SetParent(layout.transform);
         answerButton.transform.localScale = Vector3.one;
     }
 }
 // Use this for initialization
 private void Start()
 {
     currentQuestionIndex = 0;
     currentQuestion      = m_QuestionList[currentQuestionIndex];
 }