Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.ConstantIDManager Struct Reference

Public Member Functions

GetComponent< T > (int constantIDValue, bool prioritisePersistentOrMainScene=true)
 Gets a component in the Hierarchy that also has a ConstantID component on the same GameObject. More...
 
GetComponent< T > (int constantIDValue, Scene scene, bool sceneOnlyPrioritises=false)
 Gets a component in the Hierarchy that also has a ConstantID component on the same GameObject. More...
 
ConstantID GetConstantID (int constantIDValue, Scene scene, bool sceneOnlyPrioritises=false)
 Gets a ConstantID component ID number, in a particular scene More...
 
HashSet< T > GetComponents< T > (int constantIDValue)
 Gets all components in the Hierarchy that also have a ConstantID component on the same GameObject. More...
 
HashSet< T > GetComponents< T > (int constantIDValue, Scene scene)
 Gets all components of a particular type within the scene, with a given ConstantID number. More...
 
HashSet< T > GetComponents< T > (Scene scene)
 Gets all components of a given type within a scene. The components must have a ConstantID or Remember component attached in order to be included in the returned result More...
 
HashSet< T > GetPersistentButNotPlayerComponents< T > ()
 Gets all scene-surviving components of a particular type, provided that they are not associated with a Player character. More...
 
ConstantID GetConstantID (int constantIDValue, bool prioritisePersistentOrMainScene=true)
 Gets a ConstantID component in the Hierarchy More...
 
void Register (ConstantID constantID)
 Registers a ConstantID component in the Hierarchy More...
 
void Unregister (ConstantID constantID)
 Unregisters a ConstantID component More...
 

Properties

HashSet< ConstantIDConstantIDs [get]
 
HashSet< ConstantIDMenuConstantIDs [get]
 

Detailed Description

This script is used to store a record of all ConstantID components in the Hierarchy, as well as provide functions to retrieve them based on ID number.

Member Function Documentation

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

T AC.ConstantIDManager.GetComponent< T > ( int  constantIDValue,
bool  prioritisePersistentOrMainScene = true 
)

Gets a component in the Hierarchy that also has a ConstantID component on the same GameObject.

Parameters
constantIDValueThe Constant ID number generated by the ConstantID component
prioritisePersistentOrMainSceneIf True, then components in the main scene, or those that survive scene-changes, will be prioritised in the search
Returns
The component with a matching Constant ID number
Type Constraints
T :Component 

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

T AC.ConstantIDManager.GetComponent< T > ( int  constantIDValue,
Scene  scene,
bool  sceneOnlyPrioritises = false 
)

Gets a component in the Hierarchy that also has a ConstantID component on the same GameObject.

Parameters
constantIDValueThe Constant ID number generated by the ConstantID component
sceneThe scene to search within for the component
sceneOnlyPrioritisesIf True, then the supplied scene is searched first, but all other scenes are then searched if no result is yet found
Returns
The component with a matching Constant ID number
Type Constraints
T :Component 

◆ GetComponents< T >() [1/3]

HashSet<T> AC.ConstantIDManager.GetComponents< T > ( int  constantIDValue)

Gets all components in the Hierarchy that also have a ConstantID component on the same GameObject.

Parameters
constantIDValueThe Constant ID number generated by the ConstantID component
Returns
The components with a matching Constant ID number
Type Constraints
T :Component 

◆ GetComponents< T >() [2/3]

HashSet<T> AC.ConstantIDManager.GetComponents< T > ( int  constantIDValue,
Scene  scene 
)

Gets all components of a particular type within the scene, with a given ConstantID number.

Parameters
constantIDValueThe ID number to search for
sceneThe scene to search
Returns
All components of the give type in the scene, provided they have an associated ConstantID
Type Constraints
T :Component 

◆ GetComponents< T >() [3/3]

HashSet<T> AC.ConstantIDManager.GetComponents< T > ( Scene  scene)

Gets all components of a given type within a scene. The components must have a ConstantID or Remember component attached in order to be included in the returned result

Parameters
sceneThe scene to search
Returns
All components of a given type within the scene, provided they have an associated ConstantID
Type Constraints
T :Component 

◆ GetConstantID() [1/2]

ConstantID AC.ConstantIDManager.GetConstantID ( int  constantIDValue,
bool  prioritisePersistentOrMainScene = true 
)

Gets a ConstantID component in the Hierarchy

Parameters
constantIDValueThe Constant ID number to search for
prioritisePersistentOrMainSceneIf True, then components in the main scene, or those that survive scene-changes, will be prioritised in the search
Returns
The component with a matching Constant ID number

◆ GetConstantID() [2/2]

ConstantID AC.ConstantIDManager.GetConstantID ( int  constantIDValue,
Scene  scene,
bool  sceneOnlyPrioritises = false 
)

Gets a ConstantID component ID number, in a particular scene

Parameters
constantIDValueThe ID number to search for
sceneThe scene to search
sceneOnlyPrioritisesIf True, then the supplied scene is searched first, but all other scenes are then searched if no result is yet found
Returns
The ConstantID component associated with the ID number

◆ GetPersistentButNotPlayerComponents< T >()

HashSet<T> AC.ConstantIDManager.GetPersistentButNotPlayerComponents< T > ( )

Gets all scene-surviving components of a particular type, provided that they are not associated with a Player character.

Returns
All scene-surviving components of the give type
Type Constraints
T :Component 

◆ Register()

void AC.ConstantIDManager.Register ( ConstantID  constantID)

Registers a ConstantID component in the Hierarchy

Parameters
constantIDThe ConstantID to register

◆ Unregister()

void AC.ConstantIDManager.Unregister ( ConstantID  constantID)

Unregisters a ConstantID component

Parameters
constantIDThe ConstantID to unregister

Property Documentation

◆ ConstantIDs

HashSet<ConstantID> AC.ConstantIDManager.ConstantIDs
get

All ConstantID components recorded

◆ MenuConstantIDs

HashSet<ConstantID> AC.ConstantIDManager.MenuConstantIDs
get

All ConstantID components recorded that are part of Unity UI-based menus