XDracam / unity-corelibrary

Collection of classes and extension methods that make life with Unity3D more comfortable
MIT License
15 stars 3 forks source link

Remove component constraint on Is, As and All #13

Closed Eregerog closed 5 years ago

Eregerog commented 5 years ago

Unity's get component does not have a component constraint so the user can search for components that implement an interface I'd be nice to have this feature in the corelob as well

XDracam commented 5 years ago

Very nice contribution. Will do.

Replacing the constaint with a simple : class so that one does not try to get a value type as component.

XDracam commented 5 years ago

Also removing the where T : Component constaints on AssignComponent and AssignIfAbsent so you can elegantly assign interface types as well.