// Update is called once per frame void Update() { //Check if all current spawned enemies are dead (when dead, they remove themself from the list and delete self if (SmartZombies.Count == 0 && RegularZombies.Count == 0 && finishedSZombieSpawning && finishedRZombieSpawning) { allDead = true; gaC.multipleGenerationEpoch(); waveNumber++; } //If all are dead, instantiate a new wave if (allDead) { newWave(waveNumber); allDead = false; } }