What are Delegates? (C# Basics, Lambda, Action, Func)

What are Delegates? (C# Basics, Lambda, Action, Func)

Code Monkey

4 года назад

286,870 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@kotsh22
@kotsh22 - 15.11.2023 06:28

i really love your channel
and i would like to support you soon when i earn money

i hope you tell me what is the name of your keyboard please
i think its fast and i like its sound!

Ответить
@glasgood9907
@glasgood9907 - 26.10.2023 16:25

Fantastic use case examples.

Ответить
@seanloughran6714
@seanloughran6714 - 17.10.2023 20:58

I am writing a new class for Marching Cubes, and I was going to abstract out the data retrieval and culling of data and colors outside of the Marching Cubes algorithm using Delegates. I looked at the ObjectPool from UNITY as a reference, as they do it very similarly to how I wanted to. I was immediately confused by Delegate vs Action vs Func and within 10mins you explained them all and I am empowered to move forward! Thanks as always for these amazing videos!

Ответить
@mrquokka4733
@mrquokka4733 - 21.08.2023 23:08

Had to rewatch a couple times, but now I get it! Thanks to your channel, I feel like I am really beginning to understand coding and get becoming able to develop games!

Ответить
@kaminmiller
@kaminmiller - 16.08.2023 16:04

I'm just getting started with Unity and C# and had been having troubles with Event Systems, and just 4 minutes in to this video it finally clicked. Thank you for this.

Ответить
@thomasremastered6941
@thomasremastered6941 - 13.07.2023 14:45

I'm just impressed about how you are able to explain something that was hard for me to understand in a few minutes only ! Thank you for this amazing tutorial ! I'm definitely subscribing to this channel, and going to watch the other tutorials about c sharp basics !

Ответить
@RafaAyadi
@RafaAyadi - 02.07.2023 17:15

Great tutorial. Thanks!

Ответить
@user-qv9yc5ln6v
@user-qv9yc5ln6v - 02.07.2023 04:37

I just wanna know how you lean every topic with such a deep concept .I also wanna learn but ,I think it will take so much time to learn everything in such a detail manner can you give me some advice how can I learn deeply in less time?

Ответить
@jackwo95
@jackwo95 - 26.06.2023 12:31

Great video! It sure made me understand how delegate works! Thank you so much!

Ответить
@iexuvia4610
@iexuvia4610 - 24.06.2023 13:38

wow, it's cleaner and shorter, amazingly explains how to use delegate!

Ответить
@nthh6099
@nthh6099 - 24.06.2023 02:04

if i could i would have pressed like button more than once on this video. srsly amazing explanations
👍

Ответить
@theashbot4097
@theashbot4097 - 05.06.2023 19:36

what is the difference between

public event Action OnAction;

and

public Action OnAction;

Ответить
@aditijha5737
@aditijha5737 - 25.05.2023 19:36

Finally understood the concept! Thanks for making such awesome videos!! Love from India!!!

Ответить
@chthonianboy
@chthonianboy - 15.05.2023 06:42

Amazing video, this playlist is fantastic for a Unity newbie like myself. And in the spirit of us noobs learning, could you maybe consider slowing down a bit on your next videos? I had to slow down the video to 0.75 because I had to constantly go back in order to grasp all these new concepts. Thank you.

Ответить
@caseyspaulding
@caseyspaulding - 10.05.2023 22:51

Thanks! Very helpful

Ответить
@abtinb.f691
@abtinb.f691 - 17.04.2023 19:02

thanks a lot, it helped me understand the core idea of Delegates. Great examples by the way.

Ответить
@GregX999
@GregX999 - 30.03.2023 02:00

I watched this after watching like 3 or 4 other videos about delegates. The other videos were a waste of time - I should have started with this one! By far the clearest explanation and examples.

Ответить
@yavvivvay
@yavvivvay - 21.03.2023 20:59

Function pointer but safer and multicast :D

Ответить
@sarthakbapte6301
@sarthakbapte6301 - 11.03.2023 07:28

Easy to understand. Good video. Would like to see dark themed editor, for the code. It is much pleasing to eyes in the night.

Ответить
@DmytroSerebrennikov
@DmytroSerebrennikov - 11.03.2023 02:05

as I understand events differ from delegates only in protection, is it better for a beginner to use only delegates?

Ответить
@gulakov9006
@gulakov9006 - 08.03.2023 21:10

watched it 3,4 times and i dont get it at all. just started with programming 3 weeks ago and i feel totally lost

Ответить
@watermelonman9449
@watermelonman9449 - 08.03.2023 01:35

Delegates are cool but feel really useless, like the same thing can be applied with other methods. Maybe delegates are more optimized. Dont get me wrong tho, events are 999% useful.

Ответить
@hamsterhaunter5718
@hamsterhaunter5718 - 05.03.2023 17:43

Great video! Can you think delegates as a function pointer in C?

Ответить
@jonatansanchez1840
@jonatansanchez1840 - 24.02.2023 00:16

Awesome explanation! Well done, thanks a lot.

Ответить
@jud.su.5developer895
@jud.su.5developer895 - 05.02.2023 16:13

?How much is your mind

Ответить
@Jukaorena
@Jukaorena - 17.01.2023 21:56

Thanks code monkey, now i understand how to use it but, I still don't know when to use it, hava a nice day <3

Ответить
@tubejuanso
@tubejuanso - 14.01.2023 22:13

Great and simple video man, much better than reading the MS documentation!

Ответить
@sjoervanderploeg4340
@sjoervanderploeg4340 - 22.12.2022 02:35

What happens with the returned value if you add more delegates with the same return type?

Ответить
@overrideFunction
@overrideFunction - 20.12.2022 22:09

Thanks for giving a real-world game use case. That really helped me understand why learning this would be valuable.

Ответить
@tabooization123
@tabooization123 - 17.12.2022 14:58

nice video

Ответить
@jacobs.7925
@jacobs.7925 - 16.12.2022 01:14

Every single of your content is awesome, glad I found this video! 🐵🐒🙊🙈
Do you happen to have any other tutorial covering lambda expressions (free or paid)? Thanks

Ответить
@hanbieryu8390
@hanbieryu8390 - 12.12.2022 09:27

Didn't even know what a delegate was before this video. Thank you so much for providing us with these awsome tutorials

Ответить
@IdBeBack
@IdBeBack - 29.11.2022 22:32

Never learned so much in "Intro", thanks!

Ответить
@NewbNinjas
@NewbNinjas - 31.10.2022 15:30

So back to delegates, this stuff has finally sunk in. It's only my third time using them so it's not like it took me 3 months to learn it but I thought I'd say thanks AGAIN because this should really help me get through your Unity NetCode tutorials. Thanks a million CM.

Ответить
@astrahcat1212
@astrahcat1212 - 29.10.2022 05:41

It makes it easier for us dumb brained people if you call a delgate a 'holder'.

Ответить
@Rahulsingh-theraha
@Rahulsingh-theraha - 18.10.2022 18:54

excellent 🙂🙂🙂🙂

Ответить
@kruth6663
@kruth6663 - 10.10.2022 07:00

Hi! In the timer class example, it seems to me that even after the timer is done, it'll still continue running to check for the actionOnTimer.timer on every frame.
And every time you use the timer it seems to introduce another instance of that timer, checking on every frame.
Is that actually the case, and if so, would that be a problem?

Ответить
@ayushsidam289
@ayushsidam289 - 07.10.2022 00:12

I'm a beginner in game dev and didn't know about Delegates before but Now I understand the power of clean code. Thanks for the video sir. 😇🙌🏻

Ответить
@DallaswithaD
@DallaswithaD - 06.10.2022 21:42

Dang, cool. With that first example, it looks like you could avoid using an all-encompassing function that does everything without context, and just add the necessary procedures individually to a delegate as needed. Before, I probably would've made a function to remove a sandwich, plate, and table, regardless of whether or not they were all present, and now I could probs just add to a table delegate as things are being added. A weird hypothetical, but I think it helps me understand lol

Ответить
@Ghost13-
@Ghost13- - 06.10.2022 13:43

After years, I finally understood this XD
I just watched the events video too and found it very similar to actions but with some different syntax, is there another core differece I missed?

Btw I like how you still read the comments even on the old videos

Ответить
@nicretbaby
@nicretbaby - 02.10.2022 06:31

Really work

Ответить
@Unexplained65
@Unexplained65 - 02.10.2022 06:17

There is a lot in these videos... definately not something to try to speedrun

Ответить
@empressredbird
@empressredbird - 01.09.2022 00:25

interesting

Ответить
@blameyourm8519
@blameyourm8519 - 29.08.2022 18:29

Help!
When I run timer code from multiple scripts, one timer overwrites another if the timer is not complete. Is it possible to avoid this?

Ответить
@AleGM2010
@AleGM2010 - 25.08.2022 23:04

Necesito este video pero con subtitulos al español :(

Ответить
@nkat519
@nkat519 - 22.08.2022 17:06

good thing about this vid is that mistakes (if any) were cut out and there is so few unnecessary mouse clicking on the same line. Laser focus words, concise explanations and practical examples. Like that a lot!

Ответить