GameObjectExtensions.HasComponentInParent<T>

Extension Method in GameObjectExtensions

Declaration

public static bool HasComponentInParent<T>(this GameObject gameObject)

Description

Checks if the game object has a component of the specified type on itself or any of its parents.

Type Parameters

TThe type of component to check for.

Parameters

gameObjectThe game object to check for the component.

Returns

boolTrue if the component exists, false otherwise.