Draggable
The Draggable component is used to change position, like dragging a window by header. It shouldn’t be confused with Drag and Drop.
Options
Interactable
boolAllow interaction.
Handle
GameObjectoptionalGameObject used to drag current GameObject.
Horizontal
boolAllow horizontal drag movement.
Vertical
boolAllow vertical drag movement.
Restriction
DraggableRestriction:None: no restriction.Strict: does not allow drag outside the parent.After Drag: does not allow drag outside the parent, applied after drag ended.
Curve
AnimationCurveAnimation curve used to animate applied After Drag restriction.
Unscaled Time
boolRun animation with unscaled time.
Snap Grids
List<SnapGridBase>Snap Distance
Vector2Maximum distance to lines where snapping is available.
Properties
Target
RectTransformTarget to drag; the self is by default.
Events
OnStartDrag
UnityEvent<Draggable>OnDrag
UnityEvent<Draggable>OnEndDrag
UnityEvent<Draggable>OnSnap =
UnityEvent<Draggable, SnapGridBase.Result>OnEndSnap =
UnityEvent<Draggable, SnapGridBase.Result>OnTargetChanged
UnityEvent<Draggable>