What are Delegates? (C# Basics, Lambda, Action, Func)
HTML-код
- Опубликовано: 12 май 2024
- 🌍 FREE C# Beginner Complete Course! • Learn C# Beginner FREE...
🔴 Watch my Complete FREE Game Dev Course! 🌍 • Learn Unity Beginner/I...
📝 C# Basics to Advanced Playlist • C# Basics to Advanced
🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
👍 Learn to make awesome games step-by-step from start to finish.
🎮 Get my Steam Games unitycodemonkey.com/gamebundle
✅ Let's check out what are Delegates in C# and how they help us write cleaner and more modular code.
Learn Unity in 17 MINUTES!
• Learn Unity in 17 MINU...
Learn C# BASICS in 10 MINUTES!
• Learn C# BASICS in 10 ...
What are Events? (C# Basics)
• What are Events? (C# B...
What are Delegates? (C# Basics, Lambda, Action, Func)
• What are Delegates? (C...
What are Interfaces? (C# Basics)
• What are Interfaces? (...
What are Generics? (C# Basics)
• What are Generics? (C#...
What are Loops? (C# Basics, for, while, do)
• What are Loops? (C# Ba...
Unity Tips in 10 MINUTES!
• 12 MORE Unity Tips in ...
Unity Basics for Beginners
• Learn Unity in 17 MINU...
Trigger an Action after some Time
• Trigger an Action afte...
Ability Bar in Unity (Swap Weapons/Items)
• Ability Bar in Unity (...
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🤖 Join the Community Discord / discord
📦 Grab the Game Bundle at unitycodemonkey.com/gameBundl...
📝 Get the Code Monkey Utilities at unitycodemonkey.com/utils.php
#unitytutorial #unity3d #unity2d
--------------------------------------------------------------------
Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Website: unitycodemonkey.com/
- Twitter: / unitycodemonkey
- Facebook: / unitycodemonkey
🌍 FREE C# Beginner Complete Course! ruclips.net/video/pReR6Z9rK-o/видео.html
🔴 Watch my Complete FREE Game Dev Course! 🌍 ruclips.net/video/AmGSEH7QcDg/видео.html
📝 C# Basics to Advanced Playlist ruclips.net/p/PLzDRvYVwl53t2GGC4rV_AmH7vSvSqjVmz
🌐 Have you found the videos Helpful and Valuable?
❤️ Get my Courses unitycodemonkey.com/courses or my Steam Games 🎮 unitycodemonkey.com/gamebundle
Here's the highly requested Delegates video! Learn how to use this insanely powerful C# feature!
Basic to advance full tutorial playlist link???
Lol wtf yesterday we just started learning delegates and here I go. What a timing xD...
You already made the best tutorials there are on events and delegates... Now please tackle interfaces and some practical game examples. Ps. What do you think about DI and Zenject in Unity? Is it worth a tutorial? Or a series? Does using it makes sense? Thanks for great stuff, for many things even if I already know and use them I still come here to get your angle on it.
Right now this is only the second C# video but I plan to continue making them towards building a Beginner to Advanced C# Playlist.
Yup Interfaces is definitely a topic I'd like to cover, I have a video coming soon on how to make a Modular Character Controller which uses Interfaces a lot in order to make the modules.
Dependency Injection is something that I always keep in the back of my mind and it really helps me write cleaner more decoupled code.
finally some one who explains how to use delegates, not how to create the delegates ! thank you :D
So delegates are like variables that store functions. Nice video. Waiting for more of this kind of topic
This is the beat long-handed description of the term "delegates" I have heard. I had trouble wrapping my head around the term, but I read this comment and it clicked.
I've used delegates before but never understood entirely how they work, and I always forget how to set them up, and what I can do with them, without looking up an example every time. This explanation just made it all click finally.
Made it click, thank you
Kind of like Lua Metatables then.
3 years later this comment made delegates fully make sense
I'm still having a hard time wrapping my head around all the new terms, but this video has clarified so much about the delagate system. I especially liked how you broke down the delegate, then showed exactly what was going on behind the scene, followed by an iteration the syntax, examples, and another iteration. Now I can go back to the older videos and finally understand what you are writing! I feel like you just unlocked hours of your videos (an others who use variations of the other syntax) for me. Thanks!
I'm glad you found the video useful! Thanks!
Same! finaly can understand previous videos! :D
Dude, I was always wondering what that weird looking code was supposed to do that some people used. glad i stumbled over this video explaining everything extremely understandable.
Excellent tutorial, thank you!
Definitely highlights some extremely useful ways to implement delegates. Great video! Thanks 😊
Interesting and well-made video on delegates, I have never really understood when to use them efficiently before working with APIs for the most part in my work, but I can definitely see the use of it now for games especially and will try to apply it to my own hobby games. Thank you for a great video!
Awesome video, thank you for explaining "why we should use it" (not only "how") and providing the practical examples!
Been trying to find information about Events all day. So many videos talked about delegates and never explained them simply for a beginner. You are the first to simplify it. Now I think I understand Delegates and how Events relate to them. You also showed great ways to use them so I can see their potential (and also how bad my beginner code is). Thanks.
One of the best and clearest delegate explanation videos on RUclips. Great!
Thank you very much! I've been working with delegates professionally for almost two years now but I couldn't do it right without referencing from previous work how to do it right, but after this video it is finally nailed down in my brain. You're the man!
I've just found your channel, and I can safely say you are easily my new favorite game dev channel. Keep up the awesome work, man!
Thanks!
wow i was always struggling with delegates and events but you sir made them extremely easy ... thank you ... you are my best teacher
after watching dozens of videos which includes some of yours also, this made everything clear. i mean every single detail is super clear now. thanks for your effort
Probably the best tutorial i've followed on the subject thus far. Much appreciated!
Not a game developer. I have learned the basics of all these concepts which I could not until now. Everything was mystery and now it seems so straight forward. Thanks..!!
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 !
Sweet!! I'm loving these c# core tutorials.
I have a Unity Engineer interview coming up and I feel like an imposter, so I hope I get it. Going through these videos help.
Best of luck!
I hope you got the job dude!
10 biggest cliffhangers in the history...
number 3:
He was the impostor. He was ejected... ;)
Thank you so much! I've been struggling with those a lot. This made my understanding a little bit clearer
Amazing tutorial! The demonstration of specific use cases really made it all click for me.
This one, and the video about events, were really helpful. Thanks.
I checked almost 10 video tutorial to understand why I should use 'Delegate' but none of them gave me a clear understanding. But your tutorial, specifically the clip from 15:00 clear off all the clouds in my head. Now I know! Amazing clip! Thank you a lot.
I'm glad the video helped you!
There have been very high quality, highly requested and very helpful videos during the past few weeks. Thank you so much for your effort.
I personally don't really care about DOTS right now as there are many basic features that don't work in it right now and by the time dots is production ready, a lot of it will be different so I will have to relearn. I am personally just going to wait for it to be production ready.
The DOTS core is meant to come out of Preview in 2-3 months so while it will take a long time for all the tools like UI, NavMesh, etc, to be converted into DOTS the base shouldn't really change significantly.
I was following the concept but only really grasped it when you gave the examples at the end. thank you for this!
Thank you! This made me understand delegates a lot more, and it gave me and idea on how to solve an issue I've been having.
Awesome tutorial, immensely useful yet simple intuitive code-based examples. More power to you
Thanks for giving a real-world game use case. That really helped me understand why learning this would be valuable.
Great video and great job explaining it! I often use Action and Event delegates, and understand how they work through using them, but good to get a simple explanation from the ground up! I always got wierded out by lambdas but I think I get it now!!
This is the best video for explaining these concepts! Great work mate and thanks
Fantastic tutorial, simple and concise, great examples of use cases, thank you.
Love your videos! I have been coding for 20 years....but still learn new stuff with your vids.
Didn't know much about the Func types. The event videos are really awesome!
Like Always, your videos are just amazing. I watched the Basics Events one and now this....I really feel I'm leveling up. Thaaaaaaanks.
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.
I'm glad the video helped, thanks!
I am really stunned with these tutorials!
Thanks alot!
this is soo in-depth, just what I needed, at the time I am increasing my C# knowledge and your tutorials and the unity official ones are the most helpful although your videos are more in-depth that's what I prefer, thanks for making these awesome videos.
I'm glad the video helped you! Thanks!
WOW!!! amazing video!!
I've been learning unity for the alst 2 months and this open my mind,
I'm pretty sure my code will improve a lot by knowing all this.
Thank you! =D
This is crazy good. Bonus points for making your code look like a transformer from 3020
I dunno what it is about you, but you explain things in such a way where a thing I had a 50% grasp on previously, now make SO MUCH SENSE. I could watch 5 other videos on the subject, and this is the only one that I feel that got me to the point of understanding WHY/HOW it's implemented. Your examples are so simple but thorough!
Thanks! Glad you found the video helpful!
I never understood how to implement delegates. I watched dozens of videos. Now I understand. THANKS.
"Mindblown" would describe precisely the way I felt when you showed the example about the attack types! Most games I've done so far are really, really simple projects but if I kept coding in the trivial way I would face obvious scalability issues in the future, well no more, thanks to this tutorial!
I'm glad you found the video useful!
Great tutorial, spent my weekend with no internet, and did some timer functions for my Tycoon game buildings.
This is very interesting, will try to implement tonight cause there are diferent buildings using diferent timers and actions.
Thanks ^^.
Thank you so much for such an awesome and helpful tutorial!
Also, important to note: We found out that although we cannot explicitly refer to and remove a lambda expressed function from the delegate, you can still clear out the delegate if necessary like this:
public void RemoveAllCallbacks()
{
Delegate[] myDelegateList = MyDelegate.GetInvocationList();
if (MyDelegate != null)
{
foreach (var method in MyDelegate)
MyDelegate -= method as DelegateCall;
}
}
This has helped up tremendously. Thank you so much!
Very helpful video. These c# basics videos are very clear to understand and they have a lot of good information
This is an awesome explanation for delegates, thanks so much.
Excellent tutorial. Thanks to your video, I fully understand what are delegates, lambda expression, action, etc. Before I was afraid of these statements
Subscribed. I’m a .Net engineer about a year and a half of experience. This video was super helpful.
Thanks! The punch/sword attack example helped clarify for me why actions are actually useful
Man, I stumbled on your complete course, am halfway through it but I have my own ideas I keep trying and I gotta say every question I have, you have a video for, cheers!
Nice! Great job on applying your own ideas, that's how you truly learn! Keep at it!
Never learnd so much in such short Time.Thx for the awesome Stuff.
Great video! It sure made me understand how delegate works! Thank you so much!
Great video, thanks for the detailed explanation each step of the way.
Thank you! I have learned from this video what i have not from 100 books and other 100 videos. I am not a game developer, more on the web apps and database, but with you i can that i will start learning Unity ☺️
Omg finally I found this tutorial! I never understood how lambda functions work...thx for the nice tutorial!🤗
i wish this video was around before i learned from many many other videos. this explanation/showcase is simple and clean and the last 3ish minutes has to be the best way to showcase the practical uses of delegates i have ever seen. nothing worse then getting examples that make no sense and/or have no practical use.
Thanks! I do try very hard to teach the theory and also show practical use cases.
yeah the last part was really nice
Great and simple video man, much better than reading the MS documentation!
How did I not understand all these before your video? Amazing tutorial!
one of the most useful c-sharp videos! thanks 👍🙏😊
Really helpful for beginners. Thank you ~
Oh my goodness! I finally understand why delegates are useful. This is perhaps the only online resource that clearly explains what delegates are and how to practically use them - and it's free! You're amazing!
I'm glad the video helped you! Thanks!
man thank you for your videos, watching you its more fun than watching netflix
Your channel is underrated you should be trending. The way you explain things is stunning. I am a self taught developer so its great to have a simple but top the point explanation. Great work.
I'm glad you like the videos! Thanks!
You're a godsend. Great programmer with great didactics.
It is best video about C# delegates all over youtube. Thank you so much for you work! My head was exploding because of delegates, but now I understand a lot
I'm glad the video helped you! Thanks!
Amazing tutorial, thank you so much!
Never learned so much in "Intro", thanks!
Thank you, i am a bit of a noob when it comes to programming so this advanced stuff is great.
Thank you for these.
Some words of wisdom from one learning programmer to another, there is no such thing as "advanced". There are only tools, and the more tools you know how to use, but better stuff you can build with those tools. It can be tricky and confusing sometimes because you have to wrap your mind around new concepts. But don't trick yourself into thinking it's too complicated to understand and then put off learning it. 99% of programming is easy to understand once you know how the language components work. The other 1% is knowing how to make clean (not sloppy) code.
@@Andrew90046zero Right, I will mind those words of wisdom,Thanks.
Awesome explanation! Well done, thanks a lot.
Another splendid one, thanks!
Beautiful Tutorial, Helped me a LOT :)
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.
Heh it does take a while to click but when it does it's another excellent tool in your toolbox!
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!
I'm glad the video helped! Thanks!
This flew way above my head
You are the best tutor available on RUclips. I understood a lot on Delegates watching your explaination.
Thanks! I'm glad the video helped you!
You helped me alot with that content, thanks!
I am starting to love coding after watching your tutorials.
Thanks CodeMonkey!
I'm glad the videos helped you! Thanks!
What a great video, thanks for the real world examples.
This was so amazing!
I love your tutorials so much
thanks man this was really usefull and it made my works much easier .. keep going well done
thanks a lot, it helped me understand the core idea of Delegates. Great examples by the way.
I'm glad the video helped you! Thanks!
Really Useful explaination .Thanks alot .It's good to see code in Action
A very good and simple explanation . thank you
It is incredible how fast you type.
Lovely explanation. Thank you
thanks for the tutorial! as a java developer this is a whole new concept to me and it was explained very good : )
Very very clean explanation, this was beautiful, congrats (Y)
Didn't even know what a delegate was before this video. Thank you so much for providing us with these awsome tutorials
I'm glad the video helped you! Thanks!
Wow, great explanation and examples, thank you such much, I'm subscribing
I'm glad the video helped you! Thanks!
Oh, this seems really useful! Thank you!
You're a genius teacher, thank you!
Finally understood the concept! Thanks for making such awesome videos!! Love from India!!!
I'm glad the video helped you! Thanks!
Fantastic use case examples.
Mate this is gold i'm gonna recommend it to my former game design class teacher
I'm glad you liked the video!
I love the delegates even more!
Best delegate class on youtube! Thank you! I just can't understand how this can have 7 dislikes...
your courses are really nice
Amazing tutorials i even understand Generic Classes.
When i see another tutorial. I can know what is delegates and i don’t know how to use them. Your example explain me a lot thank you.