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

◆ In< T >() [3/7]

static T Sisus.Init.Find.In< T > ( [DisallowNull] object obj)
static

Finds object of type T by searching obj .

If obj is of type T , derives from type T or implements an interface of type T , then returns obj as T .

If obj is a GameObject then the GameObject is searched for a Component which is of type T , derives from type T or implements an interface of type T .

If obj is a Component or wrapped by a Wrapper component then the GameObject to which the Component is attached to is searched for a Component which is of type T , derives from type T or implements an interface of type T .

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 .

Parameters
objThe object to search.
Returns
T instance, if found; otherwise, null.