This is super useful, thanks for making this b3agz. I'm itching to refactor some of my approaches to things with this new knowledge!
The battle against the urge to fix all the stuff past-you did is real >.< Thanks for watching!
I didn’t know about this! Thanks! Very helpful with a couple of small projects I’m working on.
Yeah, interfaces are super useful. Like from my recent experience, it wouldn't have been easier for me to add multiple controller types for my flying system asset. Just with the power of interfaces, I am able to plug in any new input type on the fly with less code and without causing any breakage.
Yeah I'm ashamed to say I only started using them recently. Super useful. Thank for watching!
Good one! Next up: how to serialize an interface to show up in the inspector
interfaces are promises of what a class can do, classes are what objects are.
9:45 - I think that misses the point of interfaces, as you can modify methods in classes by making those methods abstract and overriding them... so interfaces are NOT about having different methods do different things. The reason for interfaces are: to allow classes to not inherent from other classes in order to just create a contract saying a specific method will in fact be available on the class... a better way to say it is: interfaces are promises of what a class can do, classes are what objects are.
So, even though a rubber ball, my checking account, and a dead baby, all have the ability to 'bounce()' that does not mean that they are objects of the same type... they are different objects and one does not inherent from another... however, with interfaces you can have a list of 'bounceable things' and you can call 'bounce()' on each of those things without worry, knowing that 'bounce()' is a valid method. Since interfaces are implemented on each class that uses them, they can have a unique way to deal with how the 'bounce()' method should function.
laushan dinglenut :D
First
Just to mention it. Another important thing about inheritance is that you can use override and virtual. means that TakeDamage can only contain a debug message and the override in your Enemy1 or Enemy2 could override this TakeDamage to handle the logic differently. :) Therefore, inheritance is very powerful, especially when combined with interfaces. :) but, great video, like always. :)