IEnumerator StartResultAnimation(bool isCorrect) { PrefabManager.Instance.destroyQuestionPanel.transform.SetAsFirstSibling(); PrefabManager.Instance.destroyChoicePanel.GetComponent <CanvasGroup>().alpha = 0f; var bg = PrefabManager.Instance.bg.GetComponent <BackgroundController>(); if (isCorrect) { bg.ShowO(); } else { bg.ShowX(); } yield return(new WaitWhile(() => bg.isOXshow == true)); yield return(new WaitForSeconds(PrefabManager.waitforseconds)); //PrefabManager.Instance.count.GetComponent<QuestionCountController>().SentenceIncreaseCount(); if (isCorrect) { //PrefabManager.Instance.score.GetComponent<ScoreController>().Sentence_IncreaseScore(); UserDataManager.Instance.IncreaseUserSentenceScore(); } PrefabManager.Instance.destroyChoicePanel.GetComponent <CanvasGroup>().alpha = 0f; Sentence_DataLoader.Sentence_SetRecord(isCorrect); Sentence_DataLoader.NextQuestion(); int currentIndex = Sentence_DataLoader.GetCurrentSentenceIndex(); GameModeManager.SetGameFinished(currentIndex); PrefabManager.Instance.count.GetComponent <QuestionCountController>().SentenceIncreaseCount(currentIndex); PrefabManager.Instance.CreateSentenceCard(); if (GameModeManager.IsTurnBaseMode()) { PrefabManager.Instance.tbar.GetComponent <TimeController>().timeLeft = 0f; } }
private IEnumerator TurnBaseDisappearSentence() { tbar.GetComponent <TimeController>().PauseTimer(); destroyQuestionPanel.GetComponent <CanvasGroup>().alpha = 0f; destroyChoicePanel.GetComponent <CanvasGroup>().alpha = 0f; bg.GetComponent <BackgroundController>().SetBothInvisible(); bg.GetComponent <BackgroundController>().ShowX(); //if (combo) //{ // OX_DataLoader.combocount = 0; // //combo.GetComponent<ComboController>().HideCombo(); //} yield return(new WaitForSeconds(cardAnimationInterval)); Sentence_DataLoader.NextQuestion(); CreateSentenceCard(); }