Skip to content

Panel position and docking issues when using DynamicPanels (Editor and Build inconsistency) #24

@seazennights

Description

@seazennights

When using DynamicPanels, I encountered inconsistent behavior between the Unity Editor and the built application.

In the Unity Editor, when opening a panel for testing, the panel cannot automatically moved to the center of the screen upon creation. However, within the Editor, I am still able to freely drag and reposition the panel afterward.

The issue appears in the built executable:

The panel cannot be dragged properly.
There is no visual placeholder or preview while dragging.
When attempting to move the panel (for example, dragging it from the bottom-left to the center), it snaps unexpectedly to the top-right corner after releasing the mouse.
It seems the panel can only snap between two positions (bottom-left and top-right).
When docking the panel, it immediately expands to full screen instead of docking to a specific region.

This behavior makes the panel system unusable in the build, even though it works relatively fine in the Unity Editor.

RectTransform panelRectTrans = uiContent.Transform as RectTransform;
            
Panel newPanel = PanelUtils.CreatePanelFor(panelRectTrans, m_mainPanelCanvas);
 newPanel[0].MinSize = new Vector2(500f, 500f);
 newPanel.MoveTo(Vector2.zero);
m_mainPanelCanvas.ForceRebuildLayoutImmediate();
Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions