private void RemoveFocus()
 {
     if (focus != null)
     {
         focus.OnDeFocused();
     }
     focus = null;
     motor.StopFollowingTarget(focus);
 }
    private void SetFocus(IntractableO newFocus)
    {
        if (newFocus != focus && focus != null)
        {
            focus.OnDeFocused();
        }
        focus = newFocus;

        if (focus != null)
        {
            newFocus.OnFocused(transform);

            motor.FollowTarget(newFocus);
        }
    }
Exemple #3
0
 public void StopFollowingTarget(IntractableO Target)
 {
     agent.stoppingDistance = 0f;
     agent.updateRotation   = true;
     target = null;
 }
Exemple #4
0
 public void FollowTarget(IntractableO newTarget)
 {
     agent.stoppingDistance = newTarget.radius * 0.8f;
     agent.updateRotation   = false;
     target = newTarget.interactionTransform;
 }