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

◆ WithTag() [3/3]

static object Sisus.Init.Find.WithTag ( [DisallowNull] string tag,
[DisallowNull] Type type,
bool includeInactive = false )
static

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

Parameters
tagThe tag to search for.
typeType of the object to find.

Objects match the search criteria if their class is of this type, if their class derives from a base class of this type, or their class implements an interface of this type.

Only objects whose classes derive from Component or objects that are wrapped by a IWrapper<T> can be returned.

Parameters
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.