Exemplo n.º 1
0
 private IEnumerator SpawnAsteroids()
 {
     while (true)
     {
         if (_asteroidManager.NumberOfSmallAsteroids < CurrentDifficulty.MinimumSmallAsteroids)
         {
             _asteroidManager.SpawnSmallAsteroids(1);
         }
         else if (_asteroidManager.NumberOfMediumAsteroids < CurrentDifficulty.MinimumMediumAsteroids)
         {
             _asteroidManager.SpawnMediumAsteroids(1);
         }
         else if (_asteroidManager.NumberOfBigAsteroids < CurrentDifficulty.MinimumBigAsteroids)
         {
             _asteroidManager.SpawnBigAsteroids(1);
         }
         yield return(new WaitForSeconds(CurrentDifficulty.TimeBetweenSpawns));
     }
 }