Writing a custom LayoutGroup for the 4.6 UI.

I have implemented a system of Tabs with the 4.6 UI. The tab buttons themselves are working fine (they’re based on Toggles), they enable/disable their panel properly.

My problem is: all the panels are supposed to occupy the same area but the three default LayoutGroup (Vertical, Horizontal, Grid) are trying to put their children side by side. I want to create a LayoutGroup that

  1. make all its children overlap
  2. return the biggest MinSize or PreferredSize (for each direction )as its own Min/PreferredSize.

I have difficulties finding examples of custom LayoutGroup components. The documentation isn’t very helpful as it has barely been written yet: Unity - Scripting API: LayoutGroup .

Does anyone know where I can find this information?

I figured it out. I read the code of Unity’s GUI system, whose source is on BitBucket, and used it as a template for my own class.

I wrote a post about it on the forums: http://forum.unity3d.com/threads/i-wrote-an-overlaplayoutgroup-that-facilitates-creating-tab-pages.289884/

Code of my OverlapLayoutGroup: OverlapLayoutGroup - Pastebin.com (Kinda too big to fit in this post).