Quantum 3 3.1.0

Public Member Functions | Public Attributes | List of all members
Quantum.QuantumUnityDBScope Class Reference

A collection of IQuantumAssetObjectSource. At edit time, when placed in a folder, will break the link between assets and the DB. The DB does not reference scopes; instead, it assumes a scope is going to be loaded with QuantumUnityDB.AddScope at runtime. One of the possible use cases is compartmentalizing assets that are statically references by Addressable/Asset Bundle scenes. Without scopes, such assets would be referenced statically by the DB. If a scope is used, it can be marked to be included in the same bundle as the scene and no static references should leak out. More...

Inheritance diagram for Quantum.QuantumUnityDBScope:
Quantum.QuantumScriptableObject

Public Member Functions

void AddSource (IQuantumAssetObjectSource source, AssetGuid guid, string path)
 Adds a new scoped asset source. More...
 
void AddToGlobalDB ()
 Adds the current scope to QuantumUnityDB.Global More...
 
IQuantumAssetObjectSource GetAssetSource (AssetGuid assetGuid)
 Returns the asset source with the given assetGuid . Asset does not get loaded in the process. More...
 
void RemoveFromGlobalDB ()
 Removes the current scope from QuantumUnityDB.Global More...
 

Public Attributes

IReadOnlyList< QuantumUnityDB.Entry > Entries => _entries
 Exposes the list of entries in the DB. Can be used to iterate asset sources at both runtime and edit time. More...
 
string Id
 The unique id of this scope. More...
 

Detailed Description

A collection of IQuantumAssetObjectSource. At edit time, when placed in a folder, will break the link between assets and the DB. The DB does not reference scopes; instead, it assumes a scope is going to be loaded with QuantumUnityDB.AddScope at runtime. One of the possible use cases is compartmentalizing assets that are statically references by Addressable/Asset Bundle scenes. Without scopes, such assets would be referenced statically by the DB. If a scope is used, it can be marked to be included in the same bundle as the scene and no static references should leak out.

Scopes can't be nested.

Member Function Documentation

◆ AddSource()

void Quantum.QuantumUnityDBScope.AddSource ( IQuantumAssetObjectSource  source,
AssetGuid  guid,
string  path 
)
inline

Adds a new scoped asset source.

◆ AddToGlobalDB()

void Quantum.QuantumUnityDBScope.AddToGlobalDB ( )
inline

Adds the current scope to QuantumUnityDB.Global

◆ RemoveFromGlobalDB()

void Quantum.QuantumUnityDBScope.RemoveFromGlobalDB ( )
inline

Removes the current scope from QuantumUnityDB.Global

◆ GetAssetSource()

IQuantumAssetObjectSource Quantum.QuantumUnityDBScope.GetAssetSource ( AssetGuid  assetGuid)
inline

Returns the asset source with the given assetGuid . Asset does not get loaded in the process.

Parameters
assetGuid
Returns
Asset source or null if the asset is not found

Member Data Documentation

◆ Id

string Quantum.QuantumUnityDBScope.Id

The unique id of this scope.

◆ Entries

IReadOnlyList<QuantumUnityDB.Entry> Quantum.QuantumUnityDBScope.Entries => _entries

Exposes the list of entries in the DB. Can be used to iterate asset sources at both runtime and edit time.