ClickEvent
This event is sent when the left mouse button is clicked.
Read time 3 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: PointerEventBase<ClickEvent>
- Implements: IDisposable, IPointerEvent
public sealed class ClickEvent : PointerEventBase<ClickEvent>, IDisposable, IPointerEvent
Remarks
A click consists of a mouse down event followed by a mouse up event on the same VisualElement. The mouse might move between the two events but the move is ignored as long as the mouse down and mouse up events occur on the same VisualElement.
A ClickEvent uses the default pointer event propagation path: it trickles down, bubbles up and can be cancelled. Disabled elements won't receive this event by default.
See PointerEventBase<T> to see how ClickEvent relates to other pointer events.
Constructors
Constructor | Description |
|---|---|
| ClickEvent() | Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances. |
Methods
Method | Description |
|---|---|
| Init | Resets the event members to their initial values. |