Photon Quantum 3.0.0

Public Member Functions | Public Attributes | Properties | List of all members
Quantum.QuantumAssetSourceResource< T > Class Template Reference

Resources-based implementation of the asset source pattern. More...

Public Member Functions

void Acquire (bool synchronous)
 Loads the asset. In synchronous mode, the asset is loaded immediately. In asynchronous mode, the asset is loaded in the background. More...
 
void Release ()
 Unloads the asset. If the asset is not loaded, an exception is thrown. If the asset is loaded multiple times, it is only unloaded when the last acquire is released. More...
 
WaitForResult ()
 Blocks until the asset is loaded. If the asset is not loaded, an exception is thrown. More...
 

Public Attributes

string Description => $"Resource: {ResourcePath}{(!string.IsNullOrEmpty(SubObjectName) ? $"[{SubObjectName}]" : "")}"
 The description of the asset source. Used for debugging. More...
 
string ResourcePath
 Resource path. Note that this is a Unity resource path, not a file path. More...
 
string SubObjectName
 Sub-object name. If empty, the main object is loaded. More...
 

Properties

bool IsCompleted [get]
 Returns true if the asset is loaded. More...
 

Detailed Description

Resources-based implementation of the asset source pattern.

Template Parameters
T
Type Constraints
T :UnityEngine.Object 

Member Function Documentation

◆ Acquire()

void Quantum.QuantumAssetSourceResource< T >.Acquire ( bool  synchronous)
inline

Loads the asset. In synchronous mode, the asset is loaded immediately. In asynchronous mode, the asset is loaded in the background.

Parameters
synchronous

◆ Release()

void Quantum.QuantumAssetSourceResource< T >.Release ( )
inline

Unloads the asset. If the asset is not loaded, an exception is thrown. If the asset is loaded multiple times, it is only unloaded when the last acquire is released.

Exceptions
Exception

◆ WaitForResult()

T Quantum.QuantumAssetSourceResource< T >.WaitForResult ( )
inline

Blocks until the asset is loaded. If the asset is not loaded, an exception is thrown.

Returns
The loaded asset

Member Data Documentation

◆ ResourcePath

string Quantum.QuantumAssetSourceResource< T >.ResourcePath

Resource path. Note that this is a Unity resource path, not a file path.

◆ SubObjectName

string Quantum.QuantumAssetSourceResource< T >.SubObjectName

Sub-object name. If empty, the main object is loaded.

◆ Description

string Quantum.QuantumAssetSourceResource< T >.Description => $"Resource: {ResourcePath}{(!string.IsNullOrEmpty(SubObjectName) ? $"[{SubObjectName}]" : "")}"

The description of the asset source. Used for debugging.

Property Documentation

◆ IsCompleted

bool Quantum.QuantumAssetSourceResource< T >.IsCompleted
get

Returns true if the asset is loaded.