Closed james7132 closed 9 years ago
I had a GetComponent extension that worked with interfaces but at some point (Unity 5 I think) I removed them because that's what the default GetComponent
Oh I didn't notice that they removed the generic constraint from the GetComponent variants. Though, with that in mind, the HasComponent methods shouldn't have the Component constraint then. Closing.
GetIComponent and its variants works just like their normal UnityEngine counterparts (generic method, gets you components of a type), except that they also work with any applicable type.
For example:
I have also changed a number of the similar functions in the GameObjectExtensions class to utilize it.