コード例 #1
0
 protected override void OnMouseDown(UnityEngine.UIElements.MouseDownEvent e)
 {
     if (m_Active)
     {
         e.StopImmediatePropagation();
         return;
     }
     if (CanStartManipulation(e))
     {
         m_Active = true;
         target.CaptureMouse();
         m_ClickOrigin = GetImageCoord(Image, e.localMousePosition);
         Vector2Int[] coords = GetTargetCoords(m_ClickOrigin);
         uPixel.DrawBuffer(coords);
     }
     e.StopPropagation();
 }
コード例 #2
0
        protected void OnMouseDown(MouseDownEvent e)
        {
            if (m_Active)
            {
                e.StopImmediatePropagation();
                return;
            }

            if (CanStartManipulation(e))
            {
                m_Start = e.localMousePosition;

                m_Active = true;
                target.CaptureMouse();
                e.StopPropagation();
            }
        }