IEnumerator StartSpawn() { Debug.Log("Start spawning"); while (allWaves.Count > 0) { Wave currentW = allWaves.Dequeue(); while (currentW.allAttackersEnum.Count > 0) { AttackerEnum newAttackerName = currentW.allAttackersEnum.Dequeue(); Attacker newAttacker = currentLevelData.FindAttacker(newAttackerName); if (newAttacker) { Spawn(newAttacker); } yield return(new WaitForSeconds(TEMP_timeBetweenSpawn)); } if (allWaves.Count > 0) { LaunchTimer(); yield return(new WaitUntil(() => currentTime <= 0)); } else { FindObjectOfType <CoreGame>().SpawnerFinishedCall(this); } } }
public Attacker FindAttacker(AttackerEnum attackerName) { if (allAvailableAttackersDictionary.ContainsKey(attackerName)) { return(allAvailableAttackersDictionary[attackerName]); } else { return(null); } }