private void WaveCompleted(WaveHandler handler) { RemoveWave(handler); OnWaveFinished?.Invoke(handler.Wave, handler); if (_activeWaves.Count == 0) { ChangeState(RoundState.Ready); } }
private void Update() { if (hasWaveFinished) { return; } if (order >= maxOrder) { return; } bool allNull = true; for (int i = 0; i < spawningCoroutines.Length; i++) { if (spawningCoroutines[i] != null) { allNull = false; } } if (allNull) { order++; if (order == maxOrder) { //OnAllUfosSpawned?.Invoke(); //print("wave finished"); hasWaveFinished = true; OnWaveFinished?.Invoke(); } StartWaveParts(order); } }