private void writeMetadata(UnityBinaryWriter writer) { // Write Header MetadataHeader.Write(writer); // Write Types writer.WriteInt(Types.Length); for (int i = 0; i < Types.Length; i++) { Types[i].Write(writer); if (MetadataHeader.EnableTypeTree) { Types[i].TypeTree.Write(writer); } } }