Esempio n. 1
0
 public void SetScheduleItem(int index, EnemySchedule item)
 {
     if (index < 0 || index > wave.Count)
     {
         return;
     }
     wave[index] = item;
 }
Esempio n. 2
0
 public EnemySchedule GetNextScheduleItem()
 {
     if (wave.Count > 0)
     {
         EnemySchedule t = wave[0];
         wave.RemoveAt(0);
         return(t);
     }
     return(null);
 }
Esempio n. 3
0
    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;
        }
    }
Esempio n. 4
0
 public void AddScheduleItem(EnemySchedule item)
 {
     wave.Add(item);
 }