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(); } }
public void OnPointerDown(PointerEventData eventData) => StartDragging?.Invoke();
public void OnPointerDown(PointerEventData eventData) { IsDragging = true; StartPosition = CurrentPosition = eventData.position; StartDragging?.Invoke(); }