Class Dragger
Manipulator which monitors Press, Hold and Release events in order to drag visuals.
Inherited Members
Namespace: Unity.Muse.Common.Baryon.UI.Manipulators
Syntax
public class Dragger : Pressable
Constructors
Dragger(Action, Action<Dragger>, Action<Dragger>, Action<Dragger>)
Construct a Dragger manipulator.
Declaration
public Dragger(Action clickHandler, Action<Dragger> dragHandler, Action<Dragger> upHandler, Action<Dragger> downHandler = null)
Parameters
Type | Name | Description |
---|---|---|
Action | clickHandler | A callback invoked when a ClickEvent has been received. |
Action<Dragger> | dragHandler | A callback invoked during dragging state. |
Action<Dragger> | upHandler | A callback invoked when a PointerUpEvent has been received. |
Action<Dragger> | downHandler | A callback invoked when a PointerDownEvent has been received. |
Methods
Cancel()
Cancel the drag operation.
Declaration
public void Cancel()
ProcessDownEvent(EventBase, Vector2, Int32)
This method processes the down event sent to the target Element.
Declaration
protected override void ProcessDownEvent(EventBase evt, Vector2 localPosition, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt | The event to process. |
Vector2 | localPosition | The local position of the pointer. |
Int32 | pointerId | The pointer id of the pointer. |
ProcessMoveEvent(EventBase, Vector2)
This method processes the move event sent to the target Element.
Declaration
protected override void ProcessMoveEvent(EventBase evt, Vector2 localPosition)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt | The event to process. |
Vector2 | localPosition | The local position of the pointer. |
ProcessUpEvent(EventBase, Vector2, Int32)
This method processes the up event sent to the target Element.
Declaration
protected override void ProcessUpEvent(EventBase evt, Vector2 localPosition, int pointerId)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt | The event to process. |
Vector2 | localPosition | The local position of the pointer. |
Int32 | pointerId | The pointer id of the pointer. |