Clickable
Manipulator that tracks pointer events on an element and callbacks when the elements is clicked.
Read time 2 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: PointerManipulator
- Implements: IManipulator
public class Clickable : PointerManipulator, IManipulator
Remarks
See _clicked for more information on what it means for an element to be clicked in the context of this manipulator.
Constructors
Constructor | Description |
|---|---|
| Clickable(System.Action) | Constructor. |
| Clickable(System.Action,System.Int64,System.Int64) | Constructor. |
| Clickable(System.Action{UnityEngine.UIElements.EventBase}) | Constructor. |
Properties
Property | Description |
|---|---|
| active | This property tracks the activation of the manipulator. Set it to true when the manipulator is activated. |
| lastMousePosition | Specifies the mouse position saved during the last mouse event on the target Element. |
Methods
Method | Description |
|---|---|
| Invoke | Invokes a click action. |
| OnPointerDown | This method is called when a PointerDownEvent is sent to the target element. |
| OnPointerMove | This method is called when a PointerMoveEvent is sent to the target element. |
| OnPointerUp | This method is called when a PointerUpEvent is sent to the target element. |
| ProcessCancelEvent | This method processes the up cancel sent to the target Element. |
| ProcessDownEvent | This method processes the down event sent to the target Element. |
| ProcessMoveEvent | This method processes the move event sent to the target Element. |
| ProcessUpEvent | This method processes the up event sent to the target Element. |
| RegisterCallbacksOnTarget | Called to register mouse event callbacks on the target element. |
| UnregisterCallbacksFromTarget | Called to unregister event callbacks from the target element. |
Events
Member | Description |
|---|---|
| clicked | Callback triggered when the target element is clicked. |
| clickedWithEventInfo | Callback triggered when the target element is clicked, including event data. |