Table of Contents

Method FindChild

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

FindChild(Component, string)

Finds a direct child of the component's transform with the given name.

public static GameObject FindChild(this Component component, string childName)

Parameters

component Component

The component whose transform to search.

childName string

The name of the child to find.

Returns

GameObject

The child's GameObject.

FindChild(Component, string, bool)

Finds a child of the component's transform with the given name, optionally searching recursively.

public static GameObject FindChild(this Component component, string childName, bool recursive)

Parameters

component Component

The component whose transform to search.

childName string

The name of the child to find.

recursive bool

If true, searches only the direct children; if false, searches the entire hierarchy.

Returns

GameObject

The matching child's GameObject, or null if not found.