Patterns - Observer (Unity) - 14

Published: 28 November 2025
on channel: RDragon
251
18

Programming Study Group -   / discord  

My IT music channel - https://youtube.com/@RDMusic76-t9u?si...

My gaming channel -    / @rdgames-j7s  

Design Patterns: Observer in Unity and C#
​In this video, we explore one of the most popular behavioral design patterns—Observer. You'll learn how to eliminate rigid dependencies between classes and make your project architecture more flexible and extensible.
​In this episode:
​Real-Life Analogy: How a Newspaper Subscription Works and Why It's a Perfect Example of Observer [00:09].
The "God Class" Problem: A Bad Example of Item Lifting in a Game, When a Single Class Knows About All Services (Sound, UI, Quests, Effects) [01:11].
C# Implementation: Why the Standard Event and Delegate Are the Observer Pattern Out of the Box [03:20].
Classic Pattern: ISubject and IObserver Interfaces, Attach, Detach, and Notify Methods [04:09].
Modern Approaches in Unity:
Using Static Events (and Their Drawbacks) [05:41].
Implementation via Scriptable Objects (Event Channels) – Pros and Cons [10:55].
Dependency Injection via DI Containers (VContainer/Zenject) for Subscription Management [12:37]. What's up with UniRx? Why classic UniRx is considered obsolete and what's worth paying attention to today (R3 library) [09:59].
​The main advantages of the pattern:
​Low Coupling: Objects don't directly know about each other.
​Single Responsibility: Each class is responsible only for its own logic.
​Scalability: It's easy to add new listeners without changing the sender code.


On this page of the site you can watch the video online Patterns - Observer (Unity) - 14 with a duration of hours minute second in good quality, which was uploaded by the user RDragon 28 November 2025, share the link with friends and acquaintances, this video has already been watched 251 times on youtube and it was liked by 18 viewers. Enjoy your viewing!