Class AssetFileSerializer
Main entry point for serializing/deserializing Asset.
public static class AssetFileSerializer
- Inheritance
-
AssetFileSerializer
Fields
Default
The default serializer.
public static readonly IAssetSerializer Default
Field Value
Methods
FindSerializer(string)
Finds a serializer for the specified asset file extension.
public static IAssetSerializer FindSerializer(string assetFileExtension)
Parameters
assetFileExtension
stringThe asset file extension.
Returns
- IAssetSerializer
IAssetSerializerFactory.
Load<T>(Stream, UFile, ILogger)
public static AssetLoadResult<T> Load<T>(Stream stream, UFile filePath, ILogger log = null)
Parameters
Returns
Type Parameters
T
Load<T>(string, ILogger)
Deserializes an Asset from the specified stream.
public static AssetLoadResult<T> Load<T>(string filePath, ILogger log = null)
Parameters
Returns
- AssetLoadResult<T>
An instance of Asset not a valid asset asset object file.
Type Parameters
T
Type of the asset
Register(IAssetSerializerFactory)
Registers the specified serializer factory.
public static void Register(IAssetSerializerFactory serializerFactory)
Parameters
serializerFactory
IAssetSerializerFactoryThe serializer factory.
Exceptions
- ArgumentNullException
serializerFactory
Save(Stream, object, AttachedYamlAssetMetadata, ILogger)
Serializes an Asset to the specified stream.
public static void Save(Stream stream, object asset, AttachedYamlAssetMetadata yamlMetadata, ILogger log = null)
Parameters
stream
StreamThe stream.
asset
objectThe asset object.
yamlMetadata
AttachedYamlAssetMetadatalog
ILoggerThe logger.
Exceptions
- ArgumentNullException
stream or assetFileExtension
Save(string, object, AttachedYamlAssetMetadata, ILogger)
Serializes an Asset to the specified file path.
public static void Save(string filePath, object asset, AttachedYamlAssetMetadata yamlMetadata, ILogger log = null)
Parameters
filePath
stringThe file path.
asset
objectThe asset object.
yamlMetadata
AttachedYamlAssetMetadatalog
ILoggerThe logger.
Exceptions
- ArgumentNullException
filePath