void LateUpdate() { if (enemiesAlive > 0) { return; } if (GameManager.gameEnd) { return; } if (!GameMode.survival) { if (waveIndex == maxWaves) { gameManager.WinLevel(); this.enabled = false; //disables 'this' script return; } } if (enemiesAlive <= 0) { startButton.GetComponent <Button>().interactable = true; FFButton.GetComponent <Button>().interactable = false; if (waveStarted) { waveStarted = false; PlayerStats.money += 100 + (waveIndex * 5); currentWave++; } } autoStart = Settings.AutoStart; if ((GameMode.survival && enemiesAlive == 0) || Input.GetKeyDown(KeyCode.Space) || (enemiesAlive == 0 && autoStart && firstRoundStarted)) { StartWave(); } }
public void StartWave() { if (firstRoundStarted == false) { firstRoundStarted = true; } startButton.GetComponent <Button>().interactable = false; FFButton.GetComponent <Button>().interactable = true; gameManager.LastControlled(); int r = PlayerStats.rounds + 1; if (r >= 10) { Enemy.difficultyMultiplier += 0.02f; } if (((r) >= 15) && ((r - 5) % 10 == 0)) //over round 15 in intervals of 10 { foreach (var e in ObjectPool.instance.GetPooledEnemies()) { foreach (var ee in e) { ee.GetComponent <Enemy>().currentMoneyValue /= 2.0f; } } } if (!GameMode.survival) { SpawnWave(); } else { //StartCoroutine(SurvivalWaves()); print("TODO: survival"); } }