private void Update() { if (hp.IsDead()) { return; } if (interactWithCombat()) { return; } if (interactWithMovement()) { return; } }
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()); }
public void Update() { if (hp.IsDead()) { return; } if (inRangeOfPlayer() && figter.CanAttack(player)) { timeSinceLastSawPlayer = 0; AtackBehevior(); } else if (timeSinceLastSawPlayer < susTime) { SusBehaviour(); } else { PatrolBehaviour(); } UpdateTimers(); }
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(); } }
void Update() { navMeshAgent.enabled = !hp.IsDead(); UpdateAnimator(); }