void FixedUpdate() { if ((Vector2)transform.position == (Vector2)destination.transform.position) { navAgent.LookAtTarget(destination.right); aiBehavior.ChangeState(aiState); } }
void FixedUpdate() { if ((target == null) && (targets.Count > 0)) { target = GetTopTarget(); if ((target != null) && (navAgent != null)) { navAgent.LookAtTarget(target.transform); } } if (target == null) { if (targetState == false) { targetState = true; } else { aiBehavior.ChangeState(aiState); } } }