Created
October 14, 2021 01:40
-
-
Save curious-username/9a0c360c179955926a4cc29e05a5b259 to your computer and use it in GitHub Desktop.
updating the spawn manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerator SpawnPowerupRoutine() | |
{ | |
//every 3 - 7 seconds, spawn in a powerup | |
while (_stopSpawning == false) { | |
Vector3 spawn = new Vector3(Random.Range(-8f, 8f), 7, 0); | |
int randomPowerUp = Random.Range(0, 4); | |
Instantiate(_powerups[randomPowerUp], spawn, Quaternion.identity); | |
yield return new WaitForSeconds(Random.Range(3, 8)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment