private void Awake() { instance = this; StaticMethods.AssignButtonAction(btnStart, StartQuiz); DisablePanels(); }
public override void AssignAnswer(int buttonIndex, int _i) { base.AssignAnswer(buttonIndex, _i); PanelText panelText = PanelText.instance; // Set the correct graphic for this answer. string[] arrAnswers = answers.GetAnswersArray(); // Target the current button and assigns the text that matches it's answer. Quiz.instance.questionPanels.text.GetComponent <PanelText>().textButtons[buttonIndex].transform.GetChild(0).GetComponent <Text>().text = arrAnswers[_i]; StaticMethods.AssignButtonAction(Quiz.instance.questionPanels.text.GetComponent <PanelText>().textButtons[buttonIndex], (_i == 0) ? (UnityAction)CorrectAnswer : IncorrectAnswer); }
public override void AssignAnswer(int buttonIndex, int _i) { base.AssignAnswer(buttonIndex, _i); PanelVideo panelVideo = PanelVideo.instance; // Set the correct graphic for this answer. VideoClip[] arrAnswers = answers.GetAnswersArray(); Quiz.instance.questionPanels.video.GetComponent <PanelVideo>().videoButtons[buttonIndex].transform.GetComponent <VideoPlayer>().clip = arrAnswers[_i]; StaticMethods.AssignButtonAction(Quiz.instance.questionPanels.video.GetComponent <PanelVideo>().videoButtons[buttonIndex], (_i == 0) ? (UnityAction)CorrectAnswer : IncorrectAnswer); //TODO play the video... Quiz.instance.questionPanels.video.GetComponent <PanelVideo>().videoButtons[buttonIndex].transform.GetComponent <VideoPlayer>().Play(); // Target the current button and assigns the text that matches it's answer. // quiz.answerButtons[buttonIndex].transform.GetChild(0).GetComponent<VideoPlayer>().clip = arrAnswers[_i]; }
private void Awake() { StaticMethods.AssignButtonAction(_feedBackFailText, ProceedFromFeedbackFail); StaticMethods.AssignButtonAction(_feedBackPassText, ProceedFromFeedbackPass); }