示例#1
0
 public override void OnBeginDrag(PointerEventData eventData)
 {
     if (onBeginDrag != null)
     {
         onBeginDrag.Invoke(gameObject, eventData.position);
     }
 }
示例#2
0
 public void OnLongPressBegin()
 {
     this.m_onPressEventTriggered = true;
     if (OnLongPress != null)
     {
         OnLongPress.Invoke(go, PointerEventData.position);
     }
 }
示例#3
0
    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);
            }
        }
    }
示例#4
0
 private void OnDrag(Vector2 delta)
 {
     onDrag?.Invoke(gameObject, delta);
 }