Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static T GetInerfaceType<T>(this UnityEngine.Object obj) where T : class
- {
- T instance = default;
- if (instance == null && obj as T != null)
- instance = obj as T;
- if (instance == null && obj as GameObject != null)
- instance = (obj as GameObject).GetComponent<T>();
- return instance;
- }
Add Comment
Please, Sign In to add comment