Example #1
0
    /// <summary>
    /// Show the question, answers and duration on the screen.
    /// Only shows the question and plays audio - needs to be called AFTER having shown the relevant media clip if it exists.
    /// Called by QuizManager.
    /// </summary>
    /// <param name="q"></param>
    public void ShowQuestion(QuizQuestion q)
    {
        Clear();
        questionComponent.text = q.Question;
        for (int i = 0; i < q.Answers.Count; i++)
        {
            answerComponents[i].text = String.Format("{0}: {1}", GetAnswerLetterByIndex(i), q.Answers[i]);
        }

        PlayAudioFromResources(String.Format($"Quiz/Audio/{q.DetermineAudioName()}"));
        StartCoroutine(FadeAudioSource.StartFade(ambientSource, 1.0f, 1.0f));
    }