You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The built-in method GameObject.GetComponent<T> has no type constraint to serve a specific use case: To get all components on a GameObject that are subtypes of an interface passed as T. The MyExtensions.HasComponent<T> method in this package should remove the type constraint so that it can check every type that GameObject.GetComponent<T> can get, especially since the current implementation of MyExtensions.HasComponent<T> is just return gameObject.GetComponent<T>() != null;
The text was updated successfully, but these errors were encountered:
The built-in method
GameObject.GetComponent<T>
has no type constraint to serve a specific use case: To get all components on a GameObject that are subtypes of an interface passed as T. TheMyExtensions.HasComponent<T>
method in this package should remove the type constraint so that it can check every type thatGameObject.GetComponent<T>
can get, especially since the current implementation ofMyExtensions.HasComponent<T>
is justreturn gameObject.GetComponent<T>() != null;
The text was updated successfully, but these errors were encountered: