public void Exit() { if (transition.gameObject.activeSelf) { transition.PlayExit(); } }
IEnumerator DoExitSeqAnimator(AnimatorEnterExit seq) { seq.PlayExit(); yield return(seq.PlayExitWait()); seq.gameObject.SetActive(false); }
public void Next() { switch (mCurMode) { case Mode.PickCategories: mCurMode = Mode.Score; ApplyDragInstruct(); hierarchyGO.SetActive(false); mRout = StartCoroutine(DoScore()); break; case Mode.Score: mCurMode = Mode.None; categoryInstructGO.SetActive(false); scoreBase.PlayExit(); nextBase.PlayExit(); Close(); break; } }
IEnumerator DoQuestionSequence(int startIndex, int count) { var lolMgr = LoLManager.instance; var gameDat = GameData.instance; for (int i = startIndex; i < count; i++) { if (lolMgr.curProgress >= lolMgr.progressMax) //completed { break; } mQuestion = gameDat.GetCurrentQuestion(); if (mQuestion == null) { break; } mSlotCount = mQuestion.answers.Length; if (gameDat.signalQuestion) { gameDat.signalQuestion.Invoke(); } //question dialog StartCoroutine(DoDialogEnter(questionDialog, questionDialogTransition, mQuestion.questionTextRef)); //deck gameDat.GetCards(mQuestion, mAnswers); deckWidget.Setup(mAnswers, cardDragArea); deckTransition.gameObject.SetActive(true); deckTransition.PlayEnter(); //show/reset slots for (int j = 0; j < mSlotCount; j++) { slots[j].Enter(); } //fail-safe: fewer slots than before for (int j = mSlotCount; j < slots.Length; j++) { slots[j].Hide(); } //wait for slots to be filled mCurScore = 0; mErrorCount = 0; while (!IsSlotsFilled()) { yield return(null); } //update score and progress lolMgr.ApplyProgress(lolMgr.curProgress + 1, lolMgr.curScore + mCurScore); //hide deck and question deckTransition.PlayExit(); questionDialogTransition.PlayExit(); while (deckTransition.isPlaying || questionDialogTransition.isPlaying) { yield return(null); } deckTransition.gameObject.SetActive(false); questionDialog.gameObject.SetActive(false); questionDialogEndGO.SetActive(false); questionDialogTransition.gameObject.SetActive(false); if (!string.IsNullOrEmpty(mQuestion.resultTextRef)) { if (gameDat.signalResult) { gameDat.signalResult.Invoke(); } //result yield return(DoDialogEnter(resultDialog, resultDialogTransition, mQuestion.resultTextRef)); //wait for result click mIsResultDone = false; resultInteractGO.SetActive(true); while (!mIsResultDone) { yield return(null); } resultInteractGO.SetActive(false); //hide result dialog yield return(resultDialogTransition.PlayExitWait()); resultDialog.gameObject.SetActive(false); resultDialogEndGO.SetActive(false); resultDialogTransition.gameObject.SetActive(false); } else { yield return(new WaitForSeconds(1.0f)); } } //hide slots for (int i = 0; i < mSlotCount; i++) { slots[i].Exit(); } while (IsSlotsTransitioning()) { yield return(null); } for (int i = 0; i < mSlotCount; i++) { slots[i].Hide(); } Close(); }