MainSerializer
Namespace: UAssetAPI
The main serializer for most property types in UAssetAPI.
public static class MainSerializer
Inheritance Object → MainSerializer
Fields
AdditionalPropertyRegistry
public static String[] AdditionalPropertyRegistry;
Methods
GetNamesOfAssembliesReferencedBy(Assembly)
public static IEnumerable<string> GetNamesOfAssembliesReferencedBy(Assembly assembly)
Parameters
assembly
Assembly
Returns
GenerateUnversionedHeader(List`1&, FName, FName, UnrealPackage)
Generates an unversioned header based on a list of properties, and sorts the list in the correct order to be serialized.
public static FUnversionedHeader GenerateUnversionedHeader(List`1& data, FName parentName, FName parentModulePath, UnrealPackage asset)
Parameters
data
List`1&
The list of properties to sort and generate an unversioned header from.
parentName
FName
The name of the parent of all the properties.
parentModulePath
FName
The path to the module that the parent class/struct of this property is contained within.
asset
UnrealPackage
The UnrealPackage which the properties are contained within.
Returns
TypeToClass(FName, FName, AncestryInfo, FName, FName, UnrealPackage, AssetBinaryReader, Int32, EPropertyTagFlags, Int32, Boolean, Boolean)
Initializes the correct PropertyData class based off of serialized name, type, etc.
public static PropertyData TypeToClass(FName type, FName name, AncestryInfo ancestry, FName parentName, FName parentModulePath, UnrealPackage asset, AssetBinaryReader reader, int leng, EPropertyTagFlags propertyTagFlags, int ArrayIndex, bool includeHeader, bool isZero)
Parameters
type
FName
The serialized type of this property.
name
FName
The serialized name of this property.
ancestry
AncestryInfo
The ancestry of the parent of this property.
parentName
FName
The name of the parent class/struct of this property.
parentModulePath
FName
The path to the module that the parent class/struct of this property is contained within.
asset
UnrealPackage
The UnrealPackage which this property is contained within.
reader
AssetBinaryReader
The BinaryReader to read from. If left unspecified, you must call the PropertyData.Read(AssetBinaryReader, Boolean, Int64, Int64, PropertySerializationContext) method manually.
leng
Int32
The length of this property on disk in bytes.
propertyTagFlags
EPropertyTagFlags
Property tag flags, if available.
ArrayIndex
Int32
The duplication index of this property.
includeHeader
Boolean
Does this property serialize its header in the current context?
isZero
Boolean
Is the body of this property empty?
Returns
PropertyData
A new PropertyData instance based off of the passed parameters.
Read(AssetBinaryReader, AncestryInfo, FName, FName, FUnversionedHeader, Boolean)
Reads a property into memory.
public static PropertyData Read(AssetBinaryReader reader, AncestryInfo ancestry, FName parentName, FName parentModulePath, FUnversionedHeader header, bool includeHeader)
Parameters
reader
AssetBinaryReader
The BinaryReader to read from. The underlying stream should be at the position of the property to be read.
ancestry
AncestryInfo
The ancestry of the parent of this property.
parentName
FName
The name of the parent class/struct of this property.
parentModulePath
FName
The path to the module that the parent class/struct of this property is contained within.
header
FUnversionedHeader
The unversioned header to be used when reading this property. Leave null if none exists.
includeHeader
Boolean
Does this property serialize its header in the current context?
Returns
PropertyData
The property read from disk.
ReadFProperty(AssetBinaryReader)
Reads an FProperty into memory. Primarily used as a part of StructExport serialization.
public static FProperty ReadFProperty(AssetBinaryReader reader)
Parameters
reader
AssetBinaryReader
The BinaryReader to read from. The underlying stream should be at the position of the FProperty to be read.
Returns
FProperty
The FProperty read from disk.
WriteFProperty(FProperty, AssetBinaryWriter)
Serializes an FProperty from memory.
public static void WriteFProperty(FProperty prop, AssetBinaryWriter writer)
Parameters
prop
FProperty
The FProperty to serialize.
writer
AssetBinaryWriter
The BinaryWriter to serialize the FProperty to.
ReadUProperty(AssetBinaryReader, FName)
Reads a UProperty into memory. Primarily used as a part of PropertyExport serialization.
public static UProperty ReadUProperty(AssetBinaryReader reader, FName serializedType)
Parameters
reader
AssetBinaryReader
The BinaryReader to read from. The underlying stream should be at the position of the UProperty to be read.
serializedType
FName
The type of UProperty to be read.
Returns
UProperty
The FProperty read from disk.
ReadUProperty(AssetBinaryReader, Type)
Reads a UProperty into memory. Primarily used as a part of PropertyExport serialization.
public static UProperty ReadUProperty(AssetBinaryReader reader, Type requestedType)
Parameters
reader
AssetBinaryReader
The BinaryReader to read from. The underlying stream should be at the position of the UProperty to be read.
requestedType
Type
The type of UProperty to be read.
Returns
UProperty
The FProperty read from disk.
ReadUProperty<T>(AssetBinaryReader)
Reads a UProperty into memory. Primarily used as a part of PropertyExport serialization.
public static T ReadUProperty<T>(AssetBinaryReader reader)
Type Parameters
T
Parameters
reader
AssetBinaryReader
The BinaryReader to read from. The underlying stream should be at the position of the UProperty to be read.
Returns
T
The FProperty read from disk.
WriteUProperty(UProperty, AssetBinaryWriter)
Serializes a UProperty from memory.
public static void WriteUProperty(UProperty prop, AssetBinaryWriter writer)
Parameters
prop
UProperty
The UProperty to serialize.
writer
AssetBinaryWriter
The BinaryWriter to serialize the UProperty to.
Write(PropertyData, AssetBinaryWriter, Boolean)
Serializes a property from memory.
public static int Write(PropertyData property, AssetBinaryWriter writer, bool includeHeader)
Parameters
property
PropertyData
The property to serialize.
writer
AssetBinaryWriter
The BinaryWriter to serialize the property to.
includeHeader
Boolean
Does this property serialize its header in the current context?
Returns
Int32
The serial offset where the length of the property is stored.