Пример #1
0
 void SpawnEnemy(Enemy enemy)
 {
     enemy.enemyId          = ++enemyId;
     enemy.currentHealth    = enemy.GetMaxHealth();
     enemy.EnemyDelegate   += OnEnemyGotDamage;
     enemies[enemy.enemyId] = enemy;
     OnEnemySpawned?.Invoke(enemy);
 }
Пример #2
0
 public void GetDamage(int damage)
 {
     currentHealth -= damage;
     EnemyDelegate?.Invoke(this);
 }
 public void OnReachedDest()
 {
     m_enemyDelegate?.Invoke();
 }
Пример #4
0
 void Update()
 {
     FieldOfView();
     UpdateEnemy?.Invoke();
 }
Пример #5
0
 private void OnDisable()
 {
     m_enemyDelegate?.Invoke(gameObject);
 }
 void OnDestroy()
 {
     enemyDelegate?.Invoke(gameObject);
 }