public static bool OnMouseButton(Base hoveredControl, int x, int y, bool down) { if (!down) { m_LastPressedControl = null; // Not carrying anything, allow normal actions if (CurrentPackage == null) return false; // We were carrying something, drop it. OnDrop(x, y); return true; } if (hoveredControl == null) return false; if (!hoveredControl.DragAndDrop_Draggable()) return false; // Store the last clicked on control. Don't do anything yet, // we'll check it in OnMouseMoved, and if it moves further than // x pixels with the mouse down, we'll start to drag. m_LastPressedPos = new Point(x, y); m_LastPressedControl = hoveredControl; return false; }