IUnityComponent interface - edcasillas/unity-common-utils GitHub Wiki
The purpose of the IUnityComponent
interface is to expose MonoBehavior's members in an interface.
So why we want to do this? Because then you can make other interfaces (let's say something like IMyInterface) implement this interface, and when you receive an object that is IMyInterface, you can have direct access to its .gameObject, .transform, etc. Otherwise you need to downcast your object to MonoBehavior to achieve this, and that costs performance. The beautiful thing is that any MonoBehavior can implement IUnityComponent just by adding the reference to the interface on its definition and no more effort is required.