Exemplo n.º 1
0
 public void Exit()
 {
     if (transition.gameObject.activeSelf)
     {
         transition.PlayExit();
     }
 }
Exemplo n.º 2
0
    IEnumerator DoExitSeqAnimator(AnimatorEnterExit seq)
    {
        seq.PlayExit();
        yield return(seq.PlayExitWait());

        seq.gameObject.SetActive(false);
    }
Exemplo n.º 3
0
    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;
        }
    }
Exemplo n.º 4
0
        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();
        }