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

◆ AllInParents< T >() [3/3]

static void Sisus.Init.Find.AllInParents< T > ( [DisallowNull] GameObject gameObject,
[DisallowNull] Type type,
[DisallowNull] List< T > results,
bool includeInactive = false )
static

Returns all components of the given type attached to the gameObject or any GameObject in its parent chain.

Template Parameters
TGeneric type of the List<T> into which found results will be placed.
Parameters
typeType of the objects to find.

This can be the exact type of an object, 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 all wrappers for objects of that type from the loaded scenes.

Parameters
gameObjectThe GameObject to search along with all its parents.
resultsList into which found instances are added.
includeInactiveShould components on inactive GameObjects be included in the search?