GameObjectExtensions.HasComponentInChildren
Extension Method in GameObjectExtensions
Declaration
public static bool HasComponentInChildren(this GameObject gameObject, Type component, 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.
Parameters
gameObject | The game object to check for the component. |
component | The type of component to check for. |
includeInactive | Includes inactive game objects. |
Returns
bool | True if the component exists, false otherwise. |