void Awake() { numberOfEvents = 0; writingSpeed = 1f; CurrentEvent = EventsGenerator.FirstEvent(); SetQuestionText(); FirstAnswerButton.onClick.RemoveAllListeners(); FirstAnswerButton.onClick.AddListener(() => { IntroductionText(); }); SecondAnswerButton.onClick.RemoveAllListeners(); SecondAnswerButton.onClick.AddListener(() => { Quit(); }); }
private IEnumerator AsyncHandler(Tuple <string, int, string> answer) { int nextQuestionID = answer.Item2; if (nextQuestionID < 0) { switch (nextQuestionID) { // NATURE case -2: yield return(ChangeBackground(ImageManager._NatureBackground, true, null)); break; // DICTATEUR case -3: yield return(ChangeBackground(ImageManager._DictatorBackground, true, null)); break; // Chaos case -1: yield return(ChangeBackground(ImageManager._ChaosBackground, true, null)); break; // Explosion case -4: yield return(ChangeBackground(ImageManager._ExplosionBackground, true, ImageManager._ExplosionAnimation)); break; case -5: case -8: yield return(ChangeBackground(ImageManager._UtopiaBackground, true, null)); break; } } else { if (numberOfEvents == 1) { yield return(BigBang()); } } Title = answer.Item3; FirstAnswer = ""; SecondAnswer = ""; // Affiche le résultat yield return(HideAndDisplay()); yield return(new WaitForSeconds(2f)); if (nextQuestionID < 0) { yield return(new WaitForSeconds(3f)); if (nextQuestionID != -5 && nextQuestionID != -8) { CurrentEvent = EventsGenerator.FirstEvent(); yield return(ResetMenu()); } else { yield return(DisplayCredits()); } } else { if (numberOfEvents == 0) { yield return(ChangeBackground(ImageManager._BlackBackground, false, null)); } if (numberOfEvents == 7) { yield return(ChangeBackground(ImageManager._Antique, false, null)); } if (numberOfEvents == 13) { yield return(ChangeBackground(ImageManager._Medieval, false, null)); } if (numberOfEvents == 15) { yield return(ChangeBackground(ImageManager._Industry, false, null)); } if (numberOfEvents == 16) { yield return(ChangeBackground(ImageManager._Current, false, null)); } numberOfEvents++; NextQuestion(answer.Item2); } }