// создание больших астероидов в старте игры и при начале нового этапа ( все астероиди уничтожены ) void CreateLevel() { asteroidsQuantity = startAsteroidsQuantity + (stage * stageGrowth); for (int i = 0; i < asteroidsQuantity; i++) { asteroidSpawner.Spawn(startSize, Vector2.zero); } }
void Explode() { Destroy(gameObject); if (isServer && !small) { spawner.Spawn(); spawner.Spawn(smallAsteroid, transform); spawner.Spawn(smallAsteroid, transform); } }
private IEnumerator CoLevelUp() { _asteroidDestroyed = 0; _asteroidSpawned = initialAsteroidCount + _level; yield return(new WaitForSeconds(2f)); spawner.Spawn(_level, _asteroidSpawned); _level++; }
private IEnumerator Go() { Time.timeScale = 0f; var countdown = 3; for (int i = countdown; i > 0; i--) { statusText.text = i.ToString(); yield return(new WaitForSecondsRealtime(1f)); } statusText.enabled = false; Time.timeScale = 1f; var score = FindObjectOfType <Score>(); StartCoroutine(asteroidSpawner.Spawn()); var ship = FindObjectOfType <Ship>(); int enemySpawnCount = 5; int wave = 1; while (ship != null) { yield return(new WaitForSeconds(3f)); if ((wave % 2) == 0) { asteroidSpawner.spawnCount++; enemySpawnCount++; } asteroidSpawner.spawnDelay -= 0.02f; asteroidSpawner.maxSpeed += 3; yield return(StartCoroutine(enemySpawner.SpawnColumn(enemySpawnCount))); if ((wave % 4) == 0) { enemySpawner.SpawnStation(); } wave++; score.IncrementWave(); } }
public static void NextLevel() { level++; UpdateLevelText(); AsteroidSpawner.Spawn(level); }