IEnumerator StartWave(float delay) { waveStarting = true; float waveStartTime = Time.time + delay; while (Time.time < waveStartTime) { gui.UpdateTimer(waveStartTime - Time.time); yield return(null); } gui.UpdateTimer(0f); int waveSize = Mathf.RoundToInt(baseWaveSize + (baseWaveSize * (wave - 1) * waveSizeFactor)); zombieManager.SpawnZombies(waveSize); waveStarting = false; }