
Learning C# by Developing Games with Unity
By :

An object-oriented mindset is crucial to creating meaningful applications and understanding how the C# language works behind the scenes. The tricky part is that classes and structs by themselves aren’t the end of the line when it comes to OOP and designing your objects. They’ll always be the building blocks of your code, but classes are limited to single inheritance, meaning they can only ever have one parent or superclass, and structs can’t inherit at all. So, the question you should be asking yourself right about now is simple: “How can I create objects from the same template and have them perform different actions based on a specific scenario?”
To answer this question, we’ll be learning about interfaces, abstract classes, and class extensions.
One of the ways to gather groups of functionality together is through interfaces. Like classes, interfaces are blueprints for data and behaviors, but with one...