Interface IAssetLocator
Interface for locating and loading assets by token and type.
Namespace: Serenity.Global.Application.Interfaces
Assembly: Serenity.Global.Application.dll
Syntax
public interface IAssetLocator
Methods
IsEngineAssetType(Type)
Determines whether type is (or derives from) the engine's base asset type
(e.g. Unity's UnityEngine.Object). Callers outside Infrastructure must not reference the
engine type directly, so this predicate lets them branch on "is this an engine asset reference"
without a compile-time dependency on the engine assembly.
Declaration
bool IsEngineAssetType(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The candidate type to check. |
Returns
| Type | Description |
|---|---|
| bool | True if the type is the engine's base asset type or a type assignable to it. |
TryLoad(string, Type, out object)
Attempts to load an asset based on the provided token and type.
Declaration
bool TryLoad(string token, Type type, out object asset)
Parameters
| Type | Name | Description |
|---|---|---|
| string | token | The token identifying the asset. |
| Type | type | The type of the asset to load. |
| object | asset | The loaded asset if found; otherwise, null. |
Returns
| Type | Description |
|---|---|
| bool | True if the asset was successfully loaded; otherwise, false. |