Пример #1
0
 protected override void OnBegin()
 {
     base.OnBegin();
     Analytics.Event.GameStart(D.I.gameLevel);
     getCoin                = 0;
     progress               = 0;
     mLastWaveIndex         = -1;
     D.I.adReviveCount      = D.I.noAd ? 0 : 1;
     D.I.diamondReviveCount = D.I.IsVip() ? 1 : 0;
     D.I.CostEnergy(CT.table.energyBattleCost);
     Unibus.Dispatch(EventGameProcedure.Get(EventGameProcedure.Action.GameBegin));
     mWaveModule.Start();
 }
Пример #2
0
 protected override void OnEnd(bool isWin)
 {
     base.OnEnd(isWin);
     Analytics.Event.GameOver(D.I.gameLevel, isWin, progress);
     mWaveModule.Stop();
     D.I.BattleEnd(isWin);
     if (isWin)
     {
         Unibus.Dispatch(EventGameProcedure.Get(EventGameProcedure.Action.GameEndWin));
     }
     else
     {
         Unibus.Dispatch(EventGameProcedure.Get(EventGameProcedure.Action.GameEndLose));
     }
 }
Пример #3
0
        private void CheckGameState()
        {
            if (!isRunning)
            {
                return;
            }

            if (mLastWaveIndex != mWaveModule.waveIndex && mWaveModule.isBossWave)
            {
                Unibus.Dispatch(EventGameProcedure.Get(EventGameProcedure.Action.BossWave));
            }
            mLastWaveIndex = mWaveModule.waveIndex;

            if (mWaveModule.isFinalWave &&
                mWaveModule.isStart &&
                EntityManager.Count <VirusBase>() <= 0 &&
                mWaveModule.isSpawnOver)
            {
                GameModeManager.Instance.End(true);
            }
        }