Interface IAssetResolver
- Namespace
- Icy.Assets
- Assembly
- IcyUI.dll
Represents a service that performs assets loading.
public interface IAssetResolver : IDisposable
- Inherited Members
- Extension Methods
Methods
CreateScope(IAssetContext)
Creates a caching scope for the specified asset context.
IAssetScope CreateScope(IAssetContext context)
Parameters
contextIAssetContextAn instance of the IAssetScope that refers to the cached section.
Returns
- IAssetScope
A disposable scope for caching assets related to the specified asset context.
LoadAssetAsync<T>(IAssetContext, string)
Loads the asset asynchronously if it's available. See more: LoadAsset<T>(IAssetContext, string).
ValueTask<T> LoadAssetAsync<T>(IAssetContext context, string path) where T : class
Parameters
contextIAssetContextContext to load asset from.
pathstringPath to load asset from.
Returns
- ValueTask<T>
An instance of the loaded asset.
Type Parameters
TType of the loaded asset.
LoadAsset<T>(IAssetContext, string)
Loads an asset from the specified location.
T LoadAsset<T>(IAssetContext context, string path) where T : class
Parameters
contextIAssetContextContext to load asset from.
pathstringPath to load asset from.
Returns
- T
An instance of the loaded asset.
Type Parameters
TType of the loaded asset.
RegisterImporter<T>(IAssetImporter<T>)
Registers an instance of the IAssetImporter<T> to use when loading assets of type T.
void RegisterImporter<T>(IAssetImporter<T> importer)
Parameters
importerIAssetImporter<T>An instance of the IAssetImporter<T> to register.
Type Parameters
TType of the assets supported by specified asset loader.
RegisterParser(IAssetParser)
Registers an instance of the IAssetParser to use when loading assets.
void RegisterParser(IAssetParser parser)
Parameters
parserIAssetParserAn instance of the IAssetParser to load assets.