private void DisplayNextQuestion() { SurveyQuestion surveyQuestion = m_Questions[m_QuestionIndex]; QuestionGroup group = Instantiate(m_QuestionGroupPrefab, m_QuestionGroupRoot).GetComponent <QuestionGroup>(); group.Initialize(surveyQuestion, OnAnswerChosen); m_QuestionIndex++; }
private void OnAnswerChosen(QuestionGroup inQuestionGroup) { if (!m_SelectedAnswers.ContainsKey(inQuestionGroup.Id)) { if (m_SelectedAnswers.Count < m_Questions.Count - 1) { DisplayNextQuestion(); } else { m_SubmitButton.GetComponentInChildren <TextMeshProUGUI>().text = "Submit"; m_SubmitButton.gameObject.SetActive(true); } } m_SelectedAnswers[inQuestionGroup.Id] = inQuestionGroup.SelectedAnswer; }