Tools to replace GetComponent variants that respects nested objects. These are used to find components of a NetworkedObjects without also finding components that belong to parent or child NetworkedObjects. More...
Static Public Member Functions | |
static T | EnsureRootComponentExists< T, TStopOn > (this Transform transform) |
Ensures that a component of type T exists on the root object of the provided transform. If a component of type T does not exist, it is added. The search for the root object stops if a component of type TStopOn is found. More... | |
static T[] | FindObjectsOfTypeInOrder< T > (this UnityEngine.SceneManagement.Scene scene, bool includeInactive=false) |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slower operation, and does produce garbage collection. More... | |
static void | FindObjectsOfTypeInOrder< T > (this UnityEngine.SceneManagement.Scene scene, List< T > list, bool includeInactive=false) |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slower operation which should not be run every update. More... | |
static TCast[] | FindObjectsOfTypeInOrder< T, TCast > (this UnityEngine.SceneManagement.Scene scene, bool includeInactive=false) |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slow operation, and does produce garbage collection. More... | |
static void | FindObjectsOfTypeInOrder< T, TCast > (this UnityEngine.SceneManagement.Scene scene, List< TCast > list, bool includeInactive=false) |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slower operation and should not be run every update. More... | |
static T | GetNestedComponentInChildren< T, TStopOn > (this Transform t, bool includeInactive) |
Finds the first component of type T in the children of the provided transform, stopping the search if a component of type TStopOn is found. More... | |
static T | GetNestedComponentInParent< T, TStopOn > (this Transform t) |
Same as GetComponentInParent, but will always include inactive objects in search. Will also stop recursing up the hierarchy when the StopOnT is found. More... | |
static T | GetNestedComponentInParents< T, TStopOn > (this Transform t) |
Finds the first component of type T in the parents of the provided transform, stopping the search if a component of type TStopOn is found. More... | |
static List< T > | GetNestedComponentsInChildren< T > (this Transform t, List< T > list, bool includeInactive=true, params System.Type[] stopOn) |
Same as GetComponentsInChildren, but will not recurse into children with any component of the types in the stopOn array. More... | |
static void | GetNestedComponentsInChildren< T, TSearch, TStop > (this Transform t, bool includeInactive, List< T > list) |
Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type. More... | |
static List< T > | GetNestedComponentsInChildren< T, TStopOn > (this Transform t, List< T > list, bool includeInactive=true) |
Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type. More... | |
static void | GetNestedComponentsInParents< T > (this Transform t, List< T > list) |
Returns all T found between the child transform and its root. Order in List from child to parent, with the root/parent most being last. More... | |
static void | GetNestedComponentsInParents< T, TStop > (this Transform t, List< T > list) |
Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopT component. More... | |
static T | GetParentComponent< T > (this Transform t) |
Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found. More... | |
Tools to replace GetComponent variants that respects nested objects. These are used to find components of a NetworkedObjects without also finding components that belong to parent or child NetworkedObjects.
|
static |
Ensures that a component of type T exists on the root object of the provided transform. If a component of type T does not exist, it is added. The search for the root object stops if a component of type TStopOn is found.
T | The type of component to ensure exists on the root object. |
TStopOn | The type of component that stops the search for the root object. |
transform | The transform to start the search from. |
T | : | Component | |
TStopOn | : | Component |
|
static |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slower operation, and does produce garbage collection.
T | : | class |
|
static |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slower operation which should not be run every update.
T | The type being searched for. |
scene | Scene to search. |
list | Supplied list that will be populated by this find. |
includeInactive | Whether results should include inactive components. |
T | : | class |
|
static |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slow operation, and does produce garbage collection.
T | The type being searched for. |
TCast | Casts all found objects to this type, and returns collection of this type. Objects that fail cast are excluded. |
scene | Scene to search. |
includeInactive | Whether results should include inactive components. |
T | : | class | |
TCast | : | class |
|
static |
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order. This is a slower operation and should not be run every update.
T | Type being searched for. |
TCast | Type to cast found objects to. |
scene | Scene to search. |
list | Supplied list that will be filled with found objects. |
includeInactive | Whether results should include inactive components. |
T | : | class | |
TCast | : | class |
|
static |
Finds the first component of type T in the children of the provided transform, stopping the search if a component of type TStopOn is found.
T | The type of component to find. |
TStopOn | The type of component that stops the search. |
t | The transform to start the search from. |
includeInactive | Whether to include inactive game objects in the search. |
T | : | class | |
TStopOn | : | class |
|
static |
Same as GetComponentInParent, but will always include inactive objects in search. Will also stop recursing up the hierarchy when the StopOnT is found.
T | : | class | |
TStopOn | : | class |
|
static |
Finds the first component of type T in the parents of the provided transform, stopping the search if a component of type TStopOn is found.
T | The type of component to find. |
TStopOn | The type of component that stops the search. |
t | The transform to start the search from. |
T | : | class | |
TStopOn | : | class |
|
static |
Same as GetComponentsInChildren, but will not recurse into children with any component of the types in the stopOn array.
T | : | class |
|
static |
Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type.
T | Cast found components to this type. Typically Component, but any other class/interface will work as long as they are assignable from SearchT. |
TSearch | Find components of this class or interface type. |
TStop | When this component is found, no further recursing will be performed on that node. |
T | : | class | |
TSearch | : | class |
|
static |
Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type.
T | : | class | |
TStopOn | : | class |
|
static |
Returns all T found between the child transform and its root. Order in List from child to parent, with the root/parent most being last.
T | : | Component |
|
static |
Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopT component.
T | : | class | |
TStop | : | class |
|
static |
Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found.
T | : | Component |