GameObjectExtensions.HasComponentInChildren<T>
Extension Method in GameObjectExtensions
Declaration
public static bool HasComponentInChildren<T>(this GameObject gameObject, bool includeInactive = false)Description
Checks if the game object has a component of the specified type on itself or on any of its children using depth first search.
Type Parameters
| T | The type of component to check for. |
Parameters
| gameObject | The game object to check for the component. |
| includeInactive | Includes inactive game objects. |
Returns
| bool | True if the component exists, false otherwise. |