Init(args)
Scripting Reference
Loading...
Searching...
No Matches

◆ InChildren< T >() [2/2]

static bool Sisus.Init.Find.InChildren< T > ( [DisallowNull] GameObject gameObject,
[NotNullWhen(true), MaybeNullWhen(false)] out T result,
bool includeInactive = false )
static

Finds object of type T by searching the gameObject and all of its child GameObjects, including grandchildren.

The GameObject and its children is searched for a Component which is of type T , derives from type T or implements an interface of type T .

Objects wrapped by IWrapper<T> components are also considered in the search.

Template Parameters
TType of the object to find.

Objects match the search criteria if their class is of type T , if their class derives from a base class of type T , or their class implements an interface of type T .

Parameters
gameObjectThe GameObject to search along with all its children.
resultWhen this method returns, contains object of type T , if found; otherwise, null. This parameter is passed uninitialized.
includeInactiveShould components on inactive GameObjects be included in the search?
Returns
true if object of the given type was found; otherwise, false.