public void OnPointerDown(PointerEventData eventData) { timePressStarted = Time.time; longPressStartTime = Time.time; isPointerDown = true; longPressTriggered = false; onPointDown?.Invoke(eventData); }
public void OnPointerClick(PointerEventData eventData) { if (!longPressTriggered) { onClick?.Invoke(eventData); } // EventSystem.current.RaycastAll(new PointerEventData(EventSystem.current), ); // PointerEventData p = new PointerEventData(EventSystem.current); }
private void Update() { if (isPointerDown && !longPressTriggered) { if (Time.time - timePressStarted > durationThreshold) { longPressTriggered = true; onLongPress?.Invoke(null); } } if (isPointerDown) { if (Time.time - longPressStartTime > longPressInterval) { longPressStartTime = Time.time; onLongPressInterval?.Invoke(null); } } }
public void OnPointerUp(PointerEventData eventData) { isPointerDown = false; onPointUp?.Invoke(eventData); }
public void OnPointerEnter(PointerEventData eventData) { onPointerEnter?.Invoke(eventData); }
public void OnPointerExit(PointerEventData eventData) { onPointerExit?.Invoke(eventData); }
public void OnEndDrag(PointerEventData eventData) { onEndDrag?.Invoke(eventData); }
public void OnBeginDrag(PointerEventData eventData) { onBeginDrag?.Invoke(eventData); }
public void OnDrag(PointerEventData eventData) { Debug.Log("OnDrag:" + eventData.position.ToString()); onDrag?.Invoke(eventData); }
public void OnPointerUp(PointerEventData eventData) { onPressUp?.Invoke(eventData); }
public void OnPointerDown(PointerEventData eventData) { onPressDown?.Invoke(eventData); }