private void LaunchNextWave(Wave wave) { wave.WaveClearedEvent -= LaunchNextWave; CurrentWaveIndex++; if (CurrentWaveIndex < TotalWavesCount) { Waves[CurrentWaveIndex].LaunchWave(); } else { GlobalEventSystem<GameHasEndedEvent>.Raise(new GameHasEndedEvent(false)); } }
/// <summary> /// Handler method for taking the wave cleared /// </summary> /// <param name="wave"></param> private void CurrentWaveWasCleared(Wave wave) { PlayerStatus.Instance.Money += wave.CompletionMoney; LaunchNextWave(wave); }