Esempio n. 1
0
    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);
        }
    }
Esempio n. 2
0
    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++;
    }
Esempio n. 3
0
 public void setUp(WaveDetails wave)
 {
     this.spawnDelay = wave.spawnDelay;
 }