Inheritance and Interfaces for Beginners | Unity C# Basics 6




Published: 26 Jul 2022

With this tutorial, aimed at absolute beginners who have very little to no coding experience whatsoever, you'll learn what Inheritance is (it's not passing on hereditary traits or getting money!), how to use it (you already are using it!), what an Interface is, how to use it, and what the difference between the two are!


If you've been using Unity for a while, or are just getting started with Unity and decided it's time for you to start learning how to write code - this is the video series you need to start your programming journey!


📝📝📝YOUR HOMEWORK!📝📝📝


Do some data modeling for enemies that can attack the player. Starting with 3 types:

1. Melee enemy

2. Ranged enemy

3. Boss enemy


Create inheritance relationships and interfaces to allow you to group common code and variables, define "can-do" relationships that allow you to extend what enemies and bosses can do in the future without significant rework.


🔶 ALL THINGS LlamAcademy now available at: https://llamacademy.dev/support including latest tutorials, courses, ways to support, and more! Check it out 🙂

👨‍💻 Get the FULL FREE PROJECT on GitHub: https://github.com/llamacademy/unity-csharp-basics-6

🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?section=personal&billing=yearly


📚 Resources

🟠 Unity MonoBehaviour: https://docs.unity3d.com/ScriptReference/MonoBehaviour.html

🟠 C# Fundamentals - Inheritance: https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/inheritance

🟠 C# Access Modifiers: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers

🟠 C# Interface: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface

🟠 C# Virtual: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/virtual

🟠 C# Overriding methods: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/knowing-when-to-use-override-and-new-keywords


Full Series Playlist Here: https://www.youtube.com/watch?v=SXaa61JWLDw&list=PLllNmP7eq6TTjwoyfRYAAFOH1sMHVgI1r


🟠 Part 1 - Writing your first script - https://youtu.be/SXaa61JWLDw

🟠 Part 2 - Loops and Arrays - https://youtu.be/MB6B9nHSrps

🟠 Part 3 - Unity Component Lifecycle - https://youtu.be/TD3yoFg3GVI

🟠 Part 4 - Static vs Instances - https://youtu.be/JRRlAzBh-6U

🟠 Part 5 - Delegates - https://youtu.be/1N6k7Hj_JKc

🟠 Part 6 - Inheritance & Interfaces - https://youtu.be/siRvSZzrhRU

🟠 Part 7 - Compositional Relationships - https://youtu.be/khIweJfnyW4


Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.


Connect on Social Media

Some links may be affiliate links, which at no additional cost to you, gives LlamAcademy a small portion of the purchase.