Omits type information from the AssetBundle.
This flag is useful for AssetBundles that are included in Player builds and are rebuilt for every new Player release.
However, before using this flag, it is critical to fully understand the compatibility and redistribution implications of removing TypeTrees.
By default when this flag isn't specified, each SerializedFile inside an AssetBundle contains the TypeTree information for all types used in that file.
TypeTrees enable Unity to:
When this flag is specified, only the hash of each TypeTree is recorded in the SerializedFile headers, not the entire TypeTree definition.
Example:
An AssetBundle includes instances of a MonoBehaviour-derived class with two fields: a string A followed by an integer B.
The TypeTree records the order, types and names of the fields so that the binary presentation of each serialized object of that type can be interpreted properly.
If the class definition changes to include a float C first, followed by integer B and string A, then the TypeTree inside the
AssetBundle ensures that new builds of the Player can still load it. It recovers the values of the A and B fields even though they
don't match the current definition of that class.
Advantages of using DisableWriteTypeTree:
Omitting TypeTrees reduces AssetBundle size, which can be significant for projects with many small AssetBundles
or complex scripting types containing numerous fields or deeply nested structs.
Therefore, this flag can be a useful optimization in cases where you know that you will always
rebuild and redistribute all AssetBundles any time that you rebuild the Player.
Important Considerations:
AssetBundles built without TypeTrees have strict compatibility requirements:
binary2text and UnityDataTools cannot view the serialized data.