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); } }
public void StopFollowingTarget(IntractableO Target) { agent.stoppingDistance = 0f; agent.updateRotation = true; target = null; }
public void FollowTarget(IntractableO newTarget) { agent.stoppingDistance = newTarget.radius * 0.8f; agent.updateRotation = false; target = newTarget.interactionTransform; }