// Update is called once per frame void Update() { if (wave != null && wave.Started && !wave.Finished) { clearTime += Time.deltaTime; if (!wave.Finished && WaveFinished) { wave.Clear(clearTime); } if (wave.Finished) { OnWaveFinishedEvent(this.wave); } } }