Support SerializedFile v27 (Unity 7000.0)

Ouverte
#158 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
45/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
csharp, unity
Domaine
testing, tooling

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
C#
Étoiles
841
Forks
75
Merge moyen
1 j 7 h
PR mergées (30 j)
3

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Unity-Technologies/UnityDataTools

Toutes les issues de Unity-Technologies/UnityDataTools

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.