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 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.
|
|
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.
|
| 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.
|
| 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.
|
| 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.
|
| 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.
|
|
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.
|
| 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.
|
|
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.
|
| 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
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.