docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Dragger

    Manipulator that allows dragging from a container component.

    Inheritance
    object
    Manipulator
    MouseManipulator
    PointerManipulator
    Dragger
    Implements
    IManipulator
    Inherited Members
    PointerManipulator.CanStartManipulation(IPointerEvent)
    PointerManipulator.CanStopManipulation(IPointerEvent)
    MouseManipulator.CanStartManipulation(IMouseEvent)
    MouseManipulator.CanStopManipulation(IMouseEvent)
    MouseManipulator.activators
    Manipulator.target
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    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 when the dragger wants to become active during PointerMoveEvent.

    Declaration
    public Func<bool> acceptDrag { get; set; }
    Property Value
    Type Description
    Func<bool>
    Remarks

    If this delegate is not set (or set to null), the drag will be accepted by default.

    acceptStartDrag

    Delegate that will be called when a drag should be accepted during PointerDownEvent.

    Declaration
    public Func<Vector2, bool> acceptStartDrag { get; set; }
    Property Value
    Type Description
    Func<Vector2, bool>
    Remarks

    If this delegate is not set (or set to null), 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
    float

    isActive

    Whether the drag is currently active.

    Declaration
    public bool isActive { get; }
    Property Value
    Type Description
    bool

    Methods

    Cancel()

    Cancels the drag.

    Declaration
    public void Cancel()

    RegisterCallbacksOnTarget()

    Called to register event callbacks on the target element.

    Declaration
    protected override void RegisterCallbacksOnTarget()
    Overrides
    Manipulator.RegisterCallbacksOnTarget()

    UnregisterCallbacksFromTarget()

    Called to unregister event callbacks from the target element.

    Declaration
    protected override void UnregisterCallbacksFromTarget()
    Overrides
    Manipulator.UnregisterCallbacksFromTarget()

    Implements

    IManipulator
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)