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

◆ WithTag< T >()

static T Sisus.Init.Find.WithTag< T > ( string tag,
bool includeInactive = false )
static

Returns object of type T from the first loaded GameObject with the provided tag , if any.

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> can be returned.

Parameters
tagThe tag to search for.
includeInactiveShould inactive GameObjects be included in the search?

Note that searching for inactive GameObjects is a slow operation.

Returns
GameObject with the provided tag, if found; otherwise, null.