Public Member Functions | |
void | OnPointerDown (PointerEventData pointerEventData) |
void | OnPointerUp (PointerEventData pointerEventData) |
void | OnBeginDrag (PointerEventData pointerEventData) |
void | OnDrag (PointerEventData pointerEventData) |
void | OnEndDrag (PointerEventData pointerEventData) |
void | OnPointerEnter (PointerEventData pointerEventData) |
void | OnPointerExit (PointerEventData pointerEventData) |
Properties | |
float | longPressTime [get] |
UnityEvent | shortClickEvent [get] |
UnityEvent | longPressEvent [get] |
UnityEvent | startDragEvent [get] |
UnityEvent | draggingEvent [get] |
UnityEvent | endDragEvent [get] |
UnityEvent | hoverEnterEvent [get] |
UnityEvent | hoverExitEvent [get] |
This button handler script is a simple button implementation for UGUI Images.
Images should have Raycast Target enabled.
The advantage of DSButtonHandler is more variety in the inputs.
This implementation uses Unity's EventSystems to give click, hover, and drag events.
|
inline |
Callback from IBeginDragHandler: Detect if a drag has started
|
inline |
Callback from IDragHandler: Detects if a drag has continued
|
inline |
Callback from IEndDragHandler: Detects if a drag has ended
|
inline |
Callback from IPointerDownHandler: Detect current clicks on the GameObject (the one with the script attached)
|
inline |
Callback from IPointerEnterHandler: Detects if a pointer has started hovering over this element
|
inline |
Callback from IPointerExitHandler: Detects if a pointer has exited hovering over this element
|
inline |
Callback from IPointerDownHandler, IPointerUpHandler: Detect if clicks are no longer registering
|
get |
Invoked by the OnDrag callback, when a pointer drag is ongoing.
|
get |
Invoked by the OnEndDrag callback, when a pointer drag has ended, this frame.
|
get |
Invoked by the OnPointerEnter callback, when a pointer has started overlapping this object, this frame.
|
get |
Invoked by the OnPointerExit callback, when a previously overlapping pointer is exiting that overlap.
|
get |
Pointer click events that exceed the longPressTime will invoke this UnityEvent.
\nInvoked in the Update() loop.
|
get |
The time between a pointer down event and pointer up event is measured. If the time is longer than this value, the pointer press is considered a "long press" instead of a "short click".
|
get |
Pointer click events that are not long enough to be a "long press" will invoke this UnityEvent.
\nInvoked by OnPointerUp.
|
get |
Invoked by the OnBeginDrag callback, when the beginning of a pointer drag has been detected.