C# Events & Delegates

Sdílet
Vložit
  • čas přidán 29. 08. 2024

Komentáře • 229

  • @xxxgames7458
    @xxxgames7458 Před rokem +2

    Why am I understand this now after so much studying?? Damn hell . Bless man

  • @andreasmetz2438
    @andreasmetz2438 Před 2 lety +6

    This was definitely the most compact and best explanation of events that I've heard so far.

  • @GameDevNerd
    @GameDevNerd Před 2 lety +1

    A delegate is literally a fancy, managed wrapper for a function pointer. You can even obtain a function pointer from native code and marshal it into a C# delegate, then pass that delegate around and call it just like any other delegate. This can also work in reverse. Under the hood, a delegate _is_ a function pointer, it just uses a different declarative syntax and hides the actual address and other complexities from you so it can be used more intuitively.
    I manually declare delegates sometimes, but many of the most common signatures you'd want to use already have a predefined version like a delegate void with no parameters or several parameters can be declared with Action and Action and when you want to return stuff there's Func and Func (there's variants with numerous parameters like T1, T2, T3, etc). That covers a _lot_ of delegate usage, and it's hard to think of some it won't cover. So why ever declare your own? Well, for intuitive and expressive naming, of course! It can clearly express your intent as a programmer and also make things a bit more type safe. You may not want to use Action for an event representing two totally different things so no one can confuse the two and create hidden bugs that can be hard to find. If it just uses an Action or Func, you can easily have another programmer mix stuff up and have criss-crossing events creating undesirable or fatal behaviors. But if you have two types of delegate clearly named things like _MenuActionDelegate_ and _KeyInputDelegate_ it gets much harder to confuse those things or use the wrong thing! That's a pretty contrived example, but in a real project you'll see how that makes sense if you think about it ...
    So, sometimes, it's actually kind of _smart_ to manually define a custom delegate, even if that signature is already defined by built-in ones like Action or Func. Keep in mind, there's _nothing_ special about Action or Func, they're just common delegate declarations exactly like the ones we declare ourselves. Many people don't know this and think those are some kind of special classes with their own fancy code but they're not. This is literally the definition of Action, as follows:
    public delegate void Action(T obj);
    That's it! That's the entire definition/implementation of Action, just a common delegate with one generic parameter. Nothing special about it other than what the .NET Framework does beneath the hood with _all_ delegates we declare. Microsoft just included these built-in delegate definitions so we'd all have predefined ones that cover almost all the use cases, so we wouldn't have to waste time or add clutter to code if it didn't make any sense to. If I want to quickly use a delegate in one place in my app and be done with it, I'd hate to have to stop and decide where I should go define a delegate signature and then come back to my method I was working on and use it ... much easier to just use a Func or something as a temporary use delegate. But anytime I'm creating something like a custom event system that's consumed from other classes, I do take the time to define my own custom delegates for the sake of clarity and expressiveness ...

    • @GameDevNerd
      @GameDevNerd Před 2 lety

      P.S. - As always, enjoyed the video and enjoy throwing in my two cents on these topics. It's refreshing to see someone teaching important C# fundamentals and good practices in the Unity world, as there's so much awfulness out there, haha. I share these videos with junior devs on our team that are curious about the topics and want additional information and they enjoy these too! 🙂

    • @Tarodev
      @Tarodev  Před 2 lety +1

      Amazing write up Aaron!

    • @notrhythm
      @notrhythm Před 9 měsíci

      im a bit confused. "So why ever declare your own? for intuitive and expressive naming" couldn't you just use the predefined types but name it something that wouldn't cause confusion?
      eg. public event action MenuActionEvent;
      i dont see the need to declare your own delegates if the predefined ones fit your need

  • @windup247
    @windup247 Před 2 lety +2

    So many people sound like they're just reading from the docs when teaching something. I'm always amazed at how you DON'T do this, but really deliver the material in an understandable way. Brilliant video.

  • @muddrosal8065
    @muddrosal8065 Před 2 lety +2

    I've been trying to understand exactly what a delegate is for far longer than I would like to admit.
    This clear and concise example at the start of the video just made it straight up obvious.
    Thank you!!

  • @cobrauf
    @cobrauf Před 2 lety +1

    This is hands down the BEST video on events/delegates in Unity.

  • @aliengarden
    @aliengarden Před 5 měsíci

    This video (and channel) is an absolute gold mine. I really wish this was explained like this to me earlier, it's so clear now. Thanks for taking the time to put this together, I will recommend this video to any confused beginners I might encounter along my way.

    • @Tarodev
      @Tarodev  Před 5 měsíci

      You're more than welcome :)

  • @josephramos6939
    @josephramos6939 Před rokem +1

    I love that you used real world practical gaming examples. Sometimes I learn about these new programming concepts but its not clicking why I would use them.

  • @simonwahlstrom1296
    @simonwahlstrom1296 Před rokem +5

    This should have a million views. Your channel is amazing. Thank you so much for everything you are doing and for the quality of your content!

    • @Tarodev
      @Tarodev  Před rokem +1

      Thank you for the kind words Simon 🙏

  •  Před 7 měsíci

    Loved that this is one of the first videos about events that the person mentions the downside of events/decoupling, which is lack of clarity, and harder debugging, so it's something to definitely use with caution, especially the "static" version of it, since you now can subscribe from literally any script without even holding a reference to a specific instance. Really nice video!

  • @anna_silver_moon
    @anna_silver_moon Před 2 lety

    The addition at the end of the video from the next day is just super useful!👍

  • @robertquayle6945
    @robertquayle6945 Před 2 lety +1

    I'm not a religious man but, God bless you for this video. Thank you.

    • @Tarodev
      @Tarodev  Před 2 lety +1

      Thank you for the blessing. I can feel the warmth of it now (probably the sweltering Australian heat though)

  • @baoinh2968
    @baoinh2968 Před rokem

    thankyou so much! You are one of the few people on CZcams teaching Unity that I can understand

  • @nomorecookiesuser2223
    @nomorecookiesuser2223 Před 6 měsíci

    You've gotta love it when someone Really knows the subject matter, and how to relay it. That was an excellent explanation, thank you. You are a step above the other 'monkeys' :D

  • @GoldenWind
    @GoldenWind Před rokem

    Hi thank you for such a clear and whide explanation of the topic! good luck with your future content!

  • @mrstruijk
    @mrstruijk Před 2 lety

    Thank you Taro! You’re the first one I met in 4 years of dev who explained delegates, func, and actions clearly and succinctly

    • @Tarodev
      @Tarodev  Před 2 lety

      That's high praise 😊 tha ms maarten

  • @reggieisnotadog4841
    @reggieisnotadog4841 Před 10 měsíci

    Well damn I wish I'd seen this years ago. I know how to use delegates but did not know that simplified way of writing them as Actions and static actions. Thanks!

  • @seanloughran6714
    @seanloughran6714 Před rokem

    Your videos are better than Google. Quick, straight to the point with immediate examples. Thanks again!

    • @Tarodev
      @Tarodev  Před rokem

      That's some heavy praise

  • @joshuasanjuan3352
    @joshuasanjuan3352 Před 2 lety

    Of all the videos that discussed Events and delegates, yours is the most clear and concise. Good Job!

  • @alfonzo6320
    @alfonzo6320 Před 2 lety

    2:06 i was waiting for it and i'm very satisfied!💯

  • @nikunev
    @nikunev Před 2 lety

    There are 2 reasons why I use more rarely (static) events: the subscribing/unsubscribing part and the "voyeur"-ability this functionality gives - everyone can subscribe, also he can subscribe redundantly, but I don't want that! I want to limit access and know exactly who gets triggered and who listens - you clearly state it in the video => REDUCED CLARITY! (bravo for giving Pros and Cons on the concept!!!)

  • @konstantin9484
    @konstantin9484 Před 2 lety

    Was just researching how Events work to implement a scoreManager using events. This was really helpful, thank you!

  • @Drrobverjones
    @Drrobverjones Před rokem

    I've used delegates in my game mixed with interfaces to change the functionality depending on interactions. It's been super useful to allow my function to change and be called without me having to worry about what it is actually calling.

  • @SuperTungbi
    @SuperTungbi Před 2 lety +3

    love this content, please do a series about SOLID in unity with details, thank you so much for your work

  • @KVBA
    @KVBA Před rokem

    I already knew plenty of things about C#, but i could never wrap my head around how delegates work. Your video made it clear to me.
    Also, static events seem really useful for my stuff, and i cant really tell why i havent learned them before.
    Thank you! Best wishes!

  • @leadtoexemplify
    @leadtoexemplify Před 11 měsíci +1

    It’s impressive to see how fast your brain works 👍

  • @anna_silver_moon
    @anna_silver_moon Před 2 lety

    I'm developing a small 3D game and your channel helps me a lot!

  • @thulko
    @thulko Před 2 lety +1

    Great informative video! I was just reviewing events & delegates and this video taught me a few new things.

  • @JW-uu9je
    @JW-uu9je Před 2 lety

    I wasnt ready for this video when I first started watching but I have recently stated calling Unity Events so now I am able to understand this much better. Honestly your channel is amazing! Your personality is hilarious...love all the zingers!

  • @nextdawnstudios1342
    @nextdawnstudios1342 Před 2 lety

    I love the detail into C# in your videos. They have helped me strengthen my skills as a developer. I don't use Unity but I do use C# with Godot and your videos have helped me immensely. Keep up the great work and thank you for what you do!

  • @sansavatar5929
    @sansavatar5929 Před rokem

    You're the guy with the clearest explanation out there, thanks man

  • @EminoMeneko
    @EminoMeneko Před 2 lety

    Nicely explained. The essentials are here.

  • @maxfun6797
    @maxfun6797 Před 2 lety +1

    Nice video, kinda heavy, lots to absorb, but this has given me a good idea of what delegates, actions, event actions are. Thanks

  • @romansalnikov5079
    @romansalnikov5079 Před 2 lety

    Special thanks for the beautiful picture, beautiful buttons, beautiful sprites, in total - beatifull visual work in your videos which in no way relate to the topics of your videos, but it's very pleasing to the eye
    Probably this video not for beginners and your explanation not the best but doesnt matter, your videos so good
    It's like comparing buggy win 10 and mac os with amazing controls

  • @adventuretuna
    @adventuretuna Před rokem +1

    In our workplace, we avoid using UnityEvent.
    This is because in the past we would spend hours debugging why Foo() is being triggered randomly only to see that Foo() is in a random UnityEvent in a random animation or prefab.
    The problem is that if a function is invoked by a UnityEvent, the stack trace will not say which object is invoking that function. The IDE will also mark the function as "not used" so it shows as greyed out and somewhere down the road, a new programmer works on the project and deletes the function tied to a UnityEvent causing all sorts of bugs.
    It's less designer-friendly but having functions be explicitly triggered through code only helps reduce bugs in general.
    This has somewhat been alleviated though ever since we all switched to Rider because Rider knows if a function is used in a UnityEvent.

    • @Tarodev
      @Tarodev  Před rokem

      This is a major problem for the entire scriptable object architecture workflow. It's toop hard to keep track of what's triggering what.
      I stick with standard functions, too.

  • @bunggo9914
    @bunggo9914 Před 2 lety

    your explanation is better than most online courses, keep up your content!

  • @kopilkaiser8991
    @kopilkaiser8991 Před rokem

    Amazing. Easy and simple resource to learn and understand. As wel, you are fun to watch as you make it interesting with the great humour of yours.

  • @curtisodorizzi7779
    @curtisodorizzi7779 Před 2 lety +2

    I see some JB Rider shortcuts being used. I'd be interested in a video detailing some of the JB Rider tips as it relates to Unity development.. Maybe you can get them to sponsor the video or something :)

  • @khubayan8350
    @khubayan8350 Před 4 měsíci

    I feel enlightened. Thank you.

    • @khubayan8350
      @khubayan8350 Před 4 měsíci

      I'm literally tearing up right now

  • @boooooooop
    @boooooooop Před 2 lety +1

    Genuinely such a great and informative video, thankyou

  • @gorkemasrinkoksal6110
    @gorkemasrinkoksal6110 Před rokem +1

    You deserve everything

  • @fmproductions913
    @fmproductions913 Před 2 lety +1

    That was very well explained!

    • @Tarodev
      @Tarodev  Před 2 lety +1

      Thank you FM my boy

  • @hefferwolff3578
    @hefferwolff3578 Před rokem

    Extremely helpful, thank you!

  • @subhajitadhikary816
    @subhajitadhikary816 Před 2 lety

    Really Helpful video, as usual, I recently found the 2048 and grid game video. Ngl those types of videos are really great for learning. I found it very helpful. Learned a lot, Thank you!!. Hope you make long videos like those covering a variety of topics.

  • @WagnerGFX
    @WagnerGFX Před 2 lety

    One thing I like about Actions is that you don't need a definition like Delegates, just the signature.
    A good tip is that if you are going to create some kind of custom "EventArgs" to send a group of data, prefer to use struct unless a class is necessary, that will generate less garbage. (that is the struct's function anyway 😁)

  • @leomac3464
    @leomac3464 Před 2 měsíci

    Thanks. I took a lot out of that.

  • @marcioardanuy3089
    @marcioardanuy3089 Před 7 měsíci

    Awesome explanation!

  • @kopilkaiser8991
    @kopilkaiser8991 Před rokem

    Impressive tutorial. Thank you for taking the effort to teach us these topics 😊

    • @Tarodev
      @Tarodev  Před rokem

      I'm glad you enjoyed :)

  • @hellhunter9478
    @hellhunter9478 Před 2 lety

    Nice video and nice information regarding's this topics. I will have to work with them in order to understand them better but now at least I have a general understanding of them so thank you for this video :)

  • @Atezian
    @Atezian Před rokem

    As soon as you added static to the Action ... Why not just call the functions directly? Using the Action made it more complicated and confusing.

  • @mathiasbauer3169
    @mathiasbauer3169 Před 2 lety +1

    Very useful information, thank you.

  • @Ak-zm3ce
    @Ak-zm3ce Před 4 měsíci

    great teaching skills

  • @MarceloSantos-rk5ee
    @MarceloSantos-rk5ee Před 2 lety

    Very good video, thanks!

  • @HelPfeffer
    @HelPfeffer Před 2 lety

    Your videos are great, and very useful. Thank you

  • @essentia9
    @essentia9 Před 4 dny

    Shortest explanation about differences between delegates and events:
    An Event is a delegate with 2 restrictions:
    1- You can not invoke the delegate reference directly
    2- You can not assign to it directly
    A bit longer(but sweet and funny)explanation:
    czcams.com/video/NgrnCMaxIXM/video.htmlfeature=shared

  • @nikunev
    @nikunev Před 2 lety +1

    Dude, you create insanely useful, extremely well explained videos! I like your short on-spot examples to demonstrate everything. Keep up the good work! I hope you make a cooperative video with Jason Weimann and Codemonkey, so your channel gains more popularity. In my opinion you beat both of them: Jason sometimes drifts away from the topic and Codemonkey's tutorials gotta always get paused to check what he speedtyped and moved off screen immediately after that.

    • @Tarodev
      @Tarodev  Před 2 lety

      Thank you for the kind words 🙏
      Hmm... I might watch 300 tonight

    • @nikunev
      @nikunev Před 2 lety

      @@Tarodev :D just don't watch the sequel. I am being honest with you, watching constantly tutorials for a decade (since Brackeys entered and basically (re)defined the gamedev youtube tutorial scene) in case there is something new in Unity that I missed. You are really good at explaining. Fact.

  • @RussiJislakki
    @RussiJislakki Před 2 lety +1

    I try to keep the visualization / UI totally decoupled from game logic and Events (or UnityEvent more specifically) provide a good one-way communication between them. Though sometimes I run into a problem when subscribing and invoking happen in the same frame (new instantiated class subscribes to an event which invokes during the same frame - thus not triggering whatever function I wanted). Thanks for the video anyway! I've always found delegates to be hard to understand.

  • @vivienlynn2585
    @vivienlynn2585 Před rokem +1

    @12:30 About unsubscribing; Normally I subscribe and unsubscribe exactly like you suggest here (@13:12). But in rare occasions, I found myself having to subscribe to events from multiple locations in my codes. This easily lead to accidental subscriptions to the same event multiple times, which results in it being fired multiple times with each call.
    In situations like this, it is possible to unsubscribe first, and then subscribe in the next line. If you are not already subscribed, nothing happens. If you are, you make sure to only add one listener.

  • @zgbns
    @zgbns Před rokem

    A delegate is a type of method, you can define the structure of a method. Remember, All types exist is tell what the type is, and how to use them.

  • @MassimoRough
    @MassimoRough Před 2 lety +1

    If you assign empty delegate to your event in declaration like OnNewMemberAdded = delegate(){}; then you won't need to check it for null ever.

  • @SalarianStudios
    @SalarianStudios Před rokem

    thank you !

  • @ALL_ONE_SUN
    @ALL_ONE_SUN Před rokem +1

    Saw today that "null propagation operator" was basically copied from Swift, although seems as though it's maybe BETTER in C#. That is handy.

    • @Tarodev
      @Tarodev  Před rokem

      I've recently been programming in swift actually! Not such a bad language.

    • @ALL_ONE_SUN
      @ALL_ONE_SUN Před rokem +1

      @@Tarodev Swift 5 is generally nice. It was Swift 1-3 that were horrible basically.

  • @UngodlyDev
    @UngodlyDev Před 2 lety +1

    thx 4 vid

  • @nemcy3668
    @nemcy3668 Před 2 lety

    This is fantastic! You explain the subject so clearly, it helped me out so much. Do you have any plans to cover Observables in the future? I'm trying to learn it at the moment but there doesn't seem to be many tutorials out there that cover the subject in detail.

  • @CrazyUnknownObject
    @CrazyUnknownObject Před 11 měsíci

    Lol, this was just so simple to understand now: "A delegate is just a variable which holds a method instead of data"

    • @Tarodev
      @Tarodev  Před 11 měsíci

      Makes you wonder how so many guides over complicate it 🤷

  • @Betruet
    @Betruet Před 2 lety +1

    Awesome man

  • @paulegan3783
    @paulegan3783 Před rokem

    Thanks!

  • @vinhnghiang1273
    @vinhnghiang1273 Před rokem +1

    For those who dont understand. Dont worry. Just watch it a 47th time like me. You will get it

  • @gabagpereira
    @gabagpereira Před 2 lety +2

    Great explanation! I became a huge fan of events since I discovered them, but at a certain point I also became too obsessed. As you say in the end, it's good to decouple things when needed but sometimes it might just make your game architecture overly complicated if you decouple too much.
    One question I have is: for objects that are constantly being enabled/disabled I usually subscribe to events on OnEnable and unsubscribe on OnDisable. But what about objects that remain enabled throughout the lifetime of a scene and only get disabled/destroyed when a new one is loaded? I usually subscribe on Awake, in those cases... but should I bother to unsubscribe on OnDestroy anyway?

    • @Director414
      @Director414 Před 11 měsíci +1

      I'm constantly disabling UI-elements and I have trouble getting events to work properly. I was wondering if instead of disabling/enabling, it was better to make the UI-elements invisible? But you claim here it works if you assign the subscription in the Awake? Do you mean C# or Unity-events, or both?
      P.S. If you know any good videos for learning proper UI-programming in Unity please share, I find it somewhat cumbersome or hard to wrap my head around.

  • @dreamescence
    @dreamescence Před rokem

    Contrary to all the comments, I believe this tutorial works only if you already know events and delegates or at least are familiar with them, so I bit of constructive criticism I believe that it lacks explaining of how it works and why.

    • @Tarodev
      @Tarodev  Před rokem

      Hmm... I disagree. I really don't know how I could break it down any simpler. Open to suggestions though

  • @kyleme9697
    @kyleme9697 Před 2 lety +1

    Was getting worried at the start there ... WTH I'm not using any of that, am I doing it wrong??... then Action ... ahhhh that's the one, ok good !! LOL.

    • @Tarodev
      @Tarodev  Před 2 lety

      See? Now you know where it started and how it all works 😊

  • @troyna77
    @troyna77 Před rokem

    ty sir!

  • @jacobs.7925
    @jacobs.7925 Před rokem

    Outstanding video!! Quick question, how is the extension/add-on called at 5:23 ? The one that gives you choices to autocomplete/etc.
    Is there an alternative inside visualstudio? Thanks a ton!

  • @JayadevHaddadi
    @JayadevHaddadi Před rokem

    great stuff, i just wished there wasnt any background music as it can be hard to hear u some times! :(
    thanks for the good stuff

  • @LaCreArthur
    @LaCreArthur Před 2 lety +1

    Hey Tarodev, awesome video. I've been working on an Event System in Unity that keeps track of all subscriber to debug them more easily.
    I just made a class with an action and a GameObject fields. But do you think the EventHandler could do the same ?
    Also I'm looking for a way to serialize them in the inspector (just like UnityEvents), have you any take on this ?
    I could just use UnityEvent from the start but runtime added callbacks are not serialized so that ruins the purpose.
    I tried a custom editor to get the data through reflexion but it's very hard to get the invocation list to show in the inspector in a good way..

    • @Tarodev
      @Tarodev  Před 2 lety +1

      To serialize standard delegates in the editor you'll nerd a third part library. Odin does it, but a package called UltEvents does it significantly better

    • @LaCreArthur
      @LaCreArthur Před 2 lety +1

      @@Tarodev And it is even free, wow ! Thanks for the reply !
      I used the Odin serialization and managed to have a working system but using UnityEvent for inspector refs and Action for scripted ones, so my EventSO class had to managed two lists of callbacks hidden behind a custom editor.. this was not ideal at all.. Will give a try of UltEvents !

  • @sethdossett1304
    @sethdossett1304 Před 2 lety

    I’m gonna look it up, but one of my questions was difference between an Action and UnityAction?

  • @dago6410
    @dago6410 Před 2 lety

    Okay, while I am generally not a fan of these 'unity-agnostic' videos in MOST cases, this guy is fuckign amazign at that, he actually uses all the good sides of this style (abstract simplicity, not shadowing anything with stupid unity garbage) but without remaining in the 'how tf do i use this in unity' garbage. 9.5/10 (im taking away half a point for keeping me in the state of permanent panic due to my phobia to this channel's avatar ;( )

  • @Rovsau
    @Rovsau Před 2 lety +1

    Last time I visited this topic I ended up using Action without Invoke.
    Supposedly more performant. You can invoke or execute the action by writing NameOfAction()
    Is there a reason not to use only Actions?
    Good video.

    • @Tarodev
      @Tarodev  Před 2 lety +1

      EventHandler has some advantages over Action. EventArgs can change its data properties without the event signature changing, so you don't have to go through your code changing all the subscribers. Also, the sender object is pretty handy in some situations. To be fair though, both of these problems can be solved by using a custom struct as the generic Action type.

    • @Dxpress_
      @Dxpress_ Před 2 lety +2

      The only difference between "action()" & "action?.Invoke()" is that the former skips the null check.
      The latter is just a shorthand for:
      if(action != null)
      {
      action();
      }
      It's an extremely negligible performance difference.

    • @Tarodev
      @Tarodev  Před 2 lety +2

      @@Dxpress_ I completely missread his question

    • @Dxpress_
      @Dxpress_ Před 2 lety

      @@Tarodev ¯\_(ツ)_/¯

  • @MalikenGD
    @MalikenGD Před 2 lety

    Wanted to ask... You say around 7:00 onward that you can use events to decouple, but from what I understand, subscribing to events is tight coupling because you have to have a reference to the classes anyway? Can you help me understand why this is not considered coupling but, say, static classes are?

    • @Tarodev
      @Tarodev  Před 2 lety

      The way I use an orchestrator class (the main method in this case) to hook up the events is what makes it decoupled. Those three classes have no idea of one another.
      You can use scriptable objects to take this a step further, which I'll be covering shortly

  • @user-yc1zz8kw9h
    @user-yc1zz8kw9h Před 4 měsíci

    nice video

  • @MajorSquiggles
    @MajorSquiggles Před rokem

    The null propagation operator confuses me. I get that it checks in case the object is null but what happens if it is? From what I can Google it would just return null, so wouldn't you get a null exception anyways? What if you're trying to assign a potentially null object? Would that make both objects null?

    • @IISkullsII
      @IISkullsII Před rokem

      It depends. If its just a function call which is appended after the null propagation operator, it just ceases to execute the function and skips this line of code if its null. if the return value of the function after the null propagation would be assigned to a variable or be handled in any way, that should consider handling a null as a return value.
      In the later case you should always append a null-coalescing (??) operator to assign some usefull default value in the case a null would be returned.

  • @user-hl8sp5vq6k
    @user-hl8sp5vq6k Před 2 lety

    Please bear with me since I am new to C#
    But I am confused when you created an instance(object) by typing "public DoSomething Something;"
    Isn't this just like declaring a variable, like in "public int x"
    When you want to create an instance, don't you have to do it in class program and type "var Something = new DoSomething(int num)"

  • @tabooization123
    @tabooization123 Před rokem

    Not only did you explain delegates and events in the usual C# but also in unity

  • @monkeymonkey69696
    @monkeymonkey69696 Před 5 měsíci

    yoooooooooouuuuuuuuu areeeeee theeeeee best

    • @Tarodev
      @Tarodev  Před 5 měsíci

      Thanks honey 🍯

  • @ederhernandez5319
    @ederhernandez5319 Před 2 lety

    Hi tarodev, could you teach us how to handle the UI with a robust panel manager? All my approaches to try to handle ui in unity end up becoming a mess. I want to show several panels, some of them at the same time, with animations using doTween. I would like to see an intermediate or advanced tutorial. It would be great if you could do it

  • @attenonmj3708
    @attenonmj3708 Před rokem +1

    Having to declare a delegate before actually "creating" a delegate makes it seem like it is common to create multiple delegates of the same type... Why would you do that? That doesn't sound really useful... Can someone enlighten me?

  • @dago6410
    @dago6410 Před 2 lety

    Okay, but what is a difference between a public Action and a public event Action? Didn't catch that bit and thats kinda what I came here for mostly xd

    • @dago6410
      @dago6410 Před 2 lety

      Oh, he just says it much later than I would expect and i was sure i already missed it. okaaay

  •  Před rokem

    Hello, what is the font name you use for the video thumbnail? Thank you!

  • @archentity
    @archentity Před 2 lety

    For some reason I can't get these Unity Events to work properly no matter what I do. This video seems to do a great job of explaining this, until you actually try to implement it (as a total noob btw) and some type of error is always being thrown.

  • @akam9919
    @akam9919 Před rokem +1

    Never thought I'd hear someone describe a button as promiscuous, but here we are.

  • @zeph0shade
    @zeph0shade Před rokem

    Nah, the difference between an action and a func is how jazzy it gets.

  • @kacperryske2146
    @kacperryske2146 Před 7 měsíci

    You are so funny!

  • @mikhailhumphries
    @mikhailhumphries Před 10 měsíci

    Why not just call functions instead of adding it to a delegate?

  • @harshitjoshi3082
    @harshitjoshi3082 Před rokem

    Is an Action a delegate?

  • @mohankumars6811
    @mohankumars6811 Před rokem

  • @godwinyoh3700
    @godwinyoh3700 Před 2 lety

    It is 16 arguments because they actually used a Tuple

  • @DannyBoy443
    @DannyBoy443 Před rokem +1

    I just found out about this guy. I didn't know you basically had to know C# down pat to watch his videos lol. He's going way too fast for me.

    • @Tarodev
      @Tarodev  Před rokem +1

      To be fair, it's a complex topic, and you don't really need to be across it as a beginner. Thanks for watching though :)

    • @DannyBoy443
      @DannyBoy443 Před rokem

      @@Tarodev Across it? Lol. Does that mean need to attempt it? True, and your walk troughs are great, but just a little advanced and quick. For me at least. I've only been coding in C# for about 2 years.

  • @peacesafe3087
    @peacesafe3087 Před 2 lety

    Hi .i have a question. In this video ( czcams.com/video/aT2zNLSFQEk/video.html ) when he declare lastMove in if statement i realy dont understand because lastMove has no value and he use it minus with Time.time in condition and then assign it with Time.time . I realy dont understand what is the meaning of lastMove in condition when it has no value.
    Tnx

  • @Cyrcline
    @Cyrcline Před rokem

    watched the whole video, still no idea how an event works

  • @veerqa3975
    @veerqa3975 Před rokem

    You camera preview grabs more attention than the content. Just a thought, may be a small avator or smaller camera preview. Thank you in advance. enjoyed your content.