public void saveWave(WaveDetails waveDetails, int waveNr) { string folderPath = Path.Combine(Application.persistentDataPath, waveFolderName); string dataPath = Path.Combine(folderPath, waveNr + fileExtension); BinaryFormatter binaryFormatter = new BinaryFormatter(); using (FileStream fileStream = File.Open(dataPath, FileMode.Create)) { binaryFormatter.Serialize(fileStream, waveDetails); } }
private IEnumerator SpawnWave() { WaveDetails wave = waves[waveNumber]; enemiesInGame = wave.count; for (int i = 0; i < wave.count; i++) { SpawnEnemy(wave.enemy); yield return(new WaitForSeconds(1f / wave.rate)); } waveNumber++; }
public void setUp(WaveDetails wave) { this.spawnDelay = wave.spawnDelay; }