Class Dragger
Manipulator that allows dragging from a container component.
Inherited Members
Namespace: Unity.AppUI.UI
Syntax
public class Dragger : PointerManipulator, IManipulator
Constructors
Dragger(Action<PointerMoveEvent>, Action<PointerMoveEvent>, Action<PointerUpEvent>, Action)
Creates a new Dragger instance.
Declaration
public Dragger(Action<PointerMoveEvent> dragStarted, Action<PointerMoveEvent> dragging, Action<PointerUpEvent> dragEnded, Action dragCanceled)
Parameters
Type | Name | Description |
---|---|---|
Action<PointerMoveEvent> | dragStarted | The event that will be fired when a drag starts. |
Action<PointerMoveEvent> | dragging | The event that will be fired when a drag is in progress. |
Action<PointerUpEvent> | dragEnded | The event that will be fired when a drag ends. |
Action | dragCanceled | The event that will be fired when a drag is cancelled. |
Properties
acceptDrag
Delegate that will be called when a drag should be accepted.
Declaration
public Func<bool> acceptDrag { get; set; }
Property Value
Type | Description |
---|---|
Func<Boolean> |
Remarks
If this delegate is not set, the drag will be accepted by default.
dragThreshold
The threshold in pixels after which a drag will start.
Declaration
public float dragThreshold { get; set; }
Property Value
Type | Description |
---|---|
Single |
isActive
Whether the drag is currently active.
Declaration
public bool isActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Cancel()
Cancels the drag.
Declaration
public void Cancel()
RegisterCallbacksOnTarget()
Declaration
protected override void RegisterCallbacksOnTarget()
Overrides
UnregisterCallbacksFromTarget()
Declaration
protected override void UnregisterCallbacksFromTarget()