GameObjectExtensions.HasComponent

Extension Method in GameObjectExtensions

Declaration

public static bool HasComponent(this GameObject gameObject, Type component)

Description

Checks if the game object has a component of the specified type.

Parameters

gameObjectThe game object to check for the component.
componentThe type of component to check for.

Returns

boolTrue if the component exists, false otherwise.