I’ve been thinking of a way to have nested prefabs in Unity and I came up with an idea a couple days ago that could work.
The idea is having a script that has a reference to the prefab and then having the options to save and load the prefab with a custom editor and an option to update all the nested prefabs in the scene. It’s a manual system but it works.
To use it you have to add a CPrefab script to your GameObject, there you’ll have a button “Create prefab”, when you click it, it will create a prefab of that GameObject in Assets/Prefabs (you can move it afterwards) but it won’t be linked to it, it will be referenced in Source.
After you create the prefab, the menu will change, you will have the option to **Save **which will update the prefab, **Load **which will update the GameObject and **Update all prefabs **which will load all CPrefabs in the scene, when you use this tool, the parent prefabs are applied so they don’t lose the connection, the same option is under RhoTools/Update all nested prefabs.
The load tool copies the prefab on the same location as the game object and erases the original game object, so use it with caution. In the future I’d like to make it work like an actual prefab and only change what hasn’t been modified.
If you want to use this, you can download it as a unityPackage or a zip file here.
I just created it so I haven’t tested it enough, so I’m open to bug reports and suggestions.
Custom Package is an editor extension which allows you to manage easily many custom configuration of different packages for further export, Asset Store submission, capitalization, etc…
You can easily:
– Add/Remove assets via checkbox in a userfriendly treeview
– Drag&Drop assets, with or without dependencies in the treeview
– Load/Save/Delete assets configurations
– Merge assets configurations…