You can make your building be able to make EVERY unit.
Then you make all units have a button position of (-1, -1) so they will not be shown.
Then you make abilities based of Charge Gold and Lumber and create all the tooltips and stuff for your units.
Then you add/remove those abilities from the structure.
Then comes the trigger part where you link your abilities to your unit types.
So when you start channeling one of those abilities, you then train the respective unit.
There are features like:
- Able to add/remove units from your available units.
- Make abilities multiple levels thus updating tooltips for stuff. (Per building individually.)
- Make units have a relative cost (also based on ability levels).
- Put unit creation chart inside a spellbook.
- And a few more I can't recall.
I thought about making a public resource that does this... however, I havent actually got to the point of making it
