private void SpawnWave() { remainingEnemySpawnAmount = 5 + 3 * waveNumber; state = State.SpawningWave; waveNumber++; OnWaveNumberChanged?.Invoke(this, EventArgs.Empty); }
private void SpawnWave() { _enemiesToSpawn = startingWaveSize + _waveNumber * waveMultiplier; _enemySpawnTimer = timeToSpawnEnemy; _state = State.SpawningWave; _waveNumber++; OnWaveNumberChanged?.Invoke(this, EventArgs.Empty); }
private void SpawnWave() { m_remainingEnemySpawnAmount = m_fixedEnemySpawnAmount + m_scaledEnemySpawnCount * m_waveNumber; m_state = State.SpawningWave; m_waveNumber++; OnWaveNumberChanged?.Invoke(this, EventArgs.Empty); }
private void SpawnWave() { _timeToSpawnNextWave -= Time.deltaTime; if (_timeToSpawnNextWave < 0f) { _enemiesToSpawnCount = 3 + 2 * _waveNumber; _state = State.SpawningWave; _waveNumber++; OnWaveNumberChanged?.Invoke(this, EventArgs.Empty); } }
private IEnumerator SpawnWave() { // Endgame check if (waveNumber <= 35) { currentSpawnRate = betweenSpawns; } else { currentSpawnRate = endgameBetweenSpawns; } // Stop Timer nextWaveSpawnTimer = int.MaxValue; // Spawer for (int i = 0; i < (baseWaveEnemies + waveIncreaser * waveNumber); i++) { randomPositionMultiplier.x = Random.Range(-spaceOffset, spaceOffset); randomPositionMultiplier.y = Random.Range(-spaceOffset, spaceOffset); Enemy.Create(nextAttackFrom + randomPositionMultiplier); yield return(new WaitForSeconds(currentSpawnRate)); } // Cleanup waveNumber++; OnWaveNumberChanged?.Invoke(this, System.EventArgs.Empty); nextAttackFrom = spawnPositions[UtilitiesClass .GetRandomArrayIndex(spawnPositions.Count)]; waveCircleTrans.position = nextAttackFrom; // New timer nextWaveSpawnTimer = Time.timeSinceLevelLoad + Mathf.Clamp(20 - Mathf.FloorToInt(waveNumber / 2), 5, 20); }