Exemple #1
0
 private void Update()
 {
     if (hp.IsDead())
     {
         return;
     }
     if (interactWithCombat())
     {
         return;
     }
     if (interactWithMovement())
     {
         return;
     }
 }
Exemple #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());
        }
Exemple #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();
        }
Exemple #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();
     }
 }
Exemple #5
0
 void Update()
 {
     navMeshAgent.enabled = !hp.IsDead();
     UpdateAnimator();
 }