void Start() { Text text = GetComponent <Text>(); foreach (SubWave subWave in WaveFactory.GenerateWave(WaveNumber.waveNumber)) { foreach (StatsHolder statsHolder in subWave.GetEnemies()) { if (!enemyTypeToAmount.ContainsKey(statsHolder.Name)) { enemyTypeToAmount.Add(statsHolder.Name, 1); } else { enemyTypeToAmount[statsHolder.Name]++; // enemyTypeToAmount[statsHolder.Name] + 1); } } } string enemyInfoText = ""; List <string> nameList = new List <string>(); foreach (KeyValuePair <string, int> entry in enemyTypeToAmount) { nameList.Add(entry.Key + ": " + entry.Value + "\n"); } nameList.Sort(); foreach (string name in nameList) { enemyInfoText += name; } text.text = enemyInfoText.ToUpper(); }
void Start() { List <SubWave> wave = WaveFactory.GenerateWave(WaveNumber.waveNumber); requiredKillEnemiesInWave = 0; foreach (SubWave subWave in wave) { requiredKillEnemiesInWave += subWave.RequiredKillEnemyCount(); } this.requireKillUnitsSpawned = 0; this.enemySpawner.SpawnWave(wave); }