public override void Attack(GameObject target)
    {
        currentTarget = target;
        if (!target)
        {
            return;
        }

        if (TargetIsInRange())
        {
            targetDamagable = currentTarget.GetComponent <HealthBehaviour>();
            InCombat        = true;
            MakeAttack();
        }

        else
        {
            _encounteredTarget = false;
            _movement.Chase(target);
        }
    }
Exemple #2
0
 public override void Attack(GameObject guard)
 {
     currentTarget = guard;
     movement.Chase(guard);
     targetDamagable = currentTarget.GetComponent <HealthBehaviour>();
 }