Hello and first of all thank you for this fantastic course!
Question is about Section 5 : Block Breaker of the Unity 2D course.
I have a little bit of object-oriented programming knowledge and was wondering how to use inheritance instead of using tags for the different types of blocks.
I’ve researched the course Q&A, and I know inheritance is not on the agenda, but I’d still like to understand how it could work.
I know I could have the Block
class, and then the BreakableBlock
class that would inherit from Block
(and implement OnCollisionEnter2D
).
Could someone simply explain to me how I could do this with the example of blocks? While keeping the simplicity of prefabs and drag and drop. I can’t wrap my head around it !
Thanks in advance !