Beispiel #1
0
        public override void UpdateLogic(int delta)
        {
            if ((this.m_bStarted && this.bCountingSpawn) && ((this.SpawnTimes <= 0) || (this.m_spawnCounter > 0)))
            {
                this.m_spawnTimer -= delta;
                if (this.m_spawnTimer <= 0)
                {
                    this.m_spawnTimer = this.SpawnInternval;
                    this.DoSpawn();
                    SCommonSpawnEventParam prm = new SCommonSpawnEventParam((VInt3)base.gameObject.transform.position, this.m_spawnTimer, this.AlertPreroll, this.QuerySpawnObjType());
                    Singleton <GameEventSys> .instance.SendEvent <SCommonSpawnEventParam>(GameEventDef.Event_SpawnGroupSpawn, ref prm);

                    if (this.IntervalRule == EIntervalRule.UsedUp)
                    {
                        this.bCountingSpawn = false;
                    }
                    this.m_spawnCounter--;
                }
            }
        }
        public override void UpdateLogic(int delta)
        {
            if (!this.isStartup)
            {
                return;
            }
            if (this.InvalidTime > 0)
            {
                this.m_invalidTimer += delta;
                if (this.m_invalidTimer >= this.InvalidTime)
                {
                    this.Stop();
                    return;
                }
            }
            if (!this.bCountingSpawn)
            {
                return;
            }
            if (this.SpawnTimes > 0 && this.m_spawnCounter <= 0)
            {
                return;
            }
            this.m_spawnTimer -= delta;
            if (this.m_spawnTimer <= 0)
            {
                this.m_spawnTimer = this.SpawnInternval;
                this.DoSpawn();
                SCommonSpawnEventParam sCommonSpawnEventParam = new SCommonSpawnEventParam((VInt3)base.gameObject.transform.position, this.m_spawnTimer, this.AlertPreroll, this.QuerySpawnObjType());
                Singleton <GameEventSys> .get_instance().SendEvent <SCommonSpawnEventParam>(GameEventDef.Event_SpawnGroupSpawn, ref sCommonSpawnEventParam);

                if (this.IntervalRule == CommonSpawnGroup.EIntervalRule.UsedUp)
                {
                    this.bCountingSpawn = false;
                }
                this.m_spawnCounter--;
            }
        }