// Infinite stream of new triple-shot power-ups IEnumerator SpawnTripleShotPowerUps() { while (!gameOver) { Instantiate(tripleShotPrefab, Powerup.InitialPos(), Quaternion.identity); yield return(new WaitForSeconds(WaitForRandom(tripleShotPowerupSeconds))); } }
// Infinite stream of new speed power-ups IEnumerator SpawnSpeedPowerUps() { while (!gameOver) { yield return(new WaitForSeconds(WaitForRandom(speedPowerupSeconds))); Instantiate(speedPrefab, Powerup.InitialPos(), Quaternion.identity); } }