Photon Quantum 3.0.0

Static Public Member Functions | Static Public Attributes | List of all members
Quantum.Editor.QuantumUnityDBUtilities Class Reference

QuantumUnityDB Editor utilities. More...

Static Public Member Functions

static void Append (this ref Hash128 hash, AssetGuid guid)
 Appends the AssetGuid to the hash. More...
 
static unsafe AssetGuid CreateDeterministicAssetGuid (GUID unityAssetGuid, long fileID)
 Create a deterministic AssetGuid for a Unity GUID and a FileID. More...
 
static AssetGuid CreateDeterministicAssetGuid (LazyLoadReference< UnityEngine.Object > asset)
 Create a deterministic AssetGuid for the given asset, based on its Unity GUID and FileID. More...
 
static bool ExportAsJson ()
 Export the global DB to a JSON file. A dialog is shown to select the file. More...
 
static void ExportAsJson (string path)
 Export the global DB to a JSON file with QuantumUnityJsonSerializer. None of the asset will have its AssetObject.Loaded called, as they are loaded with IQuantumAssetObjectSource.EditorInstance. More...
 
static AssetGuid GetExpectedAssetGuid (GUID guid, long fileId, out bool isOverride)
 Returns the expected AssetGuid for the given Unity asset GUID and FileID. If an override is set, it will be returned instead. More...
 
static AssetGuid GetExpectedAssetGuid (LazyLoadReference< UnityEngine.Object > asset, out bool isOverride)
 Returns the expected AssetGuid for the given asset. If an override is set, it will be returned instead. More...
 
static string GetGlobalDBPath ()
 Returns the default path to the QuantumUnityDB asset. More...
 
static bool IsAssetGuidOverriden (LazyLoadReference< UnityEngine.Object > asset)
 Returns true if the given asset has an AssetGuid override set. More...
 
static AssetDatabaseUtils.AssetEnumerable IterateAssets ()
 Enumerates AssetObject assets with AssetLabel label. More...
 
static void RefreshGlobalDB (bool force=false)
 Refreshes the global Quantum Unity DB. If force is false, an update will only happen if the hash calculated with assets under AssetLabel label has changed. If force is true, a refresh will be performed regardless. More...
 
static AssetGuid RemoveAssetGuidOverride (GUID guid, long fileId)
 Removes the AssetGuid override for the given asset. More...
 
static bool SetAssetGuidOverride (LazyLoadReference< UnityEngine.Object > asset, AssetGuid assetGuid)
 Sets the AssetGuid override for the given asset. If the override is already set, it will be replaced. If assetGuid is AssetGuid.Invalid, the override will be removed. More...
 
static void SetQuantumUnityDBRefreshMode (bool immediate)
 Sets the Quantum Unity DB refresh mode. By default, after an asset with AssetLabel is imported, a call to QuantumUnityDBImporter.RefreshAssetObjectHash is scheduled. When running in batch mode, it may result in the hash never being refreshed and the global QuantumUnityDB not being updated. To prevent this, call this method with immediate set to true. More...
 

Static Public Attributes

const string AssetLabel = "QuantumAsset"
 Label applied to Quantum AssetObject assets. More...
 

Detailed Description

QuantumUnityDB Editor utilities.

Member Function Documentation

◆ GetGlobalDBPath()

static string Quantum.Editor.QuantumUnityDBUtilities.GetGlobalDBPath ( )
inlinestatic

Returns the default path to the QuantumUnityDB asset.

Returns

QuantumGlobalScriptableObject<T>

◆ RefreshGlobalDB()

static void Quantum.Editor.QuantumUnityDBUtilities.RefreshGlobalDB ( bool  force = false)
inlinestatic

Refreshes the global Quantum Unity DB. If force is false, an update will only happen if the hash calculated with assets under AssetLabel label has changed. If force is true, a refresh will be performed regardless.

Parameters
forceForce the reimport.

◆ SetQuantumUnityDBRefreshMode()

static void Quantum.Editor.QuantumUnityDBUtilities.SetQuantumUnityDBRefreshMode ( bool  immediate)
inlinestatic

Sets the Quantum Unity DB refresh mode. By default, after an asset with AssetLabel is imported, a call to QuantumUnityDBImporter.RefreshAssetObjectHash is scheduled. When running in batch mode, it may result in the hash never being refreshed and the global QuantumUnityDB not being updated. To prevent this, call this method with immediate set to true.

Parameters
immediateShould QuantumUnityDBImporter.RefreshAssetObjectHash be called immediately after an asset import.

◆ ExportAsJson() [1/2]

static bool Quantum.Editor.QuantumUnityDBUtilities.ExportAsJson ( )
inlinestatic

Export the global DB to a JSON file. A dialog is shown to select the file.

Returns
true if a file was selected and saved into.

ExportAsJson(string)

◆ ExportAsJson() [2/2]

static void Quantum.Editor.QuantumUnityDBUtilities.ExportAsJson ( string  path)
inlinestatic

Export the global DB to a JSON file with QuantumUnityJsonSerializer. None of the asset will have its AssetObject.Loaded called, as they are loaded with IQuantumAssetObjectSource.EditorInstance.

Parameters
pathOutput path.

◆ IterateAssets()

static AssetDatabaseUtils.AssetEnumerable Quantum.Editor.QuantumUnityDBUtilities.IterateAssets ( )
static

Enumerates AssetObject assets with AssetLabel label.

◆ CreateDeterministicAssetGuid() [1/2]

static AssetGuid Quantum.Editor.QuantumUnityDBUtilities.CreateDeterministicAssetGuid ( LazyLoadReference< UnityEngine.Object >  asset)
inlinestatic

Create a deterministic AssetGuid for the given asset, based on its Unity GUID and FileID.

◆ CreateDeterministicAssetGuid() [2/2]

static unsafe AssetGuid Quantum.Editor.QuantumUnityDBUtilities.CreateDeterministicAssetGuid ( GUID  unityAssetGuid,
long  fileID 
)
inlinestatic

Create a deterministic AssetGuid for a Unity GUID and a FileID.

◆ GetExpectedAssetGuid() [1/2]

static AssetGuid Quantum.Editor.QuantumUnityDBUtilities.GetExpectedAssetGuid ( GUID  guid,
long  fileId,
out bool  isOverride 
)
inlinestatic

Returns the expected AssetGuid for the given Unity asset GUID and FileID. If an override is set, it will be returned instead.

◆ GetExpectedAssetGuid() [2/2]

static AssetGuid Quantum.Editor.QuantumUnityDBUtilities.GetExpectedAssetGuid ( LazyLoadReference< UnityEngine.Object >  asset,
out bool  isOverride 
)
inlinestatic

Returns the expected AssetGuid for the given asset. If an override is set, it will be returned instead.

◆ IsAssetGuidOverriden()

static bool Quantum.Editor.QuantumUnityDBUtilities.IsAssetGuidOverriden ( LazyLoadReference< UnityEngine.Object >  asset)
inlinestatic

Returns true if the given asset has an AssetGuid override set.

◆ SetAssetGuidOverride()

static bool Quantum.Editor.QuantumUnityDBUtilities.SetAssetGuidOverride ( LazyLoadReference< UnityEngine.Object >  asset,
AssetGuid  assetGuid 
)
inlinestatic

Sets the AssetGuid override for the given asset. If the override is already set, it will be replaced. If assetGuid is AssetGuid.Invalid, the override will be removed.

Returns
true if there actually was a change

◆ RemoveAssetGuidOverride()

static AssetGuid Quantum.Editor.QuantumUnityDBUtilities.RemoveAssetGuidOverride ( GUID  guid,
long  fileId 
)
inlinestatic

Removes the AssetGuid override for the given asset.

Returns
The override value, if present or AssetGuid.Invalid.

◆ Append()

static void Quantum.Editor.QuantumUnityDBUtilities.Append ( this ref Hash128  hash,
AssetGuid  guid 
)
inlinestatic

Appends the AssetGuid to the hash.

Member Data Documentation

◆ AssetLabel

const string Quantum.Editor.QuantumUnityDBUtilities.AssetLabel = "QuantumAsset"
static

Label applied to Quantum AssetObject assets.