![]() |
Infohazard.Core 1.4.1
Infohazard Core Utility Library
|
This script is used to assign a unique name to an object, which can then be used to find that object. More...
Static Public Member Functions | |
static bool | TryGetObject (string name, out GameObject result) |
Try to get a GameObject with the given unique name, and return whether it was found. More... | |
static bool | TryGetObject (UniqueNameListEntry entry, out GameObject result) |
Try to get a GameObject with the given unique name asset, and return whether it was found. More... | |
Properties | |
UniqueNameListEntry | UniqueNameListEntry [get] |
Unique name asset for the object. More... | |
string | UniqueName [get, private set] |
Unique name string for the object. More... | |
static IReadOnlyDictionary< string, UniqueNamedObject > | Objects [get] |
Dictionary of all active UniqueNamedObjects keyed by their unique names. More... | |
Events | |
static Action< UniqueNamedObject > | ObjectAdded |
Invoked when a new UniqueNamedObject is added to the dictionary. More... | |
static Action< UniqueNamedObject > | ObjectRemoved |
Invoked when a UniqueNamedObject is removed from the dictionary. More... | |
This script is used to assign a unique name to an object, which can then be used to find that object.
Unique names can be created under a UniqueNameList. The static methods in this class can be used to quickly find objects by their unique names. Since the unique names are asset references, there is no chance of making typos, and they can even be renamed without breaking references. There is nothing that prevents two objects from sharing the same name, but you will get a log error if they are active at the same time.
|
static |
Try to get a GameObject with the given unique name, and return whether it was found.
name | The name to search for. |
result | The object with that name, or null if not found. |
|
static |
Try to get a GameObject with the given unique name asset, and return whether it was found.
entry | The name asset to search for. |
result | The object with that name, or null if not found. |
|
staticget |
Dictionary of all active UniqueNamedObjects keyed by their unique names.
|
getprivate set |
Unique name string for the object.
|
get |
Unique name asset for the object.
|
static |
Invoked when a new UniqueNamedObject is added to the dictionary.
|
static |
Invoked when a UniqueNamedObject is removed from the dictionary.