I love this mentor/mentee format, the issues aren't contrived but rather come up organically. Also it actually feels like a conversation I would have with a colleague.
@In-N-Out3334 жыл бұрын
You can also trigger an event when an item is collected and have the ui class subscribe to it. This is better than constantly checking for it in update.
@9paradox4 жыл бұрын
Can't wait to see the in depth story of constructor in monobehaviour.
@YairVich4 жыл бұрын
Too
@InfallibleCode4 жыл бұрын
“Once upon a time there was a C# class that wasn’t like all the other C# classes...” Lol long story short, Unity does some stuff behind the scenes that would break if you override your MonoBehaviour’s constructor. It could make for an interesting video, though
@UnityTest-p6n9 ай бұрын
It's a pure programmer fantasy: to have a more experienced friend who magically calls you the moment you run into a problem in your code XD
@NotLard4 жыл бұрын
Dude you're like my programming dad now. Thank you so much for making these
@legendaryitem28154 жыл бұрын
The best practice, especially in context of UI updates is to loose couple the classes and get rid of those dependencies through events. For example, every time you pick up a carrot your inventory class could raise an event CarrotCollected or CarrotCountChanged and expose the value of Carrots through the event. The carrot label class can then catch that event and update itself accordingly - provided it has registered a delegate to work as the event handler. I find this to be much better for testing because you can test elements of your application independently without having to have a ton of classes that you need to put in the test scene because are all dependent on one another.
@DarkMatterVisible4 жыл бұрын
It's always refreshing to see someone use internal resolutions effectively. Too often programmers (including people from Unity!) advise new programmers to avoid "get" and "find" like they were the plague, but after you've been through a few projects you realize when used properly they significantly reduce the complexity of the project and increase readability considerably. Of course these should never be used in Update when they will be running continuously, but in OnEnable, Start, Awake, all of the times when it will take place outside of gameplay, it's one of the best tools creators have. I went from trying to wield scriptable objects into my inventories and item systems and all of the needless complexity involved in that, to months later realizing I could simply use single scripts or classes along with a couple get or finds, save them with their prefabs, and reduce the complexity of my projects by many orders of magnitude. Sometimes I think people at Unity just don't understand game development, at all.
@ivanyablonskyi8122 жыл бұрын
problems start when people learn programming first, and Unity - second. And people like me, who learned Unity, and then programming. We just think different)
@RootLocusSquare3 жыл бұрын
This is amazing. I now can understand why these tutorials write code these way. And the slang that developers use.
@CodingWithUnity4 жыл бұрын
Really good video! Another way to think about how dependencies are done is the same as how a car is made. Cars are made in a factory and then sent out, each car doesn't contain its own factory. So why inside the logic of your code would you be building the parts of your class that it needs to function, that's the same as having a factory inside your car. It's better to build your class and then send it out to the world, not build it while it's begin used.
@InfallibleCode4 жыл бұрын
Great analogy!
@StefanLopuszanski4 жыл бұрын
Yeah, that is one of the first things I teach my students. Don't put expensive things in Update unless you have some type of bool to turn it off after it is done! Caching is generally better, but sometimes you need it to run with the object already existing. Could split it off but there are multiple options on handling it. And you should put all those calls in Awake over Start to ensure the Dependencies are connected before Start does the logic on it.
@nikaklnikak61523 жыл бұрын
You're doing good talking with yourself. I wish I could do that too so I wouldn't need any friends anymore.
@bhilder4 жыл бұрын
Your videos are legit the best unity tuts
@johnes23374 жыл бұрын
It would be cool to see you go through character development and character arcs throughout the tutorial series to keep viewers enticed to see what happens in the next tutorial video.
@clifflin71492 жыл бұрын
I really like how you explain everything, Thank you and keep up the nice video!
@nGAGE0nline4 жыл бұрын
You're so lucky to have yourself as a good friend. I am my worst nightmare. :D
@artemisDev4 жыл бұрын
You should treat Charles a cup of coffee now and then
@InfallibleCode4 жыл бұрын
I agree! All he does is give and give while Barles just takes and takes. It’s an unhealthy relationship!
@seanadkisson5824 жыл бұрын
lol i like the video format, where u are having a conversation.
@ACatWithACrown4 жыл бұрын
One way I like to manage dependencies, especially with simple Ui things such as that, is through Actions, or events. Pretty neat stuff (:
@shintarouemiya4 жыл бұрын
Is there any extension for VIsual Studio that displays current "drag-and-drop" dependencies from Unity like on 6:08?
@Juan-lj4pi4 жыл бұрын
Just leaving a comment in case someone answers
@gix72734 жыл бұрын
I love the cheezy "me-and-myself"-thing ^^
@CowboyCoder214 жыл бұрын
Awesome content!! I love these, keep it coming!
@Messi0come0back4 жыл бұрын
big fan of Barles!
@maxarefev56862 жыл бұрын
I can't see a solution here for a situation, where we have state management in the game, and in many components, we should subscribe for the state changing to handle it. Should I pass state instance through SerializableField in 10 places?
@redpyre4 жыл бұрын
No one's ever seen Barles and Charles in the same room at the same time
@FuzzyDPozzy4 жыл бұрын
I have a question: 1.Where do you use Dependency injection? 2.Why do you we use it? 3.You said something zen Inject which i've heard before? what does it do? it is allow you to use constructors? 4.Anything to be careful with ? like where not to use dependency injection?
@RichyAsecas4 жыл бұрын
What's that awesome font your Rider has?
@LazzyDawg174 жыл бұрын
I primarily deal with Invalid Dependencies revolving around “packages: com.unity.2d.tilemap@1.0.0” and “packages: com.unity.2d.2dsprite@1.0.0” every time I try to open up my project, I can still continue, but I’ve been dealing with this issue for months....
@blasder0074 жыл бұрын
this is top tier content, thanks!
@peacefuldeityspath2 жыл бұрын
Hey! what coding font do you use? ;o it looks amazing mines are unreadable and i wear glasses. this looks like it can help me
@scriptsengineer4 жыл бұрын
Great video series! Make more tutorials, of ECS for example! Thanks!
@InfallibleCode4 жыл бұрын
Soon... maybe!
@PeterMilko4 жыл бұрын
another great video
@adek4454 жыл бұрын
Great vid! Really helpful! :)
@Soundy7774 жыл бұрын
The whole time I’m watching this I’m just thinking:: “Is Skype still a thing ??!”
@InfallibleCode4 жыл бұрын
I rarely use Skype IRL but I felt like it had the most recognizable ringtone xD
@Soundy7774 жыл бұрын
Infallible Code That ringtone does hit those hairs in the back of your neck with nostalgia. Classy play mon ami.
@albatross4794 жыл бұрын
what are u using var carrots not int carrots?
@huyopo4 жыл бұрын
Dependencies will cause a lot of issues in your project if you don't pay attention. But theres a really simple fix for most issues: use assemblies. You can't have circular references, so your game core can't reference the ui and so on. That forces you to write better code.
@QFSW10244 жыл бұрын
Definitely a good way to make structural dependencies more manageable but it won't solve data dependencies like this But yeah I agree with the advice.
@InfallibleCode4 жыл бұрын
Yes, the rule of thumb is to make sure that your dependencies only flow in one direction.
@tedlanz50384 жыл бұрын
Watching the conversation between the guy and himself triggered my Multiple Personality Disorder! Luckily I was able to FindObjectOfType() to solve the problem. Unfortunately, it crashed my brain up and I had to reboot! Ahhh...the problem with using Windows Vista to power my brain!!!!
@benardallotey4 жыл бұрын
I need to know your Rider color scheme please!!
@LanPodder4 жыл бұрын
how is he getting those warnings?
@SanderDecleer4 жыл бұрын
He is using an IDE called Rider.
@chilpox36714 жыл бұрын
You are my favourite schizophrenic youtuber
@alvin41003 жыл бұрын
Same I just found there are terms to these things lol
@andreamengoli46564 жыл бұрын
Meen amazing so funny and usefull!
@rafaelcorrea79594 жыл бұрын
There should be a video about events, calling update on something that is not changing, is not optimal.
@PxlDev4 жыл бұрын
Subbed!
@beardordie53084 жыл бұрын
I sympathize, Charles, I don't have any friends, either. Problem is, my name already starts with a B, so I don't have a B-version of me to Skype with. 😢
@AlekseyLoykuts4 жыл бұрын
Okay, can i add Charles to my Skype contacts, so everytime i stuck, he'll call me? At my rate he'd probably be online the whole day
@eaglenebula21724 жыл бұрын
Man I hate dependencies, it's one of the things that complicate the code and reduce its flexibility the most in my experience in complex projects like 3D action RPGs.
@mehmedcavas30694 жыл бұрын
Just use singletons in your whole project :O (just kidding)
@cristiano48264 жыл бұрын
Does your twin have a youtube channel?
@monkeyrobotsinc.98754 жыл бұрын
haha he likes the way your sheep game looks.
@thatoneguy91534 жыл бұрын
I cringed when he typed the FindObjectOfType in the beginning. As a C# programmer of 10+ years, it made me want to vomit.
@StefanLopuszanski4 жыл бұрын
One comment about the video... this is a fundamental thing with passing information around and maintaining connections in your code. But you use a ton of advance terms without explaining them like constructors, get/set methods, serialization, attributes, and others. Also, you do things without explaining some of it, like using a SerializedField as opposed to just making it Public. It is okay, but I'd suggest doing a whole video on dependency management from the perspective of someone who is very new... like someone who has maybe done Roll-a-Ball. Would be a lot more useful for new people learning about this stuff. I'd assume people who already know how to use attributes and serialization and so on already know about dependencies, right?
@greglyons2884 жыл бұрын
Every video would require all those terms to be explained and re-explained. The point of this video is dependencies, and if you want to learn about those other topics, you can search them. If those terms don't make sense, then dependencies isn't a priority to learn about.
@StefanLopuszanski4 жыл бұрын
@@greglyons288 : See, that's where I disagree. Dependencies are a priority at some of the earliest levels of game development. Maybe if there was a video explaining most of those terms already then you could link to it, but I wouldn't say you'd have to explain it EVERY time... only in times that with fundamental concepts being covered. Can you name a game without any dependencies?
@sagiziv9274 жыл бұрын
If you are a beginner, then you don't start with an advanced topic like dependencies. All of the thing you wrote above, are basic programming stuff that aren't supposed to be explained in an advanced video. If there was a term you didn't understand, you can search for it really easily. My honest advice (from personal experience) is yo focus on C# programming first (basic console application) and only after you mastered that, move to unity and build more complex projects.
@Juan-lj4pi4 жыл бұрын
@@sagiziv927 I started with unity and I loved it. Idk if I'm alone on this one but, understanding the basics of OOP came easier to me in an environment full of items, inventories, levels, ammo, hp and enemies than in "regular programming", were everything feel so abstract
@greglyons2884 жыл бұрын
@@StefanLopuszanski Beginners who do Roll a Ball probably don't even know the difference between a float and an int, and you want to also throw them more new vocabulary about dependencies? This is why there are courses that have progression. 10 minute KZbin Videos can't pull off what you're asking, and if you think it can, then make it.
@amisner2k4 жыл бұрын
Infallible Skype Call
@avitys51054 жыл бұрын
it's a cool, informative hint video, but a little hard to understand because of bad English.
@michaeltyers7336 Жыл бұрын
This is so unrealistic. I mean who uses Skype?
@fawdept Жыл бұрын
ehat is he speaking bro
@valerii-barabanov-vvb2 жыл бұрын
Don't give him a name, otherwise we can't associate ourselves with him :)