示例#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();
 }
 private void OnDisable()
 {
     m_enemyDelegate?.Invoke(gameObject);
 }
 void OnDestroy()
 {
     enemyDelegate?.Invoke(gameObject);
 }