T GetInChildren( bool includeDisabled )

robot_2Generated
code_blocksInput

Description

The GetInChildren method in the ComponentList class is used to find a component of type T on the immediate children of the current game object. This method allows you to specify whether to include disabled components in the search.

Usage

To use the GetInChildren method, call it on an instance of ComponentList and specify the type of component you are looking for. You can also pass a boolean parameter to indicate whether disabled components should be included in the search.

Example

// Example usage of GetInChildren
ComponentList componentList = gameObject.GetComponentList();
MyComponentType component = componentList.GetInChildren<MyComponentType>(includeDisabled: true);

if (component != null)
{
    // Component found, perform operations on it
}