protected void OnPointerDown(PointerDownEvent evt)
        {
            if (!CanStartManipulation(evt))
            {
                return;
            }

            if (IsNotMouseEvent(evt))
            {
                ProcessDownEvent(evt, evt.localPosition, evt.pointerId);
                evt.PreventDefault();
            }
            else
            {
                evt.StopImmediatePropagation();
            }
        }
Exemple #2
0
 private void UpdateValueOnPointerDown(PointerDownEvent evt)
 {
     if (CanStartDrag(evt.button, evt.localPosition))
     {
         // We want to allow dragging when using a mouse in any context and when in an Editor context with any pointer type.
         if (evt.pointerType == PointerType.mouse)
         {
             m_DragElement.CaptureMouse();
             ProcessDownEvent(evt);
         }
         else if (m_DragElement.panel.contextType == ContextType.Editor)
         {
             evt.PreventDefault();
             m_DragElement.CapturePointer(evt.pointerId);
             ProcessDownEvent(evt);
         }
     }
 }
        protected void OnPointerDown(PointerDownEvent evt)
        {
            bool flag = !base.CanStartManipulation(evt);

            if (!flag)
            {
                bool flag2 = evt.pointerId != PointerId.mousePointerId;
                if (flag2)
                {
                    this.ProcessDownEvent(evt, evt.localPosition, evt.pointerId);
                    evt.PreventDefault();
                }
                else
                {
                    evt.StopImmediatePropagation();
                }
            }
        }