C# Interfaces In Unity
Interfaces can be a tricky subject for new programmers, but once you understand their basic concept, you can start thinking of lots of potential uses for them. The way I think of an Interface is like an abstract class with no implementation. When you are using an abstract class for inheritance you will often want to implement some code in its methods in order to share that code across all the children that inherit it. Interfaces don’t provide that much functionality, but since C# doesn’t support multiple inheritance, an interface can be a good workaround since you can implement multiple interfaces within the same class.
While Interfaces don’t provide as much functionality as inheritance, they are still useful anywhere you want to ensure similar functionality across a set of different game objects in Unity. For example, if you wanted to deal damage only to things that are damageable, you might utilize an interface like this: