internal Form irAPanelVideo() { var form = Application.OpenForms.OfType <PanelVideo>().FirstOrDefault(); PanelVideo hijo = form ?? new PanelVideo(this); return(hijo); }
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]; }
void Start() { instance = this; videoButtons = Quiz.instance.questionPanels.video.GetComponentsInChildren <Button>(true); }