void Awake() { enemySpawner = GetComponent <EnemySpawner>(); // player= FindObjectOfType<Player>(); enemySpawnedEvent = new EnemySpawnedEvent(); areaLoadedEvent = new AreaLoadedEvent(); }
private void OnSpawnedEvent(EnemySpawnedEvent spawnedEvent) { if (spawnedEvent.EnemyType == EnemyType.BossAlien) { bossWasSpawned = true; bossCleared = false; } }
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(); }
public void PublishEnemySpawnedEvent() { EnemySpawnedEvent?.Invoke(); }
// == Private Messages == // == Event Methods == protected void PublishEnemySpawnedEvent() { EnemySpawnedEvent?.Invoke(); // Publishing the event }
public void Awake() { bossSpawnedEvent = new EnemySpawnedEvent(); }
//public methods public void PublishEnemySpawnedEvent() { //if event is not null, someone is listening, so tell them EnemySpawnedEvent?.Invoke(); }
private void OnEnemySpawned(EnemySpawnedEvent obj) { enemies.Add(obj.enemy); }
void sc_OnEnemySpawn(object sender, EnemySpawnedEvent e) { RemainingEntities.Add(e.Entity); }
private void PublishOnEnemySpawnedEvent() { // Signal that an Enemy has spawned EnemySpawnedEvent?.Invoke(); }
private void HandleEnemySpawnedEvent(EnemySpawnedEvent spawnedEv) { livingEnemies++; }