I’m currently trying to figure out how I can manage asset dependencies for asset bundles in Unity 5. The “PushAssetDependencies” and “PopAssetDependencies” methods are deprecated now but I couldn’t find a replacement for them. The documentation (http://docs.unity3d.com/Manual/managingassetdependencies.html) also just tells about the old way of doing it. Does anyone know how asset asset dependencies work in Unity 5?
The way it works now is that you specify the bundle for each asset. Assume Object A and Object B are each assigned their own bundle, and that Object A depends on Object B. When building bundles, each will be in their own bundle (B will not be in A’s bundle). Now suppose at runtime you want to load Object A. You use the manifest Unity generates to determine that Object B is a dependency of Object A. You load both Object A’s bundle and Object B’s bundle. Then you tell Unity to load Object A out of its bundle, and Unity will figure out that it needs Object B as well, and will load it from Object B’s bundle and hook up the references between the two.
I hope that makes sense. I would suggest this thread for more info on the new system:
And also the demo project from that thread:
http://files.unity3d.com/vincent/assetbundle-demo/users_assetbundle-demo.zip
@Anozireth thank you very much for pointing me into the right direction. Automatic dependencies rock
I guess Unity should update the documentation then :).