@@ -70,19 +70,26 @@ public class TypeTreeInfo
7070 public UnityHash128 ScriptID { get ; set ; }
7171
7272 /// <summary>
73- /// Hash of the TypeTree content as originally written into the file.
73+ /// Hash of the TypeTree structure (field names, types, byte sizes, alignment flags),
74+ /// computed via MD4 over the node graph. Used to detect type schema changes between
75+ /// the version stored in the file and the current runtime type, and to deduplicate
76+ /// type entries when writing serialized files. Sometimes referred to as the "OldTypeHash"
77+ /// because it refers to the type at the time it was serialized, which might be older than
78+ /// the current type.
7479 /// Used for compatibility checking at load time.
7580 /// </summary>
76- public UnityHash128 OldTypeHash { get ; set ; }
81+ public UnityHash128 TypeTreeStructureHash { get ; set ; }
7782
7883 // -----------------------------------------------------------------------
7984 // TypeTree inline/extracted data (only when EnableTypeTree = true)
8085 // -----------------------------------------------------------------------
8186
8287 /// <summary>
83- /// XXH3 content hash of the TypeTree blob. Stored explicitly in the metadata for
88+ /// XXH3 content hash of the TypeTree blob, e.g. hash of the raw binary encoding
89+ /// of the TypeTree definition. Stored explicitly in the metadata for
8490 /// version >= 23 (kExtractedTypeTreeSupport). IsZero == true indicates this field
8591 /// was not present in the metadata (version < 23 or no inline TypeTree).
92+ /// This is used for TypeTree deduplication and caching.
8693 /// </summary>
8794 public UnityHash128 TypeTreeContentHash { get ; set ; }
8895
@@ -751,7 +758,7 @@ private static TypeTreeInfo ReadTypeEntry(BinaryReader reader, uint version, boo
751758 info . ScriptID = BinaryFileHelper . ReadHash128 ( reader , swap ) ;
752759
753760 // oldTypeHash: always present. Hash of the TypeTree content as originally written.
754- info . OldTypeHash = BinaryFileHelper . ReadHash128 ( reader , swap ) ;
761+ info . TypeTreeStructureHash = BinaryFileHelper . ReadHash128 ( reader , swap ) ;
755762
756763 if ( ! enableTypeTree )
757764 return info ;
0 commit comments