Esempio n. 1
0
 public void TakeDamage(int damageTaken)
 {
     _enemyHealth -= damageTaken;
     _enemyAnimation.EnemyHit();
     if (_enemyHealth <= 0)
     {
         Kill();
     }
 }
Esempio n. 2
0
    private void OnTriggerEnter(Collider other)
    {
        Debug.Log("Collided with: " + other.name);

        if (other.tag == "GuardKnight")
        {
            if (_enemy != null)
            {
                _enemyAnim.EnemyHit();
                _enemy.EnemyLifeDown();
            }
        }
    }