Learn C# Inheritance With Interfaces, Abstract Classes, & Virtual Methods

preview_player
Показать описание

Hey! We have some useful links for you!

Today you're going to learn about C# inheritance. Inheritance is a design pattern - a way of organizing your code. It can be tricky to learn the best ways to leverage inheritance to make it worth it, though.

In this video, Darren uses a basic AI battle royale to help you understand the uses of inheritance. Follow along and you will know how to construct interfaces, use protected member variables, define abstract and virtual methods, and override parent functions within subclasses.

Enjoy, and thanks for watching!
Рекомендации по теме
Комментарии
Автор

Sir you managed make me see further in inheritance. No one else freakin' said what was virtual and override used for. Even in paid courses. I cherish you to continue with what you are doing. You explain really well. Thumbs up +1 subs.

punixerz
Автор

Best tut i've ever seen on the internet, i was stumbling with this for 4 days now, watching every tut i can find, this is the best one! thanks mate!

kugursari
Автор

Thank you so much! This is exactly what I have been looking for--all the other tutorials all use oversimplified abstract classes or child classes as examples and only yours takes care of all different possible scenarios! ❤️

papel
Автор

I kinda knew how Interfaces, abstract and virtual classes work, but every once in a while I need to remind myself. This tutorial is great because you can follow it no matter if it's completely new for you or you just need a reminder. Subbed, Thanx.

ivan-Croatian
Автор

Holy shit, this was the video that I've been looking for so long! You explain everything so well. Thank you!

zMightyKnightz
Автор

Wow, thanks a million for this excellent tutorial!

rejectedcircuit
Автор

Brilliant and cool video. Loved how you presented the information. Thanks for your time.

quadtychgort
Автор

15:14 you can see protected variables with [SerializeField] in the inspector

araskuzucu
Автор

Great video, thanks for the video! I was hoping for a bit more depth on Abstract Classes and Interfaces - specifically if there is any advantage to using Interfaces versus normal Inheritance and what an Abstract Class offers versus an Interface. I may have missed it in the video, I did see abstract methods being used, but didn't seem to be used as a class. Anyway, great video either way thank you!

LloydSummers
Автор

Absolutely beautiful explanation and example. Thanks man!

FacePalmProduxtnsFPP
Автор

Excellent video on the subject! Thank you very much.

SinisterSquid
Автор

lol, watching in 2021 I moved down to give a thumbs up, only to then realize that I already gave a thumbs up in 2017

yazuki-wolf
Автор

so, you didn't add the enemy inheritance to the ogre? What if you don't want to use regenerate and runaway to one of the enemies?

DemonRings
Автор

That's an amazing tutorial !
What is the point of defining the whole parent class (enemy here) as an Abstract class ?

AlexStrook
Автор

Question: why are protected vars in the base class only accessible through methods in the derived class

camelcase
Автор

Thanks for showing this and making it simple to understand. Always appreciate your efforts.

Off topic: Is it possible to use scriptableobjects to define npc behaviors in this scenario? I've watched the Unity tank video on this, but it seems rather convoluted. This could be considered a video request for the future, if it appeals to you.

Thanks much.

jameslavery
Автор

I still don't understand why would I use Interfaces & Abstract classes over normal Inheritance and virtual/override methods? Is it done just for the sole purpose of forcing me to do the implementation so that i don't forget? or am i missing something here?

BehindTheFXTuts
Автор

Hi, Where can I find the code for this tutorial? for example that boolean method which determines unit reached target is interesting to me

dailydoseofchocolate
Автор

Realy cant understand one serious thing, for ogre u use script monoBeh. Than you add in inspector concrete images and others. Than you showed foe us an Enemy-Undead, he have all vsriables and funcs from enemy parrent class, but on the inspector you see only vars that you add to undead, so you cant see the other "enemy vars", so how for example you set the right place for image? If i create a base class character and add vars for sliders, how can a asign this sliders to every chatacter that i have create?

vincentnerv
Автор

why i dont find this channel two mouths ago

guxtavp
welcome to shbcf.ru