FindObjectOfType

FindObjectOfType<T>()

public static T FindObjectOfType<T>() ;

Description

Call Object.FindObjectOfType.
For Unity2023.1 or later, call Object.FindFirstObjectByType.

Type Parameters

Type Parameter Name Description Type Constraints
T Object type

Returns

the object found