public void Save(List <GameObject> enemies) { Level.Wave currentWave = _level.LevelConfig[WaveNumber]; currentWave.enemies.Clear(); for (int i = 0; i < enemies.Count; i++) { AddEnemy(enemies[i].GetComponent <EnemyData>()); } SaveLevel(); }
public void AddEnemy(EnemyData data) { Level.Wave currentWave = _level.LevelConfig[WaveNumber]; currentWave.enemies.Add(new Level.EnemyConfig { enemyType = data.enemyType, viewportPosition = Camera.main.WorldToViewportPoint(data.gameObject.transform.position), direction = data.gameObject.transform.up, delay = data.Delay, shouldMove = data.ShouldMove, speed = data.Speed }); }