Esempio n. 1
0
        private void OnJumpFinished()
        {
            if (m_bIsCorrect)
            {
                ReportCorrectEvent();

                --m_iLeftWinCount;
                if (m_iLeftWinCount <= 0)
                {
                    //show window
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Win);
                    ChangeToStatus(RegularityStatus.Win);
                    m_UIWindow.OnWin();
                }
                else
                {
                    ReloadScene();
                }
            }
            else
            {
                ReportWrongEvent();

                --m_iLeftRedFlower;
                m_UIWindow.SetLeftFlower(m_iLeftRedFlower);
                if (m_iLeftRedFlower <= 0)
                {
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Lose);
                    ChangeToStatus(RegularityStatus.Lose);
                    m_UIWindow.OnLose();
                }
                else
                {
                    //jump back
                    TriggerJumpToTarget(--m_iCurrentJumpedIndex);
                    ChangeToStatus(RegularityStatus.Repostion);
                    TriggerToShowPilesAnim();
                }
            }
        }
        private void OnJumpFinished()
        {
            if (m_bIsSucceed)
            {
                //event report
                if (m_bLastStatusIsWin)
                {
                    ++m_iKeepStatusCount;
                }
                else
                {
                    m_iKeepStatusCount = 0;
                }
                m_bLastStatusIsWin = true;
                switch (m_iKeepStatusCount)
                {
                case 0:
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Correct);
                    break;

                case 1:
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Correct2);
                    break;

                default:
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Correct3);
                    break;
                }


                if (m_iLimitCount == 1)
                {
                    m_UIWindow.SetLeftCount(0);
                    //trigger next stage
                    m_UIWindow.OnWin();
                    m_bIsFinished = true;
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Win);
                }
                else
                {
                    --m_iLimitCount;
                    m_UIWindow.SetLeftCount(m_iLimitCount);
                    OnReset();
                }
            }
            else
            {
                //event report
                if (!m_bLastStatusIsWin)
                {
                    ++m_iKeepStatusCount;
                }
                else
                {
                    m_iKeepStatusCount = 0;
                }
                m_bLastStatusIsWin = false;
                switch (m_iKeepStatusCount)
                {
                case 0:
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Wrong);
                    break;

                case 1:
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Wrong2);
                    break;

                default:
                    m_DiffMgr.ReportEvent(RegularityGameDifficultyManager.RegularityEventType.Wrong3);
                    break;
                }
                --m_iLeftRedFlower;
                m_UIWindow.SetLeftFlower(m_iLeftRedFlower);

                m_iMovingPilesIndex = m_iCurrentJumpIndex;
                m_bIsResetPos       = true;
                m_iCurrentJumpIndex = -1;
                TriggerToJump(m_fJumpSpendTime, false);
                //play anim
                m_bIsMovingPiles = true;
                GameObject    obj   = m_ElementList[m_iMovingPilesIndex].m_ObjRoot;
                TweenPosition tween = obj.AddComponent <TweenPosition>();
                tween.from       = obj.transform.localPosition;
                tween.from.y     = m_fMovePilesTop;
                tween.to         = obj.transform.localPosition;
                tween.to.y       = m_fMovePilesBottom;
                tween.worldSpace = false;
                tween.duration   = m_fMovePilesDuringtime;
                tween.AddOnFinished(OnMovePilesBottomFinished);
            }
        }