Пример #1
0
 private void Aim()
 {
     if (CurrentTarget == null)
     {
         State = LookState.AquiringTarget;
         return;
     }
     transform.rotation = TargetingUtilities.SmoothRotation(CurrentTarget.position, transform, rotateSpeed, error);
 }
Пример #2
0
    //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);
        }
    }
Пример #3
0
 public void TargetDelay()
 {
     transform.rotation = TargetingUtilities.SmoothRotation(randomDirection, transform, rotateSpeed, error);
 }