Support SerializedFile v27 (Unity 7000.0)

未关闭
#158 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp, unity
领域
testing, tooling

调研方向

Start with SerializedFileDetector.MaxMetadataParseVersion and the serialized-file metadata parser; then inspect the native UnityFileSystemApi snapshots and dump handling for data-component payloads. The issue also points to UnityProjects/LeadingEdge and the docs describing the format. Rebuild reference files with Unity 7000.0, ideally including a data component, and verify v27 metadata commands, dump, and analyze work while older versions remain supported.

由索引模型根据 Issue 内容生成。

描述

Unity 6.7 writes v26 of the SerializedFile format (supported since #130). Unity 7000.0 (current trunk) has moved to v27:

    kDataComponentOwners = 27, // Data components' owner GameObject references move from the front of their payloads to a metadata table after the user information string; the payload is exactly what the stored TypeTree describes

Today every SerializedFile from a 7000.0 build is rejected:

SerializedFile version 27 is not supported. UnityDataTool supports up to version 26. Please use a newer version of UnityDataTool to read this file.

As a result, dump, analyze and most serialized-file subcommands don't work on 7000.0 output. serialized-file header still works and shows the version.

Format change

The metadata section gains one table after the user information string. It is always present in v27, even when empty:

  • SInt32 count
  • per row, two fileIDs (each SInt64, 4-byte aligned like other fileIDs in the metadata): the data component's fileID, then the fileID of its owner GameObject, which is in the same file.

A row exists only for data-component objects. Previously the owner reference was stored at the front of the data component's payload, so the payload is now exactly what its TypeTree describes.

Quick experiment

I built a Content Directory with a local trunk editor and tried two local changes:

  • Raising SerializedFileDetector.MaxMetadataParseVersion to 27 was enough for the serialized-file metadata commands. The parser stops before the user information string, so it never reaches the new table.
  • dump and analyze also need a newer native library. The current UnityFileSystemApi snapshot rejects v27 files ("File may be corrupted or was serialized with a newer version of Unity"). With the UnityFileSystemApi.dll from the trunk editor build (Data/Tools), both commands worked.

That build had no data components, so the new table was empty.

Work includes

  • Update to a new UnityFileSystemApi snapshot (Windows/Mac/Linux) from a 7000.0 build.
  • Raise MaxMetadataParseVersion to 27 and keep reading older versions. Optionally parse the owner table, e.g. so serialized-file can report it.
  • Check that dump handles data components correctly now that their payload no longer starts with the owner reference.
  • Add v27 reference files for automated tests, e.g. by rebuilding UnityProjects/LeadingEdge with 7000.0, ideally with a data component so the owner table isn't empty.
  • Update docs that describe the SerializedFile format and its version history.
主要语言
C#
星标
841
派生
75
平均合并
1 天 7 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Unity-Technologies/UnityDataTools 的其他 Issue

查看 Unity-Technologies/UnityDataTools 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。