The AssetBundle dependency in Unity 5 is a little deceptive (or buggy)?

Let’s say I got a prefab P, which uses a material M, which uses a texture T。I create a scene S, and put a P instance into it. Now I pack M and T into an AssetBundle (AB), P into a second one and S into a third one. Now if I try to see what’s in S AB, I will fail if I forget to load the M and T AB first. This makes sense, and the manifest file also says that the S AB depends on the P AB, whereas the P AB on the M&T AB.

However, if I don’t pack M and T, the P should know about M and T automatically. But in fact, if I delete the P AB in this case, I still can load S AB only and show the scene correctly. Is it by design? or is it a bug?

Thanks.

Hi,

When building a standalone player all prefabs instantiated in the scene is actually serialised as part of the scene and the prefab asset is no longer needed.

So S AB actually does contained all the information needed to recreate the prefab instance when loading the scene and that is why it works without the P AB, in fact the S AB should not actually depend on P AB it should only depend on M&T AB, so that sounds like a bug.

The only time you need P AB is if the prefabs are not part of the scene but you would still like to instantiate them during game play.