📦 Download the code at www.patreon.com/posts/35573982
@misterrhombus2 жыл бұрын
Thanks
@KarasawaL304 жыл бұрын
I know people find the format silly, but honestly I think this is the best way I've been able to learn these concepts so far. Better than some overly happy dude telling me how easy it is while royalty free music blasts my ears and he codes right past me at 2x speed. Then tells me how easy it was. But I'm not bitter or anything. Anyway awesome tutorial, thank you very much!
@EduardoYukio4 жыл бұрын
This is the most didactic type of tutorial I've ever seen. It's short, walks you step by step, shows you every click and alt-tab, teaches you the definition of the concept and its usability, just perfect.
@QuietSnake-xs5vx4 жыл бұрын
i wish i could Skype myself for answers
@gizel43763 жыл бұрын
I have a boardgame about time travel, the main mecanic is to get ressource from your futur self, but then in the futur when the you from the past ask ressource, you have to give him otherwise you'll create paradox... i feel like this situation is similar, if i can call my futur self for coding advice that mean in the futur i'll be forced to answer skype call to give coding advice to myself
@brice.v4 жыл бұрын
the content quality outweighs the cringe of the acting, and that says something :) gj
@InfallibleCode4 жыл бұрын
It’s a delicate balance lmao
@IconoclastX4 жыл бұрын
Lol
@rikdenbreejen52304 жыл бұрын
@@InfallibleCode, I think you mean that it's a DELIGATE balance! Sorry terrible joke!
@monkeyrobotsinc.98753 жыл бұрын
@@InfallibleCode the ultra high humor factor keeps us going.
@ewwitsantonio4 жыл бұрын
I am definitely purple-shirt-charles in this story! Haha. This format is pretty funny but actually really helpful. Great work!
@InfallibleCode4 жыл бұрын
LOL Purple shirt Charles’ name is Barles 😜
@prudhvi92564 жыл бұрын
😂
@prudhvi92564 жыл бұрын
@@InfallibleCode Hey thank you guys for making these videos
@eierschaedl Жыл бұрын
Love that minimum effort of putting a cap on to represent another person XD I don´t know why it works, but it works.
@StefanLopuszanski4 жыл бұрын
Huh, didn't know about the null conditional operator. That's neat.
@wniawnia2 жыл бұрын
"whatever floats your boat man" my favorite phrase for day or two
@Gabriel-ml7ev Жыл бұрын
This format is hilarious it feels like an English lesson
@jakem46384 жыл бұрын
Underrated channel, please keep up the good work!!
@AbdulazizAlmawash Жыл бұрын
Now i see what seems to always make me quit a project.. tight coupling. entering the loop of fixing this and breaking that. I guess there isn’t an escape from watching an events tutorial. Liked.
@guysome32632 жыл бұрын
These are so goofy, they make me smile throughout. Nonetheless a very effective way of communicating new concepts.
@HadiExtreme4 жыл бұрын
I just found your channel and this is the second video of yours I've watched. I really like this format! Subbed
@ayyythatguy Жыл бұрын
I just realised that the whole 'bunch of doors and keys would slow down the code with useless checks' is the reason why Skyrim used to become slow. I remember being told to throw away my keys and suddenly the game's loading times were super quick haha.
@jikiller85304 жыл бұрын
Can't thank you enough for making these videos, this "tutorial" and the interfaces one have really helped me. Subbed!
@clement6304 жыл бұрын
Day 40 of lockdown: talking to myself on skype
@monkeyrobotsinc.98753 жыл бұрын
lmao.
@illsaveus3 жыл бұрын
This friend of yours is the nicest dood on the whole planet
@teganhakim89104 жыл бұрын
I love the way you present information in a fun and easy way to remember. Keep up the good vids bro.
@BlueGuitarMusic2 жыл бұрын
I love the "Cool" and "thanks" interaction over the keypad. Like 'yes we will be learning about Events here but also- how to give and receive a respectful compliment to a friend/coworker'.
@shaunyitisme32934 жыл бұрын
Still, my number one channel to recommend to Unity beginners and intermediate. Gj man :)
@mrgscreen65414 жыл бұрын
Man, this is a new level, you'll soon overcome brackeys in creativity :)
@onon1284 жыл бұрын
Mrg Screen he is way more creative than brackeys
@anon746912 Жыл бұрын
This video is perfect. Thank you for making it, I've been wondering about these for ages!
@scrawnyrabbit4 жыл бұрын
So much pedagogy. Well done Charles !
@agredek4 жыл бұрын
Nice video. Definitely will help some less experienced developers. Only one question comes to mind: in an example as simple as this, do we really need to create a delegate? Why not just use Action class?
@gadgetboyplaysmc4 жыл бұрын
Can't wait for Charles and Charles for their Romance arc. 2:39
@Stevedeniese4 жыл бұрын
Awesome thanks man, this video is exactly the example I needed to get my head around which events system to use.
@austinheydari18134 жыл бұрын
i think it's better to pass the code (as int or string) as an argument for the unlockHandler. that way the logic to see if the code matches is in the door and not in the keypad. also if others subscribe to the keypad, you won't have to touch the door code anymore. Using interface for this is also recommended, you will be able to reuse your code more easily.
@quadriproduction4 жыл бұрын
3rd perfect video.Jobs,Interface and now Events.keep going with this type of videos please..people will be very glad..I am sure
@ruslanrakhimov15564 жыл бұрын
Charles is the type of dude to ask himself for help.
@monkeyrobotsinc.98753 жыл бұрын
nah, thats BARLES
@SajithGame4 жыл бұрын
I was looking for this. Thanks!
@lando65834 жыл бұрын
y'all gonna be bigger than Brackeys. love the content!
@monkeyrobotsinc.98753 жыл бұрын
SHUT UP!!
@DerObernator4 жыл бұрын
Sir you have a very good method of teaching! keep up the good work and thank you :)
@quocvnguyen71173 жыл бұрын
I love it. Helpful and peaceful.
@keelanbowker-obrien22224 жыл бұрын
Yeah acting aside this was actually an extremely helpful way to hep me understand the events system. The only thing I'd add is maybe some additional visuals when you're talking about the KeypadDoor.cs when you mention the matching signatures. I'm still a noob and because I don't understand the terminology, I didn't comprehend what was being conveyed there.
@InfallibleCode4 жыл бұрын
Thank you for your feedback. I’m gonna make a follow up video that dives into a more advanced explanation so this is a great suggestion 👍
@keelanbowker-obrien22224 жыл бұрын
@@InfallibleCode Wow! Thanks for responding and in general putting out just really great an informative stuff. This channel is just enormously helpful :)
@simon.in.motion4 жыл бұрын
Hello Charles, I wonder, why using C# events instead of UnityEvents for this example ? I find it way more modular to set a OnCodeSuccess UnityEvent and set the reference to the handler in the editor. That way you can also trigger AudioSources or other stuff without writing any more code, just adding it in the inspector. Any thoughts ? Cheers :)
@kbkmn4 жыл бұрын
practical examples are great! do a factory method one. i can't grasp why do i need to use factory if i can just instantiate
@bryanmarino19212 жыл бұрын
I don't understand why he created the KeypadDoor subclass instead of subscribe the event directly from the Door superclass.
@dennisgonzales95214 жыл бұрын
A more shorter way of creating an event public event Action EventName(); remember to use the namespace using System;
@capsey_3 жыл бұрын
Is there a difference between using Action and custom delegate? I know that Action is just a delegate that already defined in System, but is there a drawback to use Action instead of delegate?
@Dbl_Plus_Good3 жыл бұрын
Love your videos Charles! Where have you been dude? Hope all is well.
@InfallibleCode3 жыл бұрын
Just taking a little mental health break. But I’ll be back soon! Gonna get back to regular uploads in a few weeks 😄
@Dbl_Plus_Good3 жыл бұрын
@@InfallibleCode Good to hear dude! Take all the time you need. We're just glad you're not dead : )
@InfallibleCode3 жыл бұрын
@@Dbl_Plus_Good I really appreciate that! I'm still alive and kicking, and planning to resume regular uploads in a few weeks :D
@Schodemeiss4 жыл бұрын
Near the start of the video you discounted having a coupling to the door class. Does an event like this not still create the same class coupling anyway??
@mrgscreen65414 жыл бұрын
Yee man, you're right, it's coupling. As I understood, to decouple things in a similar way try to use broadcast messenger wiki.unity3d.com/index.php/CSharpMessenger_Extended but it's not integrated in unity, unfortunately
@sigmundurjohansen71664 жыл бұрын
OMG this was so silly, yet so effective! haha genius!
@spadelight9514 жыл бұрын
Thanks ma dude.
@FlaurensLBO4 жыл бұрын
Great video as always. I have a question: Is it important to call Unlock.Invoke()? I normally call Unlock()...
@Mr_Whizzard4 жыл бұрын
This video is ridiculously hand-holdy. ... and it's exactly what I needed ::sob:: THANK YOU SO MUCH
@diegoduarte1874 жыл бұрын
Good video, what kind of keyboard do you have?
@adek4454 жыл бұрын
Love that style! :D
@InfallibleCode4 жыл бұрын
Appreciate it :D
@darkman2373 жыл бұрын
In the keypaddoor class, wouldn't you use OnEnable and OnDisable?
@Chubzdoomer2 жыл бұрын
Yeah, that tends to be the best practice. Honestly though, if the object isn't being disabled and then re-enabled it doesn't make much of a difference.
@MQNGameDev4 жыл бұрын
Thanks for the cool video. I love using C# events but I often run into an issue where the subscriber tries to subscribe to the event before Unity has Started the GameObject that holds the event. Any tips on how to avoid the issue? I know I could go into my project settings and adjust the Execution order but it feels like more of a hack than a solution and often leads to other issues.
@gegenton39534 жыл бұрын
Having watched both C# Events and UnityEvents videos, I'm having an issue with operations that need to run in Update() but listen to specific events. For specific reasons I want my character to lerp (that can only run in Update?) based on Events that are triggered from a User Input class. However you can only reference a method (e. g. MoveRight()) as a listener in the UnityEvents list for "InputRight". I currently have a workaround with a bool set to true in the MoveRight() function that the update function has as an input for an if-clause. But this looks very ugly and can't be right. Any ideas on how to solve this (other than creating a single class for all different types of movement and referencing the update method)? Love your videos, very "explaining", rather than "telling"!
@RohitSharma-vq2gn2 жыл бұрын
I feel indebted :)
@adamzimmerman24644 жыл бұрын
My music major ass just thinks of the note C# lol
@mufelo4 жыл бұрын
Hey, any chance you could make a video about using events in ECS. I have found some methods that feel a bit like work arounds and I have built eventqueues myself using NativeQueue but not sure what the best practices are for keeping things thread safe. I have not ran into any huge problems with concurrency yet but I havent built anything bigger either.
@sebastianwardana15272 жыл бұрын
so objects that are attached to and interact with an object should be a subclass of the object they interact with?
@chris.davidoff4 жыл бұрын
Stoked to see this! I do the exact same thing for my inventory's UI updates. Some people talk about performance use of events.. I'd love to see numbers on directly calling a function vs one getting called through an event. To give a ball park, I think a C# event will take ~ 50ms for 10 million invokes based on this reddit: www.reddit.com/r/Unity3D/comments/35oekm/delegate_events_vs_unityevent_which_one_is/
@thePocketWatch454 жыл бұрын
bro i love your channel....
@justahuman48624 жыл бұрын
Very cool. Way over my head. Haha
@davidpage92414 жыл бұрын
It's like when my rubber ducky talks back to me!
@bm10062 жыл бұрын
Hello Charles, Thanks for the tutorial. What version of Unity does this work best in? I imported your project's package into Unity 2020.3.32f1 but the numbers on the keypad are missing and the textures on the walls/doors don't look the same as in the video. Thanks!
@josebarria32333 жыл бұрын
The ?. Operator blew my mind
@robertkadrgulov66154 жыл бұрын
Hi, dude, what keyboard do you use? what do you call a mointor
@darkman2373 жыл бұрын
What if you wanted to keep all your delegates in one place? A master script?
@PeterMilko4 жыл бұрын
Good stuff man! Im down to be a person in your videos if you need anyone.
@rani6004 жыл бұрын
What do you guys feel on actions instead of delegates? easier to make events that way in my opinion, and feels much cleaner in a scaleable project, instead of each time to create a delegate, Great video as always btw!!
@rani6004 жыл бұрын
@@bezoro-personal I guess it depends on how you view, if you name the action properly, it's seems much clearer then delegates.
@CSPlayerDamon4 жыл бұрын
Actions are delegates as well. They don't scale as well though. Imagine having 20+ events and 100+ variables that you defined as Action. Somewhere down the line you decide that must be Action instead. Now you have to go change those 20 definitions and 100 variables to Action. If you had defined a delegate, though, you'd only need to modify the delegate. That, though, doesn't help you from having to change all the code you wrote to use a string instead of int. Events only scale well if you're sure or close to being sure what the event is for. In general, using an interface or a delegate scales better than Action or Func. Lastly, if you're too unsure on what parameters the delegate / action should have, you could make a class / struct for the parameter and populate the class. That way your code will break only if you change the return type or change the class data. You should avoid that, though, and focus on describing the event as best as you can.
@CSPlayerDamon4 жыл бұрын
@@bezoro-personal Situations like that are mostly found in event-heavy applications, i.e turn-based games, low level networking, retained-mode UIs (like the new UI from Unity), etc... The new Unity UIElements is a mighty example of that thought process. It uses a generic RegisterCallback to handle registering of events, where the generic type may be a completely different event every time. Check it out if you have the time!
@vaporalight36703 жыл бұрын
At 1:24, What is Type Coupling?
@StefanLopuszanski4 жыл бұрын
By the way, your link to Editor Console Pro is the same as your Rainbow Folders 2 link :-P
@pwnuser2940 Жыл бұрын
What theme and font was at 1:55 ?
@caithid19513 жыл бұрын
I hope I can get helped by myself when I stuck at my code.
@dknighter24 жыл бұрын
Are C# Events better then using UnityEvents?
@cubasia162224 жыл бұрын
But what if you have 10 doors and 10 keypad ? You need 10 subclass? And what if the number of door in the room is generated randomly ?
@Rizzan84 жыл бұрын
No, you don't need to create KeypadDoor1, KeypadDoor2, etc for each of your door. You simply add KeypadDoor script to each of your door objects and your desired keypad to the KeypadDoor of each door.
@r3s3tme4 жыл бұрын
Why not system.action = delegate? Less code no null check
@BarcelonaMove4 жыл бұрын
You do a funny theater talking to yourself. Love it. Keep the great work up bro! for(;;) { likeButton = IsSourceCodeOpen(); } Even if I were your patron would be glad you share the code with anyone.
@alisayah53974 жыл бұрын
name IDE ur using ?
@subliminalcastillo21264 жыл бұрын
Ride is available for free if you use their early access version! > www.jetbrains.com/rider/nextversion/ I found this out last night after quitting rider for a month due to financial reasons. This has changed the game for me, as I love rider to death, but just can't afford it right now. Spreading the message around on youtube.
@MrStonedLover4 жыл бұрын
Where is the diffrent between Events and Action from c# ?
@MrStonedLover4 жыл бұрын
@@bezoro-personal nice cause I use it in the past and just wounder where the difference is :D
@Unit8562 жыл бұрын
****SCREAMS IN SKYPE****
@josh_swanson4 жыл бұрын
!!Link error in description: Editor Console Pro links to Rainbow Folders 2
@archentity2 жыл бұрын
I have watched tons of videos on this and none of it works for me. No matter what I keep getting the same null object reference error at runtime. Everyone says it's so simple and wonderful, but I must be the only idiot not getting it. It's as if no matter what I do, I cannot subscribe to an event in another class. It doesn't matter if I use UnityEvents or C# events.
@zhav3d4 жыл бұрын
Back to talking to himself again. :feelsbad:
@InfallibleCode4 жыл бұрын
I have to talk to SOMEONE during this quarantine 😂
@steveradtke1308 Жыл бұрын
I want to FaceTime this man
@scififan6983 жыл бұрын
it's 2020 and you're still using delegates? hmmm.
@TheSpacecraftX4 жыл бұрын
Feels weird calling Door a subclass. It's a base class. If anything, intuitively, any class that inherits from it would be the subclass.
@SHOOTINGDNA4 жыл бұрын
XD
@lapineagaric1344 жыл бұрын
who still uses skype? @.@
@jackliu89913 жыл бұрын
great content, but it reminds me of porn acting haha