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

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

static void Sisus.Init.Find.AllInParents< T > ( [DisallowNull] GameObject gameObject,
[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
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 .

Only objects whose classes derive from Component or ScriptableObject or objects that are wrapped by a IWrapper<T> will be included in the results.

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?