+EA 23.76 Nightly - Plugin.UI
January 14, 2025
1 file modified.
Important Changes
None.
UIDragPanel
cs
public class UIDragPanel : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler, IDragHandler, IChangeResolution, IInitializePotentialDragHandler
{
public static bool dragging;
private Vector2 originalLocalPointerPosition;
private Vector3 originalPanelLocalPosition;
@@ -58,14 +60,19 @@ public void OnPointerDown(PointerEventData data)
cs
}
originalPanelLocalPosition = target.localPosition;
RectTransformUtility.ScreenPointToLocalPointInRectangle(container, data.position, data.pressEventCamera, out originalLocalPointerPosition);
dragging = true;
}
}
public void OnPointerUp(PointerEventData data)
{
if (enable && data.button == PointerEventData.InputButton.Left && axisY && axisX && autoAnchor)
if (enable && data.button == PointerEventData.InputButton.Left)
{
target.SetAnchor();
if (axisY && axisX && autoAnchor)
{
target.SetAnchor();
}
dragging = false;
}
}