analyze: support ContentLayout.json v4 (Unity 7000.0)
还没有人认领这个 Issue。
评估
调研方向
Start with ContentLayoutParser and Documentation/contentlayout-database.md, then inspect the v2 and v3 reference layouts and automated tests. Accept schema version 4 while preserving versions 2 and 3; derive the built-in flag from StableId source type 5 and check that built-in references resolve. Add a v4 layout fixture and verify the documented StableId representation.
由索引模型根据 Issue 内容生成。
描述
Unity 7000.0 (current trunk) writes ContentLayout.json schema version 4. analyze supports versions 2 and 3, so it rejects the file:
Unsupported ContentLayout.json version 4 (this version of UnityDataTool supports versions 2 and 3).
Failed to process: ContentLayout.json
The content files are still analyzed (once SerializedFile v27 is supported), but without the layout. References between content files can't be resolved, and source-asset information is missing.
Schema change (v3 -> v4)
Unity's description of the change:
StableId content changed from the one-way identity hash to the source tuple string it derived from,
"cfid-<guid>-<lfid>-<sourceTypeInt>"- identical to the external-reference pathNames written into built content files, so the two are cross-referenceable by string equality. The built-in entry is an ordinary tuple entry of source type DefaultResources, and ArtifactIndex replaced ContentHash.
In practice the JSON keys are the same as v3. The differences:
SerializedFiles[].StableIdis now e.g.cfid-78532141fd7679a458405eb16bdb75fd-0-1instead of a bare hash. It matches the external reference paths in the.cffiles exactly, as shown byserialized-file externalrefs.IsBuiltInis gone. The built-in "unity default resources" entry is nowcfid-0000000000000000e000000000000000-0-5, with source type 5 = DefaultResources.
Quick experiment
I accepted version 4 in ContentLayoutParser and deserialized it as the v3 model. With that, analyze imported the layout and resolved the cross-file references, since those are resolved by position in the dependency list rather than by StableId. One gap remained: the built-in entry is no longer flagged as built-in, so scene references to default resources (e.g. m_SpotCookie) ended up in dangling_refs. The filename column in content_layout_serialized_files_view also no longer shows the built-in path.
Work includes
- Accept version 4 and keep supporting 2 and 3.
- Derive
is_builtinfor v4 from the source type in the StableId (5 = DefaultResources), and make sure references to built-in files resolve as they did with v3. - Decide how to present
stable_id: keep the tuple string, or also split it into guid / lfid / source type columns. Since StableId now equals the external reference path, it could also be used to cross-check the positional resolution. - Add a v4 reference layout for automated tests, e.g. from a 7000.0 rebuild of
UnityProjects/LeadingEdge. - Update
Documentation/contentlayout-database.mdand any docs describing StableId.
- 主要语言
- C#
- 星标
- 841
- 派生
- 75
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Unity-Technologies/UnityDataTools 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
Unity-Technologies/UnityDataTools#116 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 56/100
-
enhancement
难度 3/5 1-2 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 45/100
查看 Unity-Technologies/UnityDataTools 的全部 Issue
相似的 Issue
-
type:task ux
难度 2/5 1-3 小时 新手友好度 72/100
elsa-workflows/elsa-foundation#5253 ·
维护者通常 1 天内回复