private void SelectQuestionAudio() { //get the random number int val = UnityEngine.Random.Range(0, questions.Count); //set the selectedQuetion selectedQuetion = questions[val]; //send the question to quizGameUI RAGame.SetAudio(selectedQuetion); questions.RemoveAt(val); }
/// <summary> /// Method which populate the question on the screen /// </summary> /// <param name="question"></param> public void SetAudio(QuestionRA question) { switch (question.questionType) { case QuestionTypeRA.AUDIO: questionAudio.transform.gameObject.SetActive(true); audioLength = question.audioClip.length; StartCoroutine(PlayAudio()); break; } }
/// <summary> /// Method which populate the question on the screen /// </summary> /// <param name="question"></param> public void SetQuestion(QuestionRA question) { this.question = question; questionInfoText.text = question.questionInfo; List <string> ansOptions = T_RA_List.ShuffleListItems <string>(question.options); for (int i = 0; i < options.Count; i++) { options[i].GetComponentInChildren <Text>().text = ansOptions[i]; options[i].name = ansOptions[i]; } answered = false; }