// Called by the HUD script upon clicking of next wave button or Enter key press public void StartNextWave() { if (stateSystem.IsGameWave()) { // Clear all dead bodies foreach (GameObject enemy in deadBodies) { if (enemy != null) { enemy.GetComponent <EnemyController>().StartFadeout(); } } deadBodies.Clear(); // Reset cooldown for all abilities playerAction.ResetAllCooldowns(); hud.ResetAllCooldownIndicators(); // Update states stateSystem.SetWaveState(StateSystem.WaveState.WaitingWaveSpawn); waveSystem.SetNextWave(); waveCount = waveSystem.GetWaveCount(); waveKilled = 0; getNewSpawn = true; } }