Quantum 3 3.0.14

Classes | Static Public Member Functions | List of all members
Quantum.QuantumUnitySceneManagerUtils Class Reference

Exension and utility methods for SceneManager and Scene types. More...

Classes

class  SceneEqualityComparer
 A comparer that can be used when scenes need to be comparable, like when being as keys in a dictionary. More...
 

Static Public Member Functions

static bool CanBeUnloaded (this Scene scene)
 Returns true if scene can be unloaded. More...
 
static int CompareRawHandle (this Scene scene, ObjectIdType id)
 Compares the object id to the internal handle of scene More...
 
static string Dump (this LoadSceneParameters loadSceneParameters)
 Converts loadSceneParameters to string. More...
 
static string Dump (this Scene scene)
 Converts scene into string, dumping all its fields and properties. More...
 
static T GetComponentInHierarchyOrder< T > (this Scene scene, bool includeInactive=false, Predicate< T > exclude=null)
 Gets first component on a scene. More...
 
static T[] GetComponentsInHierarchyOrder< T > (IList< GameObject > roots, bool includeInactive=false, Predicate< T > exclude=null)
 Gets all the component present on a scene, depth first. More...
 
static T[] GetComponentsInHierarchyOrder< T > (this Scene scene, bool includeInactive=false, Predicate< T > exclude=null)
 Gets all the component present on a scene, depth first. More...
 
static ulong GetRawHandle (this Scene scene)
 Gets the raw handle of a scene More...
 
static void GetRootGameObjectsInHierarchyOrder (this Scene scene, List< GameObject > rootGameObjects)
 Gets all the root GameObjects, sorted by their simbling index. More...
 
static int GetSceneBuildIndex (string nameOrPath)
 Gets scene's build index based on its name or path. More...
 
static T GetSingleComponentOrThrow< T > (this Scene scene, bool includeInactive=false, Predicate< T > exclude=null)
 Gets a component on a scene. If there are none or more than one, throws an exception. More...
 
static bool IsAddedToBuildSettings (this Scene scene)
 Returns true if scene is in the build settings. Note that just checking Scene.buildIndex is not enough. More...
 

Detailed Description

Exension and utility methods for SceneManager and Scene types.

Member Function Documentation

◆ IsAddedToBuildSettings()

static bool Quantum.QuantumUnitySceneManagerUtils.IsAddedToBuildSettings ( this Scene  scene)
inlinestatic

Returns true if scene is in the build settings. Note that just checking Scene.buildIndex is not enough.

◆ CanBeUnloaded()

static bool Quantum.QuantumUnitySceneManagerUtils.CanBeUnloaded ( this Scene  scene)
inlinestatic

Returns true if scene can be unloaded.

Parameters
scene
Returns

◆ GetRawHandle()

static ulong Quantum.QuantumUnitySceneManagerUtils.GetRawHandle ( this Scene  scene)
inlinestatic

Gets the raw handle of a scene

◆ CompareRawHandle()

static int Quantum.QuantumUnitySceneManagerUtils.CompareRawHandle ( this Scene  scene,
ObjectIdType  id 
)
inlinestatic

Compares the object id to the internal handle of scene

◆ Dump() [1/2]

static string Quantum.QuantumUnitySceneManagerUtils.Dump ( this Scene  scene)
inlinestatic

Converts scene into string, dumping all its fields and properties.

◆ Dump() [2/2]

static string Quantum.QuantumUnitySceneManagerUtils.Dump ( this LoadSceneParameters  loadSceneParameters)
inlinestatic

Converts loadSceneParameters to string.

◆ GetSceneBuildIndex()

static int Quantum.QuantumUnitySceneManagerUtils.GetSceneBuildIndex ( string  nameOrPath)
inlinestatic

Gets scene's build index based on its name or path.

◆ GetRootGameObjectsInHierarchyOrder()

static void Quantum.QuantumUnitySceneManagerUtils.GetRootGameObjectsInHierarchyOrder ( this Scene  scene,
List< GameObject >  rootGameObjects 
)
inlinestatic

Gets all the root GameObjects, sorted by their simbling index.

◆ GetSingleComponentOrThrow< T >()

static T Quantum.QuantumUnitySceneManagerUtils.GetSingleComponentOrThrow< T > ( this Scene  scene,
bool  includeInactive = false,
Predicate< T >  exclude = null 
)
inlinestatic

Gets a component on a scene. If there are none or more than one, throws an exception.

Type Constraints
T :Component 

◆ GetComponentInHierarchyOrder< T >()

static T Quantum.QuantumUnitySceneManagerUtils.GetComponentInHierarchyOrder< T > ( this Scene  scene,
bool  includeInactive = false,
Predicate< T >  exclude = null 
)
inlinestatic

Gets first component on a scene.

Type Constraints
T :class 

◆ GetComponentsInHierarchyOrder< T >() [1/2]

static T [] Quantum.QuantumUnitySceneManagerUtils.GetComponentsInHierarchyOrder< T > ( this Scene  scene,
bool  includeInactive = false,
Predicate< T >  exclude = null 
)
inlinestatic

Gets all the component present on a scene, depth first.

Type Constraints
T :class 

◆ GetComponentsInHierarchyOrder< T >() [2/2]

static T [] Quantum.QuantumUnitySceneManagerUtils.GetComponentsInHierarchyOrder< T > ( IList< GameObject >  roots,
bool  includeInactive = false,
Predicate< T >  exclude = null 
)
inlinestatic

Gets all the component present on a scene, depth first.

Type Constraints
T :class