Example #1
0
    private void Show()
    {
        Question question = QuestionsManager.GetCurrentQuestion();

        questionText.text = question.QuestionText;

        if (question.Answers.Length == 2)
        {
            twoOptions.SetActive(true);

            int i = 0;
            foreach (Text text in twoOptions.GetComponentsInChildren <Text>())
            {
                text.text = char.ConvertFromUtf32(65 + i) + ": " + question.Answers[i];
                i++;
            }
        }
        else
        {
            fourOptions.SetActive(true);

            int i = 0;
            foreach (Text text in fourOptions.GetComponentsInChildren <Text>())
            {
                text.text = char.ConvertFromUtf32(65 + i) + ": " + question.Answers[i];
                i++;
            }
        }

        gameObject.SetActive(true);
    }