Game Events - Power & Simplicity in Unity3D

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

ความคิดเห็น • 155

  • @victoraurelius5334
    @victoraurelius5334 3 ปีที่แล้ว +9

    'ScriptableObject-Architecture' - free Asset on Unity store implementing all this for you. There is only one major flaw with this pattern, which is never talked about. I learned the hard way, after implementing this in my project.
    That is, that you lose any reference-tracking with implementing this ScriptableObject event (or any other type) system.
    What do I mean with that? If you take a look again into your IDE (Visual Studio), you will notice that there is no helper for WHICH class is calling/using this ScriptableObject. It is a interface into the void.
    You are fine with 1-5 ScriptableObjects like that. But in a more bigger project, you will effectively have 100's of those, to manage your game mechanics. And will suddenly wake up in a nightmare. "Can I safely delete or modify this SO, is anything still using it?", "which systems are actually using this SO?" those will be your main concerns each day.
    I found it to be very frustrating and removed the system completely at the end.
    Just a heads up.

  • @kellyrodgers9326
    @kellyrodgers9326 11 หลายเดือนก่อน +1

    This is great stuff Jason. Your specific tutorials such as this one always help me out a lot. Your channel is great!

  • @Choco-sk2gj
    @Choco-sk2gj ปีที่แล้ว +1

    Jason, i just wanted to report back and say I used game events/Scriptable objects for the first time today after watching your vids, and also I read the article you mentioned and wow, very powerful stuff! I'm glad it totally clicked with me because the biggest thing that always seems to be holding me back when i tried any game engine, is getting all the parts to communicate properly without errors or bugs, to the point where it actually overwhelmed me more than anything.. and finally i feel i've found a way to build my games that really suits me and won't have me pulling my hair out thanks to your videos! I just got up and legit cheered when I just had an event easily do everything i wanted it to do, felt so good! Multiple features in my game just got added within 20 minutes because the only solution i needed was a way for the parts to communicate as some were not.
    That article is fantastic too the way it breaks down the sword data and what not, thats a great example to refer to. I think a lot of people are like me where even though they may be somewhat new to programming/Unity, they can actually code stuff they need to make or always find a way but they just suffer with the fundamentals like how to get parts of the game to communicate easily without running into walls, more people need to see these videos and be aware of Scriptable Objects and Events and how they can tie together. I feel more free now to make my game.

  • @ivandamyanov
    @ivandamyanov 3 ปีที่แล้ว +13

    I have a playlist with game dev tutorials for when I get deeper into a project and i bump into problems / want to improve performance and so far your channel totally dominates said playlist. Literally the best programming channel for game makers! Sincerely thank you man.

    • @saqibbro5297
      @saqibbro5297 2 ปีที่แล้ว

      Wanna share the Playlist :) Plz

  • @peterhou7717
    @peterhou7717 3 ปีที่แล้ว +34

    Very interesting. I work with designers a lot, but never thought of exposing events to them like this. Thanks for sharing.

  • @iDerp69
    @iDerp69 3 ปีที่แล้ว +53

    I use a similar pattern with C# Action delegates for blistering fast performance and ease of communicating across scripts in my project.

  • @joliveres
    @joliveres 3 ปีที่แล้ว +24

    0:23 Getting fancy with the editing there!

  • @szaaary
    @szaaary 3 ปีที่แล้ว +2

    I didn't appreciate the events until I had to turn my 3d game into d2. Swapping scenes, collisions etc. I was downright shocked at how easy it was for me. Most of the logic was based on them. And this is just lvl 2 of this :D It's great.

  • @UnfamiliarLandsGame
    @UnfamiliarLandsGame ปีที่แล้ว

    Thank you for this video. It really simplifies triggering actions between scripts a ton.

  • @fernandoz6329
    @fernandoz6329 3 ปีที่แล้ว

    Clever Code. It takes little effort to understand and it takes you to another level. Awesome.

  • @michelcastilho6862
    @michelcastilho6862 ปีที่แล้ว +1

    In the EvenListener I've changed UnityEvent to UnityEvent and I pass a string on Invoke, so I can use it on whatever function UnityEvent calls. In the editor, when I add my desired function to the UnityEvent list on the Event Listener element, I can see that it shows as Unity Event (string) and the string field is available, but it doesn't receive the value I passed on Invoke and the function throws an error because the string is empty, even though it was correctly passed on Invoke. Help?

  • @Ryan-ww7un
    @Ryan-ww7un 3 ปีที่แล้ว +2

    Incredible timing! I started learning about the observer pattern and C# delegates yesterday!

  • @sqwert654
    @sqwert654 3 ปีที่แล้ว +2

    Brilliant having moved back to Unity from UE recently. This technique will keep me working my core game mechanics rather than working on say dissolve mesh effects before the core game is done :)

  • @asafbenjaminov2635
    @asafbenjaminov2635 3 ปีที่แล้ว +2

    Great video thank you very much!
    Id like to ask what happens when you need to pass some parameters for the unity event?

  • @geri4367
    @geri4367 3 ปีที่แล้ว +5

    OG Jason is back!!! Love this kind of content

  • @dominikpotulski576
    @dominikpotulski576 3 ปีที่แล้ว +16

    Hey, super video.
    I actually already implemented this system into my game but I have problem when it comes to connecting other systems and monobehaviours together. As a solo developer I can't really tell where the line between design and programming is. What I mean is that I don't know what to connect through code and what to connect via an event system.
    Because I code since 9 years and I got into game development only last year, my immediate intention is to hook everything up through code but this obviously leads to said problems and I would need to do a rewrite every time I would like something to get changed. On the other hand, if I connect all those system together with an event system, it's not written down, can be forgotten, etc., like the other Jason said in the last game dev talk of yours.
    It would be incredibly helpful if you could make a followup video where you name some guidelines and tell us about your experiences with connecting systems. I think many solo devs and small teams would learn a lot about how to structure their game robustly while keeping the needed work low to change and / or add something new to their project.

    •  3 ปีที่แล้ว +1

      IMO the line should be where it affects your business logic. Anything affecting business logic should be in code so that you can track it through your IDE, git and verify in unit tests. If it only affects a view (spawn particles, show texts or effects) then you could use the method shown here. That is if you're a professional who wants to build scalable systems of course. If you're just experimenting, learning and having fun then this can be a quick way to iterate.

  • @MarkRiverbank
    @MarkRiverbank 3 ปีที่แล้ว

    I use UnityEvents or standard C# events frequently. It took me a moment to understand what you’re doing here moved the editor configuration to the listening object rather than the sender, which makes a lot of sense from the design side.

  • @leohunter5360
    @leohunter5360 2 ปีที่แล้ว

    Appreciate the fact that you explained every little thing that you were doing. Good job!

  • @thewolfman4453
    @thewolfman4453 3 ปีที่แล้ว +5

    Thank you! Can you make tutorial about sending through this game events parameters to listeners?

  • @mikogronroos4050
    @mikogronroos4050 3 ปีที่แล้ว +6

    how would you go about adding different parameters?

    • @matthewrye3156
      @matthewrye3156 3 ปีที่แล้ว +3

      Yeah, like in this example telling the listeners which enemy died.

    • @willpetillo1189
      @willpetillo1189 3 ปีที่แล้ว +2

      I have some examples here: github.com/Will9371/Character-Template/tree/master/Assets/Playcraft/Quality%20of%20Life/UnityEvent%20Helpers/Observer

  • @Chronomatrix
    @Chronomatrix 3 ปีที่แล้ว +61

    Game programming is truly overwhelming, I'm currently trying to learn patterns like factories, observers, commands, adapters, etc. and there's always something new popping up. Just learned about abstract classes and invokes and now here comes game events, and I know it's just the beginning! Does it ever end? I find most of this stuff really hard to learn without real examples of how to implement them, and it gets even harder when you try it yourself on more complex features. All this knowledge is insanely fragmented into hundreds of courses, books and youtube tutorials. How do most people learn about all of this?

    • @franciscokloganb
      @franciscokloganb 3 ปีที่แล้ว +21

      None of the mentioned concepts are particular to game development; Most of the concepts you mentioned are just typicall programming things you learn as you go. The more you program the more you learn, but eventually you get to a point where you must accept you can not know it all. It is often more important to know a certain tool exists and use it when it is needed. :)

    • @MohanABK
      @MohanABK 3 ปีที่แล้ว +8

      I'm glad you think this way. This is the life of a programmer. And you're just talking about game development; it's even grander of a field when you want to study overall programming for all things. This is why this field is popular and lucrative. It's large and there's a lot of skills and things to learn.

    • @thejamesgreensill
      @thejamesgreensill 3 ปีที่แล้ว +2

      It gets alot easier with practice. (as does anything). Sometimes it can take minutes to understand something and sometimes it can take weeks to fully understand how to implment a complex system, algorithm or pattern. But as you grow as a programmer it will become easier, also don't stress about memorizing things you can just google and make sure you use your resources avaliable to you in order to learn.

    • @Rhysman30
      @Rhysman30 2 ปีที่แล้ว +4

      Years of practice, broski! I've been at game programming (modding) since i was a teenager, unity for the last 4. Every day I learn something new. You're actively looking for best practices though, so you're already 10 years ahead of me. Keep at it, it gets easier.

    • @callmedeno
      @callmedeno 2 ปีที่แล้ว +3

      You don't need all that design patterns bullshit, especially when you're building games that you don't even know how they will work or will even be fun, especially prototypes. At most I'd say the observer pattern is all you need to know just to understand events, one afternoon to get acquainted with it and yer done. Write the program

  • @rorychockman1052
    @rorychockman1052 3 ปีที่แล้ว +1

    I like editing in this video, all you need is sound effects and your done!

  • @Asylum3D
    @Asylum3D 3 ปีที่แล้ว

    This is cool. Another chunk tip/trick to throw in my bag of goodies! Thanks for all of these videos. It makes a big difference for us.

  • @matounette6667
    @matounette6667 3 ปีที่แล้ว +4

    Really interesting. I like how well it is explained and is not only for advanced users (explaining quickly each concept). Thanks!

  • @MegaBoxer1314
    @MegaBoxer1314 3 ปีที่แล้ว +1

    This is a really useful system. I first seen it used from a Unite talk on scriptable objects.

  • @joepace1826
    @joepace1826 3 ปีที่แล้ว +14

    Would you consider making a series where you play a game (finished or not) find bugs and go through how you would fix them?

    • @fo4357
      @fo4357 3 ปีที่แล้ว +3

      That would be super useful!

    • @11sveden12
      @11sveden12 3 ปีที่แล้ว +5

      Haven't seen the whole thing myself but I think some of this might be done in his Code Review videos. There's at least 3 of them, possibly more. I would check those out.

  • @DePistolero
    @DePistolero 3 ปีที่แล้ว

    Hey, thanks for the hashset tip, will change that, I actually use the same workflow for my game architecture, it is insanely modular, quick to develop and a bit of a pain to debug sometimes,
    I just recently put all the events in a singleton class, so they can be easily invoked from any script, and a bit easier to find references and debug, and you avoid extra work for classes that have to invoke event, no inspector references( granted, that has drawbacks, if changing scenes, but is easily worked around )
    Also naming convention must be respected here, when it comes to events and methods that are calling them.
    As an extra, I made the editor script dropdown that lets you choose what type of an event you want the newly created event to be( empty, vector3, int... whatever, it just lists game event methods ) So each listener, will display only calls that assigned event has.
    Also added to this is a default event to call, just an empty event, in case of gamesuccess, and gamefailed, there is an default event game completed, that always triggers in both cases. very useful. Delay is the same with coroutine, but each event call method has a condition if delay is > 0 start coroutine and fire the event after the delay, don't have delayed event and regular.
    Drawbacks to all this, bit harder debugging, a lot of references in inspector, but if you put on each event listeners list, it also becomes a bit easier.
    Pros: insane modularity, flexibility, development speed, and development agility, keeping things very orthogonal.
    that GDC was mindblowing, I am also using all the time those reference fields, that accept either scriptable object value, or just regular value, pure gold this all is.
    I wouldn't want to develop in any other way honestly... Thanks for the tutorial.

  • @erickmarin228
    @erickmarin228 2 ปีที่แล้ว

    This is a great way to implement the observer pattern. Thanks for sharing !

  • @ViciousProgressor
    @ViciousProgressor 3 ปีที่แล้ว +1

    This is a great technique; thank you for sharing it! I appreciate the way you frame explanations of a system with potential use cases and intent. It makes things very clear and straightforward.

  • @drakorez
    @drakorez 3 ปีที่แล้ว

    This is very helpful. thank you. I am new to Unity (came from UE4) and I did not even know that there was a "Unity Event" variable I could use like that. I will be using that in my game for sure.

  • @sytix1
    @sytix1 3 ปีที่แล้ว +1

    Cool. I don't see how I can apply to my game now, but I've learned more about the SO and the UnityEvents.

  • @hugogogo13
    @hugogogo13 ปีที่แล้ว

    Awesome video and awesome trick for decoupling relationships. Thank you 🙏

  • @ulissesnascim
    @ulissesnascim 3 ปีที่แล้ว +6

    Can you do one with parameters?? I've solved that myself but would love to see your approach.

    • @nixellion
      @nixellion 3 ปีที่แล้ว +1

      Could you share how you solved it, please?

    • @ulissesnascim
      @ulissesnascim 3 ปีที่แล้ว +3

      @@nixellion sure. I created a SetParameters(List parameters) method in the gameEvent. The method updates a local list of parameters in the gameEvent and holds it until the next Invoke. This means that extended gameEventListeners will be able to read that updated list and do stuff with its information if the correct variable types were passed. So a GameEventListener_FloatParameter would be able to read a float from the list and supply the underlying methods with the float.
      There are some clear disadvantages, but I've been able to do a lot with this so far.

    • @nixellion
      @nixellion 3 ปีที่แล้ว +1

      @@ulissesnascim Thanks! Thought it should be something like that. Will be incredibly useful!

  • @sadiqabbaszade4789
    @sadiqabbaszade4789 3 ปีที่แล้ว +4

    What about sending data when we invoke events? As far I as remember unity events with generic types can not be serialized (may be they changed in 2020 idk)

    • @zionen01
      @zionen01 3 ปีที่แล้ว +1

      It's definitely do-able. My implementation has a base class :
      public class GameEvent : ScriptableObject
      {
      //same as game event but with T
      }
      Then you would have (int example) :
      public class GameEventInt : GameEvent { /* EMPTY */ }
      This becomes more powerful when you don't use primitive types and instead use complex types, especially a base class and inheritance to add data.
      UnityEvents support one argument so that works nicely, you can drag the GameEventInt to a UnityEvent that has an int argument for example. Works fine.
      Challenge comes when you want one event to call specific listeners based on the gameObject to support one event for multiple prefab instances, this is also do-able and goes something like this:
      public class GameEvent : ScriptableObject where T: FSMData
      {
      private readonly Dictionary _actions =
      new Dictionary();
      ...
      }

    • @sadiqabbaszade4789
      @sadiqabbaszade4789 3 ปีที่แล้ว +1

      @@zionen01 wow thats actually a piece of code in the reply lol. Thanks. Yeah I figured out I can just pass eventargs class as a parameter (wrapper class to serialize unity events but thats fine). But instead of creating new classes for every other event args type, I will simply either put them into one class, or use inheritance and downcast the data in listener. Hope it makes sense.

  • @lcd11001
    @lcd11001 2 ปีที่แล้ว

    (14:19) we can use base.RaiseEvent() inside the override method, right? and the variable _unityEvent still in private

  •  3 ปีที่แล้ว +5

    You make a huge difference in my life as a developer. When I finish some games and start making money with it I'll definitely become a Patreon. Thanks for the videos!

  • @mlanc7775
    @mlanc7775 3 ปีที่แล้ว +1

    Why is it every video I watch about events.. it's totally different?
    What's the difference between this and using a monobehavior EventManager that uses public event Action onAction? Seems like people have so many different ways of using some Event System and they are all different.. unless using the UnityEvents system.

  • @JoshLmoa
    @JoshLmoa 3 ปีที่แล้ว

    Thanks a lot for all your videos. I'm in a 2 week isolation and binging the hell out of your content to fill by goopy brain with knowledge.

  • @tofusoup999
    @tofusoup999 ปีที่แล้ว

    This is very helpful.If I need the same event to accept different parameters, what should I do?

  • @yusufalibrahim1994
    @yusufalibrahim1994 3 ปีที่แล้ว

    Hey Jason, your videos are awesome. Using dark mode will make our eyes healthier!

  • @LeFede
    @LeFede ปีที่แล้ว

    Why would you use Hashmaps instead of UnityAction ?

  • @motifgaming2080
    @motifgaming2080 3 ปีที่แล้ว +1

    The only issue with this is whenever the referenced script is removed or moved from the Gameobject. The Unity event loses the reference and will just show an empty slot.
    If we take the same example as in the video, if someone decides to recreate the text object by deleting it for some reason. It gets hard in the bigger project to realize what the Unity event was holding the reference of.

  • @eqapo
    @eqapo ปีที่แล้ว

    How would you extend this to pass data through the .Raise(eventArgs) ?

  • @FyresGames
    @FyresGames 2 ปีที่แล้ว

    Oh wow. That's great. How do you set up multiples scenes in the hierarchy like this? Look great to disable in one click the whole UI to work on the scene.

  • @sergeistarovoitov7663
    @sergeistarovoitov7663 6 หลายเดือนก่อน

    I have an issue in a build with that approach. Garbage collector cleans a HashSet in SO during loading a scene:
    Registering listener: PlayerPopupsUI to event: AnimationFinished_IntroScene; Total listeners: 3
    Registering listener: SceneManager to event: AnimationFinished_IntroScene; Total listeners: 4
    Unloading 1575 unused Assets to reduce memory usage. Loaded Objects now: 37889.
    Total: 17.566200 ms (FindLiveObjects: 1.458500 ms CreateObjectMapping: 0.920200 ms MarkObjects: 12.912100 ms DeleteObjects: 2.275000 ms)
    Registering listener: SALSA_Player to event: AnimationFinished_IntroScene; Total listeners: 1
    Invoking event: AnimationFinished_IntroScene on listener: SALSA_Player
    So only instantiated objects work correctly. In the editor, there is no such issue

  • @alextreme98
    @alextreme98 2 ปีที่แล้ว

    Big thanks for this implementation. I was curious about the event scriptable object to use it as an architecture for the game 😁

  • @avinnaidu2022
    @avinnaidu2022 2 ปีที่แล้ว

    Thanks for the video! BTW, @Jason Weimann - might be really random but what are those tile lights you are using? >

  • @pixelpat777
    @pixelpat777 3 ปีที่แล้ว

    @Jason Weimann Great video, The OnMouseDown() is not working for me, i have it on my player character and i have a 2D capsule collider.

  • @_ian_
    @_ian_ 2 ปีที่แล้ว

    Thank you Jason, I like this and use these a fair bit, they are very handy when you want to step back a bit from the code and think like a designer. But is there a way to inject the event name into the title bar of the component (in the Unity Inspector)? that way when I have many collapsed components listening to different game events, they'd be easy to tell apart. Currently I just see "Game Event Listener" for each of them. Thanks!

  • @jovarus
    @jovarus 3 ปีที่แล้ว

    Seems like a great tool for updating my ui panels on certain events like updating currency display.

  • @Drastonar
    @Drastonar 3 ปีที่แล้ว

    I've been using game events for a while now, never thought of making a delayed listener, I used to code a monobehaviour that would do my action with delay and call this function on the listener

    • @matthewrye3156
      @matthewrye3156 3 ปีที่แล้ว

      Your way actually sounds more modular and flexible.

  • @6bytes
    @6bytes 3 ปีที่แล้ว

    Good timing! I had this exact problem moments before this video was uploaded : )

  • @mirtzata
    @mirtzata 2 ปีที่แล้ว

    Can you implement the similar concept but with actions that can pass int,string,bool?

  •  3 ปีที่แล้ว +1

    Man I love your videos. Thanks for existing

  • @yellowmarschmallow4102
    @yellowmarschmallow4102 3 ปีที่แล้ว +3

    Agree 100%! I've built my game using Scriptable Objects with events extensively and it saves you so many headaches! Everything is much better separated and can still tightly work together.

  • @songhaoli304
    @songhaoli304 3 ปีที่แล้ว

    If we consider this method as a decentralized event system. How does it compare to a centralized one. For example, a central event system class owning all the events.

  • @containedhurricane
    @containedhurricane 3 ปีที่แล้ว

    What about the memory garbage generated by Unity Events in the architecture?

  • @lambjalfrezi
    @lambjalfrezi 3 ปีที่แล้ว

    What would be a good way of extending this to allow the Invoke method to take arguments?

  • @TheMuckGames
    @TheMuckGames 3 ปีที่แล้ว +1

    Nice video! I tried something like this before. But at some point, I lost the overview, which events fired/registered from which objects. Did you have a solution for it?

  • @Senkh
    @Senkh 3 ปีที่แล้ว

    Really looking forward to the other things you will suggest doing with scriptable objects :)

  • @Atezian
    @Atezian 3 ปีที่แล้ว

    how would you pass a float from the object raising an event to the object receiving the event?

  • @EnderElohim
    @EnderElohim 2 ปีที่แล้ว

    Saying no is easier option and work perfectly fine XD

  • @gadgetboyplaysmc
    @gadgetboyplaysmc 3 ปีที่แล้ว

    This is amazing. Definitely upload more amazing programming practices

  • @averydee5328
    @averydee5328 2 ปีที่แล้ว

    Thank you so much, my code is so much more flexible now. God bless.

  • @kmud7750
    @kmud7750 3 ปีที่แล้ว +1

    Awesome video! I love using this! How do you approach finding all the references in code when you run into trouble?

    • @BenVanTreese
      @BenVanTreese 3 ปีที่แล้ว

      If you just mean finding the game event listener objects in scenes, you can search the hierarchy with a monobehaviour name and it will filter to the objects with the named behavior attached.

  • @Atezian
    @Atezian 3 ปีที่แล้ว

    Holy smokes this is going to make everything much quicker. Thanks Jason.

  • @callmedeno
    @callmedeno 2 ปีที่แล้ว

    hmm I'm wondering, is there any way to modify this so that you can pass data with the event or is it really only for events without parameters?

    • @Unity3dCollege
      @Unity3dCollege  2 ปีที่แล้ว

      Definitely! Ryan h talk.on it shows that really well. May make a followup to this showing how as well

  • @soma78
    @soma78 2 ปีที่แล้ว

    Anyone else getting this error in the GameEvent.cs script ?
    "The type or namespace name 'GameEventListener' could not be found (are you missing a using directive or an assembly reference?)"

    • @dewaldbotha6390
      @dewaldbotha6390 2 ปีที่แล้ว

      Im having that same problem.

    • @dewaldbotha6390
      @dewaldbotha6390 2 ปีที่แล้ว +1

      Seems we should finish watching then do the code 🤣🤣🤣

    • @soma78
      @soma78 2 ปีที่แล้ว

      @@dewaldbotha6390 haha, fair enough !

  • @JayadevHaddadi
    @JayadevHaddadi 3 ปีที่แล้ว

    Question: In the GameEventListener class you have one SerializedField called _unityEvent that is just a UnityEvent, but in the inspector it looks like it is a list/array of events. Is that just how events are, that they can always be added as many instead of just one?
    Thanks Jason👍😊

    • @wisher77
      @wisher77 2 ปีที่แล้ว +1

      You can give a UnityEvent multiple things to do when it's called.
      So yes they are always like that

    • @JayadevHaddadi
      @JayadevHaddadi 2 ปีที่แล้ว

      @@wisher77 Thanks Wisher for your patience and willingness to answer my newbie question :))

  • @saltyman5603
    @saltyman5603 3 ปีที่แล้ว

    Genuine question: Why would I want to use this method instead of just programming a singleton and casting to a specific function on it? It does the same thing and uses 1 less script.

  • @buffalobuffalogaming
    @buffalobuffalogaming 3 ปีที่แล้ว

    You have saved me from tons of problems. Thanks!!

  • @leandro_damasceno
    @leandro_damasceno 3 ปีที่แล้ว

    Thanks for the lesson, Jason!

  • @DustVoltrage
    @DustVoltrage 3 ปีที่แล้ว

    Looks great, thank you Jason !

  • @MrSmoofist
    @MrSmoofist 3 ปีที่แล้ว

    Works like a charm! But I want to challenge this system: what if I'm making a card game, and use this to make sure each card has its own unique event when dropping on the enemy. How do I make it pick the right game event each time and the right effect to call as well?

  • @anommymousse1224
    @anommymousse1224 3 ปีที่แล้ว +3

    My heavily interconnected character selection screen with unlocks using some questionable parenting of objects thanks you in advance. Time to refactor and unlink that rats nest!

  • @willygamedev8144
    @willygamedev8144 3 ปีที่แล้ว

    Is it an implementation of the observer pattern?

  • @MatthewAWinston
    @MatthewAWinston 3 ปีที่แล้ว +2

    More excellence! Thank you!

  • @pmoneyish6869
    @pmoneyish6869 ปีที่แล้ว

    It would be nice if registered methods to the game events could be IEnumerable and fire them off as coroutines.

  • @Dover8
    @Dover8 3 ปีที่แล้ว

    I approve of the tutorial reference :]

  • @KBforJesusChrist
    @KBforJesusChrist 2 ปีที่แล้ว

    I'm a beginner and I'm trying to understand how shop system work I haven't found a good tutorial on it, please explain to me how shop system work like u but skins or items and it appears in game how do I integrate it in any game explain they key codes for shop system how it changes game objects please

  • @disobedientdolphin
    @disobedientdolphin 2 ปีที่แล้ว

    Would have been nice to just add a link to that tutorial in the description

  • @goehlergamedev
    @goehlergamedev 3 ปีที่แล้ว

    Do you use this instead of regular C# event Actions?

  • @goldone01
    @goldone01 3 ปีที่แล้ว

    This is awesome - thanks for the great video!

  • @OutBreaker13579
    @OutBreaker13579 3 ปีที่แล้ว

    wouldn't it be better to use an interface for the advanced usages instead of deriving from the base class?

  • @questionsbrown7985
    @questionsbrown7985 3 ปีที่แล้ว

    The game event listener with delay is not working for me! Anyone else have that problem?

  • @albertolameira5224
    @albertolameira5224 3 ปีที่แล้ว +2

    awesome video once again :)

  • @ИбрагимИванов-э3р
    @ИбрагимИванов-э3р 3 ปีที่แล้ว

    Nice trick. I do not like to use events, but maybe I try it one day.

  • @heckensteiner4713
    @heckensteiner4713 2 ปีที่แล้ว

    I love the beginning of your videos when you're explaining the concepts, but the second you open the text editor with the code I'm like 😵‍💫. Guess that's why I'm an artist and I'll never be able to program. It's like hieroglyphics to me.

  • @StevenBloomfield
    @StevenBloomfield 3 ปีที่แล้ว

    What's on your hoodie?

  • @Whaiitran3106
    @Whaiitran3106 3 ปีที่แล้ว

    hey Jason, by the way... what is the font you are using in your editor?

  • @Ferenc-Racz
    @Ferenc-Racz 3 ปีที่แล้ว

    Thank you very much. Your videos always useful and there is always to learn.

  • @icon8391
    @icon8391 3 ปีที่แล้ว +2

    Thanks for the tutorial

  • @abo1428
    @abo1428 3 ปีที่แล้ว

    Habe you changed something with your camera setup? Looks much better! 👌🏻

  • @zipzorp8858
    @zipzorp8858 3 ปีที่แล้ว +1

    I am confused. He describes this Game Event as something that doesn't need to be referenced, yet he references it anyway (6:52). I'm confused by most of this. I think I understand the general idea, but the explanation of the scripts is bonkers over my head.

  • @kiririn39m8
    @kiririn39m8 3 ปีที่แล้ว

    Now, how about creating swappable Sprites themes/Text/Colors etc.
    On Start it starts listening for a sprite with specific id/guid/alias etc from a data cache(scriptable object). And when some one(a button for instance) wants to change color palete or sprite theme it gives a new set of data(sprites or something) to this cache, cache updates existing aliases with new data set and invokes update on listeners. Thats it. Imagine complex UI or localized text acros different scenes that can be updated by a single button click without explicit references to monobehaviours or prefabs(it can be found by cache itself or use reference to singleton cache)!
    In simple words: Cache is observer, SpriteChanger is listener, and player clicked button is actual event invoker

  • @kristoferknutsen5334
    @kristoferknutsen5334 3 ปีที่แล้ว +1

    Another option, visual scripting? :)

    • @Unity3dCollege
      @Unity3dCollege  3 ปีที่แล้ว +1

      Prepping a video on that

    • @kristoferknutsen5334
      @kristoferknutsen5334 3 ปีที่แล้ว

      @@Unity3dCollege awesome, pretty cool that Bolt is now a part of Unity, and in Unity 2021 it is changed to VS, so they have fully integrated that.
      I'm actually writing my BA's thesis right now about Visual scripting in game development 😊

  • @MaximumSpice
    @MaximumSpice 3 ปีที่แล้ว

    Very clever, love it

  • @winxalex1
    @winxalex1 6 หลายเดือนก่อน

    Creating manual events only if needed and most of the time use modified Unity Event editor. Instead of creating tons of Scriptable objects per event, create Scripable object per topic with list of events. Then refrence where you need it. Main problem with events after time you forget where they are and hard to test if you dont' have something visually like this th-cam.com/video/e_ygMVFhKWs/w-d-xo.html

  • @Skdbszksixh
    @Skdbszksixh 3 ปีที่แล้ว +1

    Thanks for the video ^^

  • @Games-ew9sp
    @Games-ew9sp 3 ปีที่แล้ว

    awesome stuff thanks