void SpawnEnemy(Enemy enemy) { enemy.enemyId = ++enemyId; enemy.currentHealth = enemy.GetMaxHealth(); enemy.EnemyDelegate += OnEnemyGotDamage; enemies[enemy.enemyId] = enemy; OnEnemySpawned?.Invoke(enemy); }
public void GetDamage(int damage) { currentHealth -= damage; EnemyDelegate?.Invoke(this); }
public void OnReachedDest() { m_enemyDelegate?.Invoke(); }
void Update() { FieldOfView(); UpdateEnemy?.Invoke(); }
private void OnDisable() { m_enemyDelegate?.Invoke(gameObject); }
void OnDestroy() { enemyDelegate?.Invoke(gameObject); }