示例#1
0
        protected virtual void Update()
        {
            if (!StartingDrag)
            {
                return;
            }
            if (!Input.GetMouseButton(0))
            {
                StartingDrag = false;
                return;
            }

            var distance = Mathf.Abs(Input.mousePosition.x - ClickPosition);

            if (distance > DRAG_TOLERANCE)
            {
                StartingDrag = false;
                StartDragging?.Invoke();
            }
        }
示例#2
0
 public void OnPointerDown(PointerEventData eventData) => StartDragging?.Invoke();
示例#3
0
 public void OnPointerDown(PointerEventData eventData)
 {
     IsDragging    = true;
     StartPosition = CurrentPosition = eventData.position;
     StartDragging?.Invoke();
 }