public void Awake() { OnEntityRespawn.AddListener(SetSpawn); for (int i = 0; i < spawnAreas.Length; i++) { spawnAreas[i].isOccupied = false; } }
protected override void Awake() { base.Awake(); enemiesInArea = new List <Enemy>(EnemyDatabase.Instance.GetAvailableEnemiesForThisArea(id)); spawnables = new List <Spawnable>(EnemyDatabase.Instance.GetAvailableSpawnablesForThisArea(id)); delaySpawning = true; Invoke(nameof(StartSpawning), 2); spawnEvent.AddListener(this); }
public void AddSpawnEvent(UnityAction listener) { spawnEvent.AddListener(listener); }