void NextQuestion() { SpeakBTN.color = SpeakOldColor; TextWord.transform.parent.GetComponent <Image>().color = OldWordColor; ImageAnswer1.GetComponent <Image>().color = OldImageColor; ImageAnswer2.GetComponent <Image>().color = OldImageColor; TextAnswer1.transform.parent.GetComponent <Image>().color = OldAnswerColor; TextAnswer2.transform.parent.GetComponent <Image>().color = OldAnswerColor; GetQuestionFromList(); }
IEnumerator AnswerDisplay(bool Correct, bool Top) { if (CurrentQuestion.CorrectAnswer == CorrectAnswerDirection.FirstAnswer) { Speak(CurrentQuestion.Answer1); } else { Speak(CurrentQuestion.Answer2); } CoroutineRunning = true; if (!T.TimeUp) { if (Correct) { Score += 10; SoundController.PlaySoundCorrect(); //for Full Game Controller if (!IsMainController) { GameControllerScript.Score += 10; } TextWord.transform.parent.GetComponent <Image>().color = CorrectColor; if (Top) { ImageAnswer1.GetComponent <Image>().color = CorrectColor; TextAnswer1.transform.parent.GetComponent <Image>().color = CorrectColor; ImageAnswer2.GetComponent <Image>().color = Transparent; TextAnswer2.transform.parent.GetComponent <Image>().color = Transparent; TextAnswer2.text = ""; } else { ImageAnswer2.GetComponent <Image>().color = CorrectColor; TextAnswer2.transform.parent.GetComponent <Image>().color = CorrectColor; ImageAnswer1.GetComponent <Image>().color = Transparent; TextAnswer1.transform.parent.GetComponent <Image>().color = Transparent; TextAnswer1.text = ""; } } else { SoundController.PlaySoundWrong(); TextWord.transform.parent.GetComponent <Image>().color = WrongColor; if (Top) { ImageAnswer1.GetComponent <Image>().color = WrongColor; TextAnswer1.transform.parent.GetComponent <Image>().color = WrongColor; } else { ImageAnswer2.GetComponent <Image>().color = WrongColor; TextAnswer2.transform.parent.GetComponent <Image>().color = WrongColor; } } } else { if (T.PlaySound) { SoundController.PlaySoundTimeUP(); T.PlaySound = false; } TextWord.transform.parent.GetComponent <Image>().color = WrongColor; ImageAnswer1.GetComponent <Image>().color = WrongColor; TextAnswer1.transform.parent.GetComponent <Image>().color = WrongColor; ImageAnswer2.GetComponent <Image>().color = WrongColor; TextAnswer2.transform.parent.GetComponent <Image>().color = WrongColor; } yield return(new WaitForSeconds(TimeBetweenQuestions)); ChangeStars(); NextQuestion(); CoroutineRunning = false; }