A static resource manager that can be used to manage assets in a deterministic context. All the assets are known and instantiated ahead of time. More...
Public Member Functions | |
ResourceManagerStatic (AssetObject[] assets, Native.Allocator allocator, bool allowDisposals=true) | |
Initializes a new instance of the ResourceManagerStatic class with assets. More... | |
ResourceManagerStatic (Native.Allocator allocator, bool allowDisposals=true) | |
Initializes a new instance of the ResourceManagerStatic class. More... | |
void | AddAsset (AssetObject asset, bool isLoaded) |
Adds an asset to the resource manager. More... | |
void | AddAssets (IEnumerable< AssetObject > assets, bool areLoaded) |
Adds a collection of assets to the resource manager. More... | |
void | Dispose () |
Disposes the resource manager and all its assets. More... | |
bool | DisposeAsset (AssetGuid guid) |
Enqueues the asset with the specified GUID for disposal. The actual disposal will happen in the next call to Update from the main thread. More... | |
bool | FindNextAssetGuid (ref AssetObjectQuery query, out AssetGuid guid) |
Finds the next asset GUID that matches the specified query. More... | |
AssetObject | GetAsset (AssetGuid guid) |
Gets the asset with the specified GUID. More... | |
AssetGuid | GetAssetGuid (string path) |
Gets the GUID of the asset with the specified path. More... | |
AssetObjectState | GetAssetState (AssetGuid guid) |
Gets the state of the asset with the specified GUID. More... | |
Type | GetAssetType (AssetGuid guid) |
Gets the type of the asset with the specified GUID. More... | |
bool | LoadAssetAsync (AssetGuid guid) |
Loads the asset with the specified GUID asynchronously. More... | |
void | ProcessDisposals () |
Processes asset disposals. More... | |
void | Update (bool inSimulation=false, in Profiler profiler=default) |
Updates the resource manager. More... | |
Properties | |
ResourceManagerStatic | FallbackResourceManager [get, set] |
Gets or sets the fallback resource manager. More... | |
Additional Inherited Members | |
Events inherited from Quantum.IResourceManager | |
AssetObjectDisposingDelegate | AssetObjectDisposing |
Invoked before AssetObject.Disposed. Exposed as an event, because assets may be disposed externally. Any code using any form of asset caching needs to be aware of that happening. More... | |
A static resource manager that can be used to manage assets in a deterministic context. All the assets are known and instantiated ahead of time.
|
inline |
Initializes a new instance of the ResourceManagerStatic class.
allocator | The allocator to use for managing memory. |
allowDisposals | Whether asset disposals are allowed. |
|
inline |
Initializes a new instance of the ResourceManagerStatic class with assets.
assets | The array of assets. Each asset is not considered loaded yet, so accessing them for the first time will result with AssetObject.Loaded(IResourceManager, Native.Allocator) being called |
allocator | The allocator to use for managing memory. |
allowDisposals | Whether asset disposals are allowed. |
|
inline |
Adds a collection of assets to the resource manager.
assets | The collection of assets to add. |
areLoaded | Whether the assets are already loaded. If false , accessing them for the first time will result with AssetObject.Loaded(IResourceManager, Native.Allocator) being called |
|
inline |
Adds an asset to the resource manager.
asset | The asset to add. |
isLoaded | Whether the asset is already loaded. If false , accessing it for the first time will result with AssetObject.Loaded(IResourceManager, Native.Allocator) being called |
|
inline |
Disposes the resource manager and all its assets.
|
inline |
Enqueues the asset with the specified GUID for disposal. The actual disposal will happen in the next call to Update from the main thread.
guid | The GUID of the asset to dispose. |
true
if the asset was enqueued for disposal.Implements Quantum.IResourceManager.
|
inline |
Gets the asset with the specified GUID.
guid | The GUID of the asset to get. |
null
if the asset does not exist.Implements Quantum.IResourceManager.
|
inline |
Loads the asset with the specified GUID asynchronously.
guid | The GUID of the asset to load. |
true
if the asset exists; otherwise, false
.Implements Quantum.IResourceManager.
|
inline |
Gets the GUID of the asset with the specified path.
path | The path of the asset. |
Implements Quantum.IResourceManager.
|
inline |
Gets the type of the asset with the specified GUID.
guid | The GUID of the asset. |
null
if the asset does not exist.Implements Quantum.IResourceManager.
|
inline |
Finds the next asset GUID that matches the specified query.
query | The query to match. |
guid | The GUID of the next matching asset. |
true
if a matching asset was found; otherwise, false
.Implements Quantum.IResourceManager.
|
inline |
Updates the resource manager.
inSimulation | Whether the update is happening in a simulation context. |
profiler | The profiler to use for profiling. |
Implements Quantum.IResourceManager.
|
inline |
Gets the state of the asset with the specified GUID.
guid | The GUID of the asset. |
Implements Quantum.IResourceManager.
|
inline |
Processes asset disposals.
|
getset |
Gets or sets the fallback resource manager.