public WaveTimeline GetWave(int index) { WaveTimeline timeline = WaveCollection.GetWave(index); if (!IsWaveKnown(index)) { OnNewWave?.Invoke(timeline); MarkWaveAsKnown(index, true); } return(timeline); }
private void NextWave() { // if (currentWaveNumber > 0) AudioManager.instance.PlaySound2D("Level Completed"); currentWaveNumber++; if (currentWaveNumber - 1 < waves.Length) { currentWave = waves[currentWaveNumber - 1]; enemiesRemainingToSpawn = currentWave.enemyCount; enemiesRemainingAlive = enemiesRemainingToSpawn; OnNewWave?.Invoke(currentWaveNumber); ResetPlayerPosition(); } }
void NextWave() { if (currentWaveNumber > 0) { AudioManager.instance.PlaySound2d("Level Complete"); } currentWaveNumber++; currentWave = waves[currentWaveNumber - 1]; enemiesRemaining = currentWave.enemyCount; enemiesRemainingAlive = enemiesRemaining; OnNewWave?.Invoke(currentWaveNumber); }
void NextWave() { if (waveIndex > 0) { AudioManager.instance.PlaySoundEffect2D("Level Complete"); } waveIndex++; if (waveIndex - 1 < waves.Length) { currentWave = waves[waveIndex - 1]; remainingEnemiesToSpawn = currentWave.enemyCount; remainingEnemiesAlive = remainingEnemiesToSpawn; OnNewWave?.Invoke(waveIndex); } nextCampingCheckTime = Time.time + allowedCampingTime; resetPlayerPosition(); }
private void NextWave() { if (_currentWaveNumber > 0) { AudioManager.instance.PlaySound("Level completed"); } _currentWaveNumber++; if (_currentWaveNumber - 1 < Waves.Length) { _currentWave = Waves[_currentWaveNumber - 1]; _enemiesRemainingToSpawn = _currentWave.EnemyCount; _enemiesRemainingAlive = _enemiesRemainingToSpawn; OnNewWave?.Invoke(_currentWaveNumber); ResetPlayerPosition(); } }
private void SpawnNextWave() { waveCounter++; //Debug.Log ("SpawnManager:NextWave: wave count: " + waveCounter); if (waveCounter - 1 < waves.Length) { currentWaveInfo = waves[waveCounter - 1]; remainingToSpawn = currentWaveInfo.spawnCount; remainingToAlive = remainingToSpawn; if (OnNewWave != null) { OnNewWave.Invoke(waveCounter); } } else { // End of waves } }
/// Starts a new wave, displaying a message, and calculating the time for each enemy to spawn public IEnumerator StartWave() { yield return(new WaitForSeconds(_waves[_levelToLoad.Value].waveStartDelay)); _currentWaveName = _waves[_levelToLoad.Value].waveMessage; OnNewWave?.Invoke(_currentWaveName); if (_waves[_levelToLoad.Value].spawnInSequence == true) { _waves[_levelToLoad.Value].spawnTimeTemp = 0; foreach (Spawn spawn in _waves[_levelToLoad.Value].spawns) { spawn.spawnDelay = _waves[_levelToLoad.Value].spawnTimeTemp; _waves[_levelToLoad.Value].spawnTimeTemp += spawn.spawnTime * spawn.count; spawn.enemiesRemainingToSpawn = spawn.count; } } else { _waves[_levelToLoad.Value].spawnTimeTemp = _waves[_levelToLoad.Value].spawnTime; foreach (Spawn spawn in _waves[_levelToLoad.Value].spawns) { spawn.spawnDelayTimer = spawn.spawnDelay; spawn.spawnTime = _waves[_levelToLoad.Value].spawnTime / spawn.count; spawn.enemiesRemainingToSpawn = spawn.count; } NextWave(); } _waveIsCleared = false; }