AssetCompilerBase Class
Namespace: Stride.Core.Assets.CompilerAssembly: Stride.Core.Assets.dll
Base implementation for IAssetCompiler suitable to compile a single type of Asset.
public abstract class AssetCompilerBase : IAssetCompiler
Name | Description | |
---|---|---|
Properties | ||
AlwaysCheckRuntimeTypes | ||
Methods | ||
GetAbsolutePath(AssetItem, UFile) | Returns the absolute path on the disk of an Stride.Core.IO.UFile that is relative to the asset location. |
|
GetInputFiles(AssetItem) | Enumerates all the dependencies required to compile this asset |
|
GetInputTypes(AssetItem) | Enumerates all the asset types required to compile this asset |
|
GetInputTypesToExclude(AssetItem) | Enumerates all the asset types to exclude when compiling this asset |
|
GetRuntimeTypes(AssetItem) | ||
Prepare(AssetCompilerContext, AssetItem) | ||
Prepare(AssetCompilerContext, AssetItem, String, AssetCompilerResult) | Compiles the asset from the specified package. |
Properties
AlwaysCheckRuntimeTypes
public virtual bool AlwaysCheckRuntimeTypes { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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
Type | Name | Description |
---|---|---|
AssetItem | assetItem | The asset on which is based the relative path. |
Stride.Core.IO.UFile | relativePath | The path relative to the asset path that must be converted to an absolute path. |
Returns
Type | Description |
---|---|
Stride.Core.IO.UFile | The absolute path on the disk of the |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The |
GetInputFiles(AssetItem)
Enumerates all the dependencies required to compile this asset
public virtual IEnumerable<ObjectUrl> GetInputFiles(AssetItem assetItem)
Parameters
Type | Name | Description |
---|---|---|
AssetItem | assetItem | The asset for which dependencies are enumerated |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ObjectUrl> | The dependencies |
GetInputTypes(AssetItem)
Enumerates all the asset types required to compile this asset
public virtual IEnumerable<BuildDependencyInfo> GetInputTypes(AssetItem assetItem)
Parameters
Type | Name | Description |
---|---|---|
AssetItem | assetItem | The asset for which types are enumerated |
Returns
Type | Description |
---|---|
System.Collections.Generic.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
Type | Name | Description |
---|---|---|
AssetItem | assetItem | The asset for which types are enumerated |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.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
Type | Name | Description |
---|---|---|
AssetItem | assetItem |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Type> |
Prepare(AssetCompilerContext, AssetItem)
public AssetCompilerResult Prepare(AssetCompilerContext context, AssetItem assetItem)
Parameters
Type | Name | Description |
---|---|---|
AssetCompilerContext | context | |
AssetItem | assetItem |
Returns
Type | Description |
---|---|
AssetCompilerResult |
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
Type | Name | Description |
---|---|---|
AssetCompilerContext | context | The context to use to compile the asset. |
AssetItem | assetItem | The asset to compile |
System.String | targetUrlInStorage | The absolute URL to the asset, relative to the storage. |
AssetCompilerResult | result | The result where the commands and logs should be output. |