Skip to content

Document AssetBundle dependency references#91

Merged
SkowronskiAndrew merged 2 commits into
Unity-Technologies:mainfrom
Abhinav-0311:docs-assetbundle-dependencies
Jul 13, 2026
Merged

Document AssetBundle dependency references#91
SkowronskiAndrew merged 2 commits into
Unity-Technologies:mainfrom
Abhinav-0311:docs-assetbundle-dependencies

Conversation

@Abhinav-0311

Copy link
Copy Markdown
Contributor

Summary

  • add a section explaining how AssetBundle dependencies differ from object-level PPtr references
  • describe how m_FileID, m_PathID, archives, SerializedFiles, refs, and preload dependencies relate in UnityDataTool output
  • extend the analyze representation summary with archive, serialized_file, and refs context

Fixes #50.

Testing

  • Not run: documentation-only change.
  • git diff --check

@SkowronskiAndrew SkowronskiAndrew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. m_Dependencies is 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 the AssetBundleManifest (for BuildPipeline.BuildAssetBundles) or the Addressables catalog — not m_Dependencies.

  2. What m_Dependencies contains differs by build path: BuildPipeline.BuildAssetBundles stores AssetBundle names, but the Scriptable Build Pipeline / Addressables stores the internal SerializedFile names (the lowercased CAB-<hash> names), not .bundle filenames. So "records bundle-level dependencies by name" is only literally true for the legacy path.

  3. A PPtr never contains a dependency bundle's filename — not "not usually." The external-reference entry names the target SerializedFile by its internal archive:/CAB-<hash>/... path.

Happy to help reword; suggestions inline.

Comment thread Documentation/assetbundle-format.md Outdated
Comment thread Documentation/assetbundle-format.md Outdated
Comment thread Documentation/assetbundle-format.md Outdated

@SkowronskiAndrew SkowronskiAndrew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SkowronskiAndrew SkowronskiAndrew merged commit 9d40bb0 into Unity-Technologies:main Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more information about AssetBundle formats to Documentation/unity-content-format.md

2 participants