public void Awake()
    {
        OnEntityRespawn.AddListener(SetSpawn);

        for (int i = 0; i < spawnAreas.Length; i++)
        {
            spawnAreas[i].isOccupied = false;
        }
    }
Example #2
0
 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);
 }
Example #3
0
 public void AddSpawnEvent(UnityAction listener)
 {
     spawnEvent.AddListener(listener);
 }