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

◆ InChildren()

static object Sisus.Init.Find.InChildren ( [DisallowNull] GameObject gameObject,
[DisallowNull] Type type,
bool includeInactive = false )
static

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

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

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

Parameters
gameObjectThe GameObject to search along with all its children.
typeType of the object to find.

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

Parameters
includeInactiveShould components on inactive GameObjects be included in the search?
Returns
Returns
object of the given type , if found; otherwise, null.