Table of Contents

Class AssetCompilerBase

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

Base implementation for IAssetCompiler suitable to compile a single type of Asset.

public abstract class AssetCompilerBase : IAssetCompiler
Inheritance
AssetCompilerBase
Implements

Properties

AlwaysCheckRuntimeTypes

public virtual bool AlwaysCheckRuntimeTypes { get; }

Property Value

bool

Methods

GetAbsolutePath(AssetItem, UFile)

Returns the absolute path on the disk of an Stride.Core.IO.UFile that is relative to the asset location.

protected static UFile GetAbsolutePath(AssetItem assetItem, UFile relativePath)

Parameters

assetItem AssetItem

The asset on which is based the relative path.

relativePath UFile

The path relative to the asset path that must be converted to an absolute path.

Returns

UFile

The absolute path on the disk of the relativePath argument.

Exceptions

ArgumentException

The relativePath argument is a null or empty Stride.Core.IO.UFile.

GetInputFiles(AssetItem)

Enumerates all the dependencies required to compile this asset

public virtual IEnumerable<ObjectUrl> GetInputFiles(AssetItem assetItem)

Parameters

assetItem AssetItem

The asset for which dependencies are enumerated

Returns

IEnumerable<ObjectUrl>

The dependencies

GetInputTypes(AssetItem)

Enumerates all the asset types required to compile this asset

public virtual IEnumerable<BuildDependencyInfo> GetInputTypes(AssetItem assetItem)

Parameters

assetItem AssetItem

The asset for which types are enumerated

Returns

IEnumerable<BuildDependencyInfo>

The dependencies

GetInputTypesToExclude(AssetItem)

Enumerates all the asset types to exclude when compiling this asset

public virtual IEnumerable<Type> GetInputTypesToExclude(AssetItem assetItem)

Parameters

assetItem AssetItem

The asset for which types are enumerated

Returns

IEnumerable<Type>

The types to exclude

Remarks

This method takes higher priority, it will exclude assets included with inclusion methods even in the same compiler

GetRuntimeTypes(AssetItem)

public virtual IEnumerable<Type> GetRuntimeTypes(AssetItem assetItem)

Parameters

assetItem AssetItem

Returns

IEnumerable<Type>

Prepare(AssetCompilerContext, AssetItem)

Compiles a list of assets from the specified package.

public AssetCompilerResult Prepare(AssetCompilerContext context, AssetItem assetItem)

Parameters

context AssetCompilerContext
assetItem AssetItem

The asset reference.

Returns

AssetCompilerResult

The result of the compilation.

Prepare(AssetCompilerContext, AssetItem, string, AssetCompilerResult)

Compiles the asset from the specified package.

protected abstract void Prepare(AssetCompilerContext context, AssetItem assetItem, string targetUrlInStorage, AssetCompilerResult result)

Parameters

context AssetCompilerContext

The context to use to compile the asset.

assetItem AssetItem

The asset to compile

targetUrlInStorage string

The absolute URL to the asset, relative to the storage.

result AssetCompilerResult

The result where the commands and logs should be output.