|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static bool isTouchEvent(PointerEventData eventData) { |
|
|
|
return !isMouseEvent(eventData); |
|
|
|
//pointerId >= 0 : touches
|
|
|
|
//ref: https://docs.unity3d.com/ScriptReference/EventSystems.PointerEventData-pointerId.html
|
|
|
|
return eventData.pointerId >= 0; |
|
|
|
return eventData.pointerId == -1; |
|
|
|
//pointerId = -1, -2, -3 : mouse buttons
|
|
|
|
//ref: https://docs.unity3d.com/ScriptReference/EventSystems.PointerEventData-pointerId.html
|
|
|
|
return eventData.pointerId < 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |