private void Aim() { if (CurrentTarget == null) { State = LookState.AquiringTarget; return; } transform.rotation = TargetingUtilities.SmoothRotation(CurrentTarget.position, transform, rotateSpeed, error); }
//private void AquireTarget() { // alltargets = TargetingUtilities.FindAllTargets(transform.position, detectionRadius, targetLayer); // CurrentTarget = TargetingUtilities.FindNearestTarget(transform.position, alltargets); // if (CurrentTarget != null) // State = LookState.Aiming; //} protected virtual void Aim() { AquireTarget(); if (targetPos != Vector2.zero) { transform.rotation = TargetingUtilities.SmoothRotation(targetPos, transform, rotateSpeed, error); } }
public void TargetDelay() { transform.rotation = TargetingUtilities.SmoothRotation(randomDirection, transform, rotateSpeed, error); }