![]() |
Infohazard.Core 1.4.1
Infohazard Core Utility Library
|
A serializable type used to uniquely identify a component relative to a root GameObject. More...
Public Member Functions | |
ComponentID (Transform root, Component target) | |
Construct a ComponentID with the given root and target by calculating the path to the target. More... | |
override string | ToString () |
T | Get< T > (Transform root) |
Get the referenced component. More... | |
bool | Equals (ComponentID other) |
override bool | Equals (object obj) |
override int | GetHashCode () |
Properties | |
string | Path [get] |
Path from this GameObject to the GameObject that holds the referenced component. More... | |
string | Type [get] |
Type name of the referenced component. More... | |
A serializable type used to uniquely identify a component relative to a root GameObject.
The root GameObject that holds the ComponentID may not be an actual transform.root, but rather just an ancestor of the referenced component. This type is mostly used in order to persist the states of individual components, keyed by their ID.
Infohazard.Core.ComponentID.ComponentID | ( | Transform | root, |
Component | target | ||
) |
Construct a ComponentID with the given root and target by calculating the path to the target.
root | The GameObject from which the reference originates. |
target | The component that is being referenced. |
bool Infohazard.Core.ComponentID.Equals | ( | ComponentID | other | ) |
override bool Infohazard.Core.ComponentID.Equals | ( | object | obj | ) |
T Infohazard.Core.ComponentID.Get< T > | ( | Transform | root | ) |
Get the referenced component.
root | The GameObject from which the reference originates. |
T | Type to cast the component to. |
T | : | Component |
override int Infohazard.Core.ComponentID.GetHashCode | ( | ) |
override string Infohazard.Core.ComponentID.ToString | ( | ) |
|
get |
Path from this GameObject to the GameObject that holds the referenced component.
|
get |
Type name of the referenced component.