Class AssetCompilerRegistry
A registry containing the asset compilers of the assets.
public sealed class AssetCompilerRegistry
- Inheritance
-
objectAssetCompilerRegistry
- 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
Methods
GetCompiler(Type, Type)
Gets the compiler associated to an Asset type.
public IAssetCompiler? GetCompiler(Type type, Type context)
Parameters
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
contextTypeThe compilation context of the compilers.
createCompilerFunc<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
typeTypeThe type of asset the compiler can compile
compilerIAssetCompilerThe compiler to use
contextType