See Your Project To A Cleaner Setup With The OBSERVER PATTERN

  Рет қаралды 9,409

BMo

BMo

Күн бұрын

Пікірлер
@BigScrumbo
@BigScrumbo 2 жыл бұрын
Was having trouble with the instructions from my professor, the book, and other tutorials. I come here as a last resort and I finished my project in 15 minutes. I owe you a firm handshake and a soft drink of choice.
@kitsunderedesu
@kitsunderedesu 2 жыл бұрын
This is probably the easiest to follow video I’ve seen yet on uncoupling dependencies with a concrete example, kudos.
@T3QN1Q
@T3QN1Q 2 жыл бұрын
I love observing the pattern of how many videos you have been making *snuggles*
@mandamoon9149
@mandamoon9149 2 жыл бұрын
Listen, broadcast, execute! Love this, keep ‘em coming Bmo!
@foreducation408
@foreducation408 4 ай бұрын
simple and to-the-point video tutorial, thanks for making it helped me a lot.
@aboo2423
@aboo2423 2 жыл бұрын
Its been long since i got away from unity but i can't stop watching your video and get the vibe to go back
@RaonCreate
@RaonCreate 2 жыл бұрын
Keep going with those type of vids I love them!
@FyresGames
@FyresGames Жыл бұрын
Yup very simple that way to decouple. A way to make it even safer and keeping the call private on both side is using a scriptableObject event as the middle man similare to what you did with scriptableObject variables.
@regys9521
@regys9521 2 жыл бұрын
This channel really make things easy to understand, thank you so much
@eileeng2492
@eileeng2492 2 жыл бұрын
Your hitting great points BMO Thank you
@sajadtroll9186
@sajadtroll9186 2 жыл бұрын
FINALY I CAN UNDERSTAND EVENTS! THANKS A LOT and again you are kinda Big Fitness Marshmallow ❤️
@harshavardhanpatilsp190
@harshavardhanpatilsp190 11 ай бұрын
Very good explanation.
@andyBorko
@andyBorko 2 жыл бұрын
The best explanation of observer pattern. Thanks!
@MaximumSpice
@MaximumSpice Жыл бұрын
Super simple and super clean. It's been something I've been wanting to learn but haven't got around to it yet. Think I might consider switching my current project over into this.
@techdave99
@techdave99 2 жыл бұрын
Another great video. Thanks.
@suicune2001
@suicune2001 2 жыл бұрын
Thanks! That looks really handy. I'll definitely need to practice that.
@nicolasportu
@nicolasportu 2 жыл бұрын
Cristal clear :) Advanced version looking forward. Thanks
@headed_weast
@headed_weast 2 жыл бұрын
I would like you to picture me in my best DJ Khalid voice saying “anotha one”
@woistdasniveau8290
@woistdasniveau8290 2 жыл бұрын
Nice tutorial. I love how almost everything boils down to yeah just learn it xD
@MountReal786
@MountReal786 2 жыл бұрын
Thank you for this
@322ss
@322ss 2 жыл бұрын
I usually have used empty delegate in my event (OnCoinCollected = delegate { }), so I don't have to do old or new style null checks at all.
@TheKr0ckeR
@TheKr0ckeR 2 жыл бұрын
One thing I dont understand is, in this case, Subscriber to the event still needs to know about the class that has the Action? For example, I have an inputmanager class that has action inside of it called OnTap. When subscribing, I need smth like: InputManager.OnTap += DoSomething; How would i prevent this in this case? In your example, CoinText script is still coupled with Coin script?
@luckyknot
@luckyknot Жыл бұрын
I understood the same as you. The good thing is that InputManager does not have to implement any call to any other classes, so it's doing only one thing which is good (separation of responsibilities). There must be a way to centralize all these OnSomeAction() that are scattered around in different classes and put them in a single manager class so the other subscriber classes can refer to that only class. That would be pretty neat.
@stephenkentperez7705
@stephenkentperez7705 2 жыл бұрын
if for some reason your public method needs parameters you can also pass in parameters by using a lambda operator when adding a listener: OnExecute_Event += () => { SomeMethod(paramater); };
@muhammadzubairirshad6724
@muhammadzubairirshad6724 2 жыл бұрын
Great
@zacoriot
@zacoriot 11 ай бұрын
Probbly a rookie question but: 1. Why not subscribe during Awake or Start? 2. Why unsubscrube from an event?
@Stompin40
@Stompin40 2 жыл бұрын
Exactly!!!!!!!!!
@godzillakingkongvenom
@godzillakingkongvenom 2 жыл бұрын
👍😎🤠
@stefan429
@stefan429 2 жыл бұрын
You should totally make a followup video about ran hipple's talk and implementing scriptable objects as events. theres a package already that does it called SO Architecture, maybe you can go over it, its very useful especially for newbs since they dont have to worry about subscribing/unsubscribing to events :D
@_Garm_
@_Garm_ 2 жыл бұрын
Me += OnBMo :)
@jtmcfarland3512
@jtmcfarland3512 7 ай бұрын
I understand this is "proper" and "how it's done", but I have to disagree with the philosophy. You've only managed to move the dependency from one script to another, not remove any dependencies. Also, by using events, now you've put more burden in the Update() part of your program. Events should only be used in the most demanding of circumstances and NOT every time you need one script to talk to another.
@RayHorn5128088056
@RayHorn5128088056 2 жыл бұрын
You traded one type of dependency for another. Big deal.
Rethink Everything with Scriptable Object VARIABLES
15:28
How to Program in Unity: Observer Pattern Explained
15:57
iHeartGameDev
Рет қаралды 119 М.
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН
Delegates, Events, Actions and Funcs - The Observer Pattern (Unity & C#)
11:48
Events or UnityEvents?????????
15:43
Jason Weimann (GameDev)
Рет қаралды 106 М.
Better Coding in Unity With Just a Few Lines of Code
15:27
Firemind
Рет қаралды 320 М.
How to do MORE with the Observer Pattern
13:09
git-amend
Рет қаралды 13 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 797 М.
The 6 Design Patterns game devs need?
24:20
Jason Weimann (GameDev)
Рет қаралды 377 М.
Observer Pattern - Design Patterns (ep 2)
49:47
Christopher Okhravi
Рет қаралды 577 М.
Upgrade Your Projects With SCRIPTABLE OBJECTS
8:11
BMo
Рет қаралды 7 М.
What You Need To Know About The COMMAND PATTERN
14:09
BMo
Рет қаралды 3,6 М.