public static EventGameProcedure Get(Action action)
 {
     if (sIns == null)
     {
         sIns = new EventGameProcedure();
     }
     sIns.action = action;
     return(sIns);
 }
Exemplo n.º 2
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();
 }
Exemplo n.º 3
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));
     }
 }
Exemplo n.º 4
0
 private void OnEventGameProcedure(EventGameProcedure procedure)
 {
     if (procedure.action == EventGameProcedure.Action.BossWave)
     {
         ToastBossWave();
     }
     else if (procedure.action == EventGameProcedure.Action.GameEndWin)
     {
         ShowGameEndPanel(true);
     }
     else if (procedure.action == EventGameProcedure.Action.GameEndLose)
     {
         ShowGameEndPanel(false);
     }
 }
Exemplo n.º 5
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);
            }
        }