This asset helps you create dynamic panels using Unity’s UI system. These panels can be dragged around, resized, docked to canvas edges or to one another and stacked next to each other as separate tabs.
Features
Supports all canvas modes (Screen Space and World Space)
Supports multiple canvases (panels can be moved between canvases by dragging)
Has an extensive Scripting API to create/manipulate panels by code
Each panel costs 3 additional batches (this number can increase with each tab using a custom icon)
Excellent asset, you should charge for it! I think I found a bug though. Open up the demo scene and try to drag a tab so it sits next to the blue tab. Not possible. Tried several Unity versions, happens both in editor and export. Curiously, your webgl demo does not suffer from this issue, maybe you made some updates since building that.
That’s because the canvas anchor zone obscures that panel’s tabs. You can e.g. decrease CanvasLeft’s “Canvas Anchor Zone Length” to 15 to eliminate this issue.
Veryyy wonderfull asset !
Just one question, is it possible to delete the default free space on Docked Panels ? I won’t have free space, only panel. I tried to set Minimum free space to 0 but it keep the free space.
Thanks for the great plugin and it’s a good fit into our game!
There’s 2 features we really want and see if you can implement them, please:
Add a default size setting for tab: the tab is first shown as the default size. (e.g. min width 300 and default width 600) (I looked into the code and it seems not as easy as it sounds)
Persistent - all positions and sizes of tabs and tab groups are saved and recovered after each game exit / scene swtich.
Hi! As you said, there is no default size per tab but it is possible to set the default size of a panel via its FloatingSize property. Tabs detached from that panel will inherit their FloatingSize values from that panel, as well. Currently, for a more complex control over the tabs’ sizes, you can register to the PanelNotificationCenter.OnPanelCreated event, check the content of the panel and then set the panel’s FloatingSize value accordingly.
To be able to serialize/deserialize the panels’ properties sounds like a useful idea. I’ll see what I can do.
Is there a way to customize the pane’s tab aspect? For example editing the color, the font etc.
To give you a real example, I have a round image in my panel and I’d like to keep the transparency so I can see the panel below.
Are you trying to make only one tab’s background transparent? If so, there is currently no way to do that. Otherwise, you can simply make changes to the prefab(s) located inside the Resources subdirectory.
When you say only one tab you mean a single tab in a group or a panel in general? Because probably I only need one of the panel to be transparent but I could live with all the others being the same.
Another question, is it possible to customize also the tab title bar (e.g changing the color, extending it to the whole panel width)?
I meant a single tab in a group. The problem with making only a single tab/panel transparent is that, when you detach all tabs from that panel, it will automatically get destroyed. So you should change the DynamicPanel prefab instead.
Tab title bar prefab is named DynamicPanelTab. You can adjust it as you wish to change the background color or the text color. To extend a tab to the whole panel width, you can enable the DynamicPanel prefab’s PanelHeader-Horizontal Layout Group-Child Force Expand Width property.
Thank you! One last thing, how do I deactivate a panel from the script API? I tried SetActivate but I get : DynamicPanels.Panel does not contain a definition for SetActive
@SweatyChair I’d like you to know that, despite my long inactivity, I didn’t forget about the persistency feature request and am working on a way to serialize the panels. I’ve made quite some progress already.
@SweatyChair I’ve attached an updated version of the plugin.
After importing the unitypackage to your project, you should add DynamicPanelsSerialization component to an object in your scene and populate its fields. You shouldn’t change the order of the panels in DynamicPanelsSerialization’s Panels variable because serialization system depends on this order; the same goes for the canvases, as well.
Now, you can call the Serialize/Deserialize functions of DynamicPanelsSerialization to save/load the panels via PlayerPrefs. Or, you can use SerializeToArray/DeserializeFromArray functions to save/load the serialized data via a custom medium.
PROTIP: Simply uncomment the DynamicPanelsSerialization.Update function to quickly test the system.