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

◆ InParents() [2/2]

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

Returns all objects of the given type attached the GameObject or any of its parents.

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

This can be the exact type of an Init.Any<T>, any type derived by it or the type of any interface it implements.

Can also be the type of a wrapped object, in which case it will try to find a wrapper for an object of that type in the loaded scenes.

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