Compositional Relationships - Youve Already Been Using Them | Unity C# Basics 6 | #shorts @LlamAcademy
Compositional Relationships - Youve Already Been Using Them | Unity C# Basics 6 | #shorts  @LlamAcademy
Uploaded September 2022 | Updated September 2026, 2 hours ago
Full Tutorial: youtu.be/KbpapnyT9do

With this tutorial, aimed at absolute beginners who have very little to no coding experience whatsoever, you'll learn what Composition is and how to use it (you already are using it!). You'll learn when to use a compositional relationship versus an inheritance relationship and what the benefits are for favoring Composition over Inheritance.

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!

The AutoDestroyText/CountDownAutoDestroyText code referenced in this video is available, as always, on GitHub: github.com/llamacademy/unity-csharp-basics-6
This video we didn't implement anything new, so there's no new repository!

πŸ“πŸ“πŸ“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
4. Ranged and Melee attacking enemy.

Revisit your last homework to create inheritance and compositional 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.

🚨 Limited Time Unity Tools Bundle humblebundle.com/software/unity-tools-software?partner=llamasoftware&charity=2280172 Ends September 22 🚨
⚫ Unistorm: assetstore.unity.com/packages/tools/particles-effects/unistorm-volumetric-clouds-sky-modular-weather-and-cloud-shadows-2714?aid=1101l9QvC
⚫ DestroyIt: assetstore.unity.com/packages/tools/physics/destroyit-destruction-system-18811?aid=1101l9QvC

πŸ“š Resources πŸ“š
⚫ Further reading on the topic: scottlilly.com/c-design-patterns-composition-over-inheritance
⚫ C# Fundamentals - Inheritance: docs.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/inheritance
⚫ C# Access Modifiers: docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers
⚫ C# Interface: docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface
⚫ C# Virtual: docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/virtual
⚫ C# Overriding methods: docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/knowing-when-to-use-override-and-new-keywords

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

⚫ Part 1 - Writing your first script
⚫ Part 2 - Loops and Arrays
⚫ Part 3 - Unity Component Lifecycle
⚫ Part 4 - Static vs Instances
⚫ Part 5 - Delegates
⚫ Part 6 - Inheritance & Interfaces
⚫ Part 7 - You are here πŸ˜‰

πŸ“± Let's stay connected
YouTube: youtube.com/c/LlamAcademy
Patreon: patreon.com/llamacademy
Facebook: facebook.com/LlamAcademyOfficial
Twitter: twitter.com/TheLlamAcademy
TikTok: tiktok.com/@LlamAcademy
Instagram: instagram.com/LlamAcademy
Compositional Relationships - Youve Already Been Using Them | Unity C# Basics 6 | #shortsGOAP Enemy AI FULL IMPLEMENTATION | AI Series 50 | Unity TutorialStatic Batching, Explained. Free, Powerful Draw Call Optimization | Unity TutorialRaycasts, Explained. Every Physics Cast in Unity Visualized #shortsUnity Navigation In 2025 - Key Components for Building Navigable WorldsNavMeshAgents & Ladders | AI Series Ep 54 | Unity TutorialCompanion AI | AI Series Part 38 | Unity Tutorial #ShortsProjectile Trajectory with Simple Math & Line Renderer | Unity TutorialCinemachine Basics - Transposer & Composer for Top-Down Object Targeting #shortsParallax Occlusion Mapping: Depth Illusion in Shader Graph | Unity TutorialGun Attachment System | Gun Series 10 | Unity TutorialEvent Bus & Scriptable Object Event Channels | Unity Game Architecture Tutorial
LlamAcademy |

Compositional Relationships - You've Already Been Using Them | Unity C# Basics 6 | #shorts

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER