- Home /
Linking prefabs
Okay, I have some serious analysis paralysis when it comes to linking prefabs.
Here's a simple example straight from my code:
I have a Buildable, which houses a couple of things: some Playmaker FSMs but also a BuildableObject.cs script, which has a field:
public GameObject BuildablePrefab;
This is used to instantiate another Prefab when a new Buildable object is created - this prefab simply stores the model for the buildable object (a primitive Cube for example). So far so good, everything works.
Now I made a Buildable prefab and then a specialized version of that prefab (with the BuildablePrefab already linked in). This works, of course, but I thought that updating the original Prefab (Buildable) will update all specialized prefabs (BuildableCube, etc.) with the changes made. It doesn't.
Specializing instances from the inspector won't work because the objects are created during gameplay.
Any ideas how to approach this? The only solution that comes to my mind is to initialize all specialized fields in the code but this will get clunky real fast when more things that just a prefab appear.