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

◆ InParents() [1/2]

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

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

Parameters
gameObject
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
true if a result was found; otherwise, false.