Quantcast
Channel: Questions in topic: "prefab connection"
Viewing all articles
Browse latest Browse all 103

Suggestions for Prefabs which refer to other Prefabs

$
0
0
I understand that Unity3D does not support nested prefabs. While it confuses me as to why such support would not inherently be supported, I am willing to let that go and instead focus on how to achieve a similar result. Basically what I want to do is have a Prefab A asset which has children instances of other Prefab B assets and when you drag out a Prefab A into your scene it would have all the child instances match the latest version of Prefab B. When Prefab B is updated, it would automatically update all the Prefab B children within Prefab A. I understand that the moment you create a prefab of Prefab A all of its children are now just included as part of Prefab A and lose their link to Prefab B. But what I am looking for are suggestions on where there may be a clever way to work around this. I don't really need the Prefab B instances to exist at all as part of the Prefab A. I just need Prefab A to hold references to them. But in order to work with Prefab A they DO need to exist while editing the scene with Prefab A in it. One thought would be to have some way to manage the limetime of the instances of Prefab B such that they only exist while in the editor editing the scene. But when you save the scene, or save the Prefab A, the instances of Prefab B are dropped with only the references to the Prefab B asset maintained. I guess what I am looking for is advice from those that may have a longer history of experience with this engine to suggest the best way to handle accomplishing that. I know that during OnBeforeSerialize() and OnAfterDeserialize() utilizing Unity API calls is a no no so I am wondering if such an approach is possible.

Viewing all articles
Browse latest Browse all 103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>