Document AssetBundle dependency references#91
Conversation
SkowronskiAndrew
left a comment
There was a problem hiding this comment.
Thanks for writing this up — the PPtr / external-reference explanation is the right idea and a genuinely useful thing to document. I checked the new dependency section against the Unity runtime and build source, and there are a few accuracy issues around m_Dependencies and how loading actually works. Details inline. The short version:
-
m_Dependenciesis not an auto-loading mechanism, and it does not tell Unity "which bundles must be loaded." At runtime it is only used to locate preload objects among bundles the app has already loaded; a dependency that isn't loaded is silently skipped. The "which bundles to load" authority is theAssetBundleManifest(forBuildPipeline.BuildAssetBundles) or the Addressables catalog — notm_Dependencies. -
What
m_Dependenciescontains differs by build path:BuildPipeline.BuildAssetBundlesstores AssetBundle names, but the Scriptable Build Pipeline / Addressables stores the internal SerializedFile names (the lowercasedCAB-<hash>names), not.bundlefilenames. So "records bundle-level dependencies by name" is only literally true for the legacy path. -
A
PPtrnever contains a dependency bundle's filename — not "not usually." The external-reference entry names the target SerializedFile by its internalarchive:/CAB-<hash>/...path.
Happy to help reword; suggestions inline.
SkowronskiAndrew
left a comment
There was a problem hiding this comment.
Thanks @Abhinav-0311 for your submission, and the follow up.
That helps get some pretty relevant information into the UnityDataTool docs, I learned stuff also in doing some fact checking.
I may do a bit of a follow up to try to show some actual example diagrams or snippets, but this PR is accurate and I will merge it in, thanks.
Summary
Fixes #50.
Testing