Beispiel #1
0
 private void Update()
 {
     if (hp.IsDead())
     {
         return;
     }
     if (interactWithCombat())
     {
         return;
     }
     if (interactWithMovement())
     {
         return;
     }
 }
Beispiel #2
0
        public bool CanAttack(GameObject combatTarget)
        {
            if (combatTarget == null)
            {
                return(false);
            }
            health targetTest = combatTarget.GetComponent <health>();

            if (combatTarget.GetComponent <health>().IsDead())
            {
            }


            return(targetTest != null && !targetTest.IsDead());
        }
Beispiel #3
0
        public void Update()
        {
            if (hp.IsDead())
            {
                return;
            }

            if (inRangeOfPlayer() && figter.CanAttack(player))
            {
                timeSinceLastSawPlayer = 0;
                AtackBehevior();
            }
            else if (timeSinceLastSawPlayer < susTime)
            {
                SusBehaviour();
            }
            else
            {
                PatrolBehaviour();
            }
            UpdateTimers();
        }
Beispiel #4
0
 public void Update()
 {
     timeSinceLastAttk += Time.deltaTime;
     //bool isInRange = GetIsInRange();
     if (target == null)
     {
         return;
     }
     if (target.IsDead())
     {
         return;
     }
     if (!GetIsInRange())
     {
         GetComponent <mover>().moveTo(target.transform.position);
     }
     else
     {
         GetComponent <mover>().Cancel();
         AttackBehaviour();
     }
 }
Beispiel #5
0
 void Update()
 {
     navMeshAgent.enabled = !hp.IsDead();
     UpdateAnimator();
 }