I've been banging my head against a wall this past while over how I might create menu's and menu components in unity from text file. I would normally just build my own extended panel/label classes etc in c# and then use the properties loaded from file on instances of those extended classes. I have a properties loader but I cant seem to get my head around making a gui class that's dynamic from reading unitys documentation. Has anybody ever tried this?
Here's an example of a menu definition file.
<GUI_Menu: mainMenu >
<Atributes>
<> Type : Menu
<> Position_X : 0
<> Position_Y : 0
<> Height : Vanilla_Property_Screen_Height
<> Width : Vanilla_Property_Screen_Width
</Atributes>
<GUI_Panel: menu >
<GUI_Button: play >
<Atributes>
<> Position_X : 50
<> Position_Y : 50
<> Type : Button
<> Height : 50
<> Width : 100
<Description>
<> Key : desc_Play
<> Description_Address : Main\\Text\\Menu\\desc_Menu.xml
</Description>
</Atributes>
//button action/button data/description
</GUI_Button>
<GUI_Button: options >
//button action/button data/description
</GUI_Button>
<GUI_Button: mods >
//button action/button data/description
</GUI_Button>
<GUI_Button: texturePacks >
//button action/button data/description
</GUI_Button>
</GUI_Panel>
</GUI_Menu>
<GUI_Menu: play >
<GUI_Panel: load-New >
<GUI_Button: loadSave >
//button action/button data/description
</GUI_Button>
<GUI_Button: newGame >
//button action/button data/description
</GUI_Button>
<GUI_Button: multiplayer >
//button action/button data/description
</GUI_Button>
<GUI_Button: voxelEditor >
//button action/button data/description
</GUI_Button>
</GUI_Panel>
</GUI_Menu>
EDIT: Note that it is important that the menus are loaded from a definition file that is easy to read and write by a human being as custom menu's and GUI's/components will be supported through modding.