internal static Vector3 SideSlider(int id, Vector3 position, Vector3 sideVector, Vector3 direction, float size, Handles.DrawCapFunction drawFunc, float snap, float bias)
{
Event current = Event.current;
Vector3 normalized = Vector3.Cross(sideVector, direction).normalized;
Vector3 vector = Handles.Slider2D(id, position, normalized, direction, sideVector, 0f, drawFunc, Vector2.one * snap);
vector = position + Vector3.Project(vector - position, direction);
EventType type = current.type;
if (type != EventType.Repaint)
{
if (type != EventType.Layout)
{
if (type == EventType.MouseMove)
{
RectHandles.DetectCursorChange(id);
}
}
else
{
Vector3 normalized2 = sideVector.normalized;
HandleUtility.AddControl(id, HandleUtility.DistanceToLine(position + sideVector * 0.5f - normalized2 * size * 2f, position - sideVector * 0.5f + normalized2 * size * 2f) - bias);
}
}
else if ((HandleUtility.nearestControl == id && GUIUtility.hotControl == 0) || GUIUtility.hotControl == id)
{
RectHandles.HandleDirectionalCursor(position, normalized, direction);
}
return(vector);
}