Version: 5.5
public static Vector3 Slider2D (int id, Vector3 handlePos, Vector3 offset, Vector3 handleDir, Vector3 slideDir1, Vector3 slideDir2, float handleSize, Handles.DrawCapFunction drawFunc, Vector2 snap, bool drawHelper= false);
public static Vector3 Slider2D (Vector3 handlePos, Vector3 handleDir, Vector3 slideDir1, Vector3 slideDir2, float handleSize, Handles.DrawCapFunction drawFunc, Vector2 snap, bool drawHelper= false);
public static Vector3 Slider2D (int id, Vector3 handlePos, Vector3 handleDir, Vector3 slideDir1, Vector3 slideDir2, float handleSize, Handles.DrawCapFunction drawFunc, Vector2 snap, bool drawHelper= false);
public static Vector3 Slider2D (Vector3 handlePos, Vector3 handleDir, Vector3 slideDir1, Vector3 slideDir2, float handleSize, Handles.DrawCapFunction drawFunc, float snap, bool drawHelper= false);

Parámetros

id (optional) override the default ControlID for this Slider2D instance.
handlePos The position of the current point.
offset (optional) renders the Slider2D at handlePos, but treats the Slider2D's origin as handlePos + offset. Useful for Slider2D instances that are placed/rendered relative to another object or handle.
handleDir The direction of the handle, only used for rendering of the handle.
slideDir1 The first direction of the sliding.
slideDir2 The second direction of the sliding.
handleSize The size of the handle.
drawFunc The function to call for doing the actual drawing - by default, it's Handles.ArrowCap, but any function that has the same signature can be used.
snap (float or Vector2) set the snap increment (Pass a Vector2 to use separate snap increments in each dimension).
drawHelper (default: false) render a rectangle around the handle when dragging.

Valor de retorno

Vector3 The new handle position.

Descripción

Slide a handle in a 2D plane.

This draws a draggable handle on the screen. The handle is constrained to sliding on a plane.

Note: Use HandleUtility.GetHandleSize if you want the handle to always remain the same size on the screen.