public override void OnBeginDrag(PointerEventData eventData) { if (onBeginDrag != null) { onBeginDrag.Invoke(gameObject, eventData.position); } }
public void OnLongPressBegin() { this.m_onPressEventTriggered = true; if (OnLongPress != null) { OnLongPress.Invoke(go, PointerEventData.position); } }
public override void OnDrag(PointerEventData eventData) { Vector2 position; Canvas canvas = FindObjectOfType <Canvas>(); RectTransform rect = canvas.GetComponent <RectTransform>(); if (RectTransformUtility.ScreenPointToLocalPointInRectangle(rect, eventData.position, canvas.worldCamera, out position)) { if (onDrag != null) { onDrag.Invoke(gameObject, position); } } }
private void OnDrag(Vector2 delta) { onDrag?.Invoke(gameObject, delta); }