Example #1
0
    void Awake()
    {
        enemySpawner = GetComponent <EnemySpawner>();
        // player= FindObjectOfType<Player>();

        enemySpawnedEvent = new EnemySpawnedEvent();
        areaLoadedEvent   = new AreaLoadedEvent();
    }
Example #2
0
 private void OnSpawnedEvent(EnemySpawnedEvent spawnedEvent)
 {
     if (spawnedEvent.EnemyType == EnemyType.BossAlien)
     {
         bossWasSpawned = true;
         bossCleared    = false;
     }
 }
Example #3
0
 private void OnEnemySpawned(EnemySpawnedEvent spawnedEvent)
 {
     if (enemyTypeBehaviour.ContainsKey(spawnedEvent.EnemyType) == false)
     {
         enemyTypeBehaviour.Add(spawnedEvent.EnemyType, new List <AI_Behaviour>());
     }
     enemyTypeBehaviour[spawnedEvent.EnemyType].Add(spawnedEvent.AI_Behaviour);
     enemies.Add(spawnedEvent.AI_Behaviour);
 }
 // public methods
 // create event to publish that enemy spawned
 public void PublishOnEnemySpawnedEvent()
 {
     //
     EnemySpawnedEvent?.Invoke();
 }
Example #5
0
 public void PublishEnemySpawnedEvent()
 {
     EnemySpawnedEvent?.Invoke();
 }
Example #6
0
        // == Private Messages ==


        // == Event Methods ==
        protected void PublishEnemySpawnedEvent()
        {
            EnemySpawnedEvent?.Invoke(); // Publishing the event
        }
Example #7
0
 public void Awake()
 {
     bossSpawnedEvent = new EnemySpawnedEvent();
 }
Example #8
0
 //public methods
 public void PublishEnemySpawnedEvent()
 {
     //if event is not null, someone is listening, so tell them
     EnemySpawnedEvent?.Invoke();
 }
Example #9
0
 private void OnEnemySpawned(EnemySpawnedEvent obj)
 {
     enemies.Add(obj.enemy);
 }
Example #10
0
 void sc_OnEnemySpawn(object sender, EnemySpawnedEvent e)
 {
     RemainingEntities.Add(e.Entity);
 }
Example #11
0
 private void PublishOnEnemySpawnedEvent()
 {
     // Signal that an Enemy has spawned
     EnemySpawnedEvent?.Invoke();
 }
 private void HandleEnemySpawnedEvent(EnemySpawnedEvent spawnedEv)
 {
     livingEnemies++;
 }