Table of Contents

Class AssetCompilerRegistry

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

A registry containing the asset compilers of the assets.

public sealed class AssetCompilerRegistry
Inheritance
object
AssetCompilerRegistry
Extension Methods

Constructors

AssetCompilerRegistry()

Create an instance of that registry

public AssetCompilerRegistry()

Properties

DefaultCompiler

Gets or sets the default compiler to use when no compiler are explicitly registered for a type.

public IAssetCompiler? DefaultCompiler { get; set; }

Property Value

IAssetCompiler

Methods

GetCompiler(Type, Type)

Gets the compiler associated to an Asset type.

public IAssetCompiler? GetCompiler(Type type, Type context)

Parameters

type Type

The type of the Asset

context Type

Returns

IAssetCompiler

The compiler associated the provided asset type or null if no compiler exists for that type.

RegisterAttributeCompilers<TAttribute>(Type, Func<TAttribute, Assembly, (Type AssetType, IAssetCompiler Compiler)>)

Registers a compiler for each assembly attribute of type TAttribute in the registered assemblies, for declarations their assembly cannot compile itself (such as a static thumbnail an Assets package declares and the editor compiles).

public void RegisterAttributeCompilers<TAttribute>(Type context, Func<TAttribute, Assembly, (Type AssetType, IAssetCompiler Compiler)> createCompiler) where TAttribute : Attribute

Parameters

context Type

The compilation context of the compilers.

createCompiler Func<TAttribute, Assembly, (Type AssetType, IAssetCompiler Compiler)>

Creates the compiler of an attribute found on an assembly, with its asset type.

Type Parameters

TAttribute

RegisterCompiler(Type, IAssetCompiler, Type)

Register a compiler for a given Asset type.

public void RegisterCompiler(Type type, IAssetCompiler compiler, Type context)

Parameters

type Type

The type of asset the compiler can compile

compiler IAssetCompiler

The compiler to use

context Type