Photon Quantum 3.0.0

Public Member Functions | Events | List of all members
Quantum.IResourceManager Interface Reference

Represents an asset manager that can load, unload, and dispose AssetObject. More...

Inheritance diagram for Quantum.IResourceManager:
Quantum.QuantumUnityDB Quantum.ResourceManagerStatic

Public Member Functions

bool DisposeAsset (AssetGuid guid)
 Schedules an asset for disposal or disposes it immediately. More...
 
bool FindNextAssetGuid (ref AssetObjectQuery query, out AssetGuid guid)
 Finds the next asset GUID based on the provided query. More...
 
AssetObject GetAsset (AssetGuid guid)
 Loads an asset synchronously, blocking until it returns. Before the asset gets returned for the first time, the manager needs to have called AssetObject.Loaded. More...
 
AssetGuid GetAssetGuid (string path)
 Converts a path to an asset GUID. More...
 
AssetObjectState GetAssetState (AssetGuid guid)
 Gets the state of an asset. More...
 
Type GetAssetType (AssetGuid guid)
 Gets the type of an asset. More...
 
bool LoadAssetAsync (AssetGuid guid)
 Preloads an asset. The asset will be loaded asynchronously and will be available for use after the next call to one of the GetAsset methods. More...
 
void Update (bool inSimulation=false, in Profiler profiler=default)
 Called after the simulation has run and all tasks have finished. Always executed by the main Quantum thread. More...
 

Events

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...
 

Detailed Description

Represents an asset manager that can load, unload, and dispose AssetObject.

Member Function Documentation

◆ DisposeAsset()

bool Quantum.IResourceManager.DisposeAsset ( AssetGuid  guid)

Schedules an asset for disposal or disposes it immediately.

Parameters
guidThe GUID of the asset to dispose.
Returns
true if the asset exists.

Implemented in Quantum.ResourceManagerStatic.

◆ GetAsset()

AssetObject Quantum.IResourceManager.GetAsset ( AssetGuid  guid)

Loads an asset synchronously, blocking until it returns. Before the asset gets returned for the first time, the manager needs to have called AssetObject.Loaded.

Parameters
guidThe GUID of the asset to load.
Returns
The loaded asset object.

Implemented in Quantum.QuantumUnityDB, and Quantum.ResourceManagerStatic.

◆ LoadAssetAsync()

bool Quantum.IResourceManager.LoadAssetAsync ( AssetGuid  guid)

Preloads an asset. The asset will be loaded asynchronously and will be available for use after the next call to one of the GetAsset methods.

Parameters
guidThe GUID of the asset to preload.
Returns
true if the asset exists.

Implemented in Quantum.QuantumUnityDB, and Quantum.ResourceManagerStatic.

◆ GetAssetGuid()

AssetGuid Quantum.IResourceManager.GetAssetGuid ( string  path)

Converts a path to an asset GUID.

Parameters
pathThe path of the asset.
Returns
The GUID of the asset.

Implemented in Quantum.QuantumUnityDB, and Quantum.ResourceManagerStatic.

◆ GetAssetState()

AssetObjectState Quantum.IResourceManager.GetAssetState ( AssetGuid  guid)

Gets the state of an asset.

Parameters
guidThe GUID of the asset.
Returns
The state of the asset.

Implemented in Quantum.QuantumUnityDB, and Quantum.ResourceManagerStatic.

◆ GetAssetType()

Type Quantum.IResourceManager.GetAssetType ( AssetGuid  guid)

Gets the type of an asset.

Parameters
guidThe GUID of the asset.
Returns
The type of the asset.

Implemented in Quantum.QuantumUnityDB, and Quantum.ResourceManagerStatic.

◆ FindNextAssetGuid()

bool Quantum.IResourceManager.FindNextAssetGuid ( ref AssetObjectQuery  query,
out AssetGuid  guid 
)

Finds the next asset GUID based on the provided query.

Parameters
queryThe query to filter the assets.
guidThe GUID of the next asset.
Returns
true if there is a next asset.

Implemented in Quantum.QuantumUnityDB, and Quantum.ResourceManagerStatic.

◆ Update()

void Quantum.IResourceManager.Update ( bool  inSimulation = false,
in Profiler  profiler = default 
)

Called after the simulation has run and all tasks have finished. Always executed by the main Quantum thread.

Parameters
inSimulationtrue if the update is happening during a simulation.
profilerThe profiler used for profiling.

Implemented in Quantum.ResourceManagerStatic.

Event Documentation

◆ AssetObjectDisposing

AssetObjectDisposingDelegate Quantum.IResourceManager.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.