public void SetScheduleItem(int index, EnemySchedule item) { if (index < 0 || index > wave.Count) { return; } wave[index] = item; }
public EnemySchedule GetNextScheduleItem() { if (wave.Count > 0) { EnemySchedule t = wave[0]; wave.RemoveAt(0); return(t); } return(null); }
private void LoadWaveEnemy() { switch (_currentManagerState) { case (ManagerState.Prep): return; case (ManagerState.Active): if ((Time.time - _spawntimedinterval) > delay) { EnemySchedule es = _enemyQueue.Dequeue(); SpawnEnemy(es.token); if (_enemyQueue.Count == 0) { SetNextWave(); } ResetTime(); } break; case (ManagerState.Done): return; case (ManagerState.WaitForPrevWave): if (GetActiveCount() == 0) { _currentManagerState = ManagerState.Active; _spawntimedinterval = Time.time; if (OnWaveStarted != null) { OnWaveStarted(); Debug.Log("wave triggered"); } } break; case (ManagerState.WaitForTowers): return; } }
public void AddScheduleItem(EnemySchedule item) { wave.Add(item); }