Table of Contents

Class AssetFileSerializer

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll

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

IAssetSerializer

Methods

FindSerializer(string)

Finds a serializer for the specified asset file extension.

public static IAssetSerializer FindSerializer(string assetFileExtension)

Parameters

assetFileExtension string

The 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

stream Stream
filePath UFile
log ILogger

Returns

AssetLoadResult<T>

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

filePath string

The file path.

log ILogger

The logger.

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 IAssetSerializerFactory

The 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 Stream

The stream.

asset object

The asset object.

yamlMetadata AttachedYamlAssetMetadata
log ILogger

The 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 string

The file path.

asset object

The asset object.

yamlMetadata AttachedYamlAssetMetadata
log ILogger

The logger.

Exceptions

ArgumentNullException

filePath