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

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

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