IEnumerator SpawnWaves() { yield return(new WaitForSeconds(1.0f)); infoText.UpdateText("Defend yourself!\nHold for automatic fire!\nDouble tap to fire railgun!"); infoText.FadeIn(); yield return(new WaitForSeconds(3.0f)); infoText.FadeOut(); yield return(new WaitForSeconds(3.0f)); while (gameOver == false) { yield return(StartCoroutine(Intermission())); enemies = (5 + 5 * wave) * (int)Mathf.Pow(1.1f, wave); ReduceEnemies(0); yield return(StartCoroutine(WaveTop(enemyHover, enemies, 1.0f * Mathf.Pow(0.9f, wave)))); while (intermission == false && gameOver == false) { yield return(new WaitForSeconds(0.1f)); } } }
IEnumerator Intermission() { wave++; infoText.UpdateText("Wave " + wave); infoText.FadeIn(); enemyCounterText.FadeOut(); if (wave != 1) { ammoText.FadeOut(); } yield return(new WaitForSeconds(ammoText.fadeSpeed)); if (wave != 1) { PlayerController.current.increaseAmmo(2 + wave); PlayerController.current.increaseHealth(1); } yield return(new WaitForSeconds(intermissionTime - ammoText.fadeSpeed)); intermission = false; infoText.FadeOut(); UpdateAmmoText(); }