How to Program in C# - Classes (E07)
Vložit
- čas přidán 12. 09. 2020
- In this final video we'll learn how to use classes in C#!
► Get the 2D Mega Pack: assetstore.unity.com/packages...
►Check out the Asset Stores big reboot sale: assetstore.unity.com/?on_sale...
● Brackeys Forum: forum.brackeys.com/
····················································································
❤️ Donate: www.paypal.com/donate/?hosted...
► Join Discord: / discord
● Website: brackeys.com/
····················································································
► All content by Brackeys is 100% free. We believe that education should be available for everyone.
❤️ Donate: www.paypal.com/donate/?hosted...
····················································································
♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound
Classy video!
Hi Dani
Indeed
When’s the next devlog
Dani when will we get our unity's particles system tutorial
hello how are you im under the water
Well, welcome to not only the last installment of this series but rather, the last tutorial video we will ever see on this channel. It's been fun!
yeah
Yeah
yeah
haey
Yeah
He was planning this series, it was clear. Hhe wanted to leave us with one a final set of coding tutorials for the next generation to come.
a legend.
Legit
he didnt finish it though
@@1ninozinho That's what I was wondering, can it be finished already ?? I only watched a few but I been meaning to get into it, due to the complexity it feels like c# could need many more videos to cover but then again I don't know that much about it, if he didn't finish it though then it would feel almost heartbreaking !! he can't leave us like that ? "crying smiley"
@StrongForce I get what you mean but I'm pretty sure this is just meant to be a beginners course. It teaches you the basics of c#, and from there you can pretty much learn whatever you want. You only need these few skills to actually start coding real programs that you can you and if you need or want to learn anything else you can just search up the documentation.
@@lachy4565 True but you notice he still does the subscribe and click the notification bell for the "Next one" bit... Nah something definitely happened that changed situations. Its his business but I press X to doubt that this was planned
Little did we know this would be his last tutorial. :(
Edit: HE'S BACK
Depression 100
@@redrumchopz5388 For me it's depression infinite
stonks what’s my current stonk at at the moment
@@redrumchopz5388 -1000
@@astickman2486 oh no what do I do
Who’s watching this after Brackeys goodbye video?
This video will go into history as Brackeys last tutorial.. this really hurts
Not really but so much hurt
I watched before and after too.
ikr
Guess what
@@Icequake. LOL
"stay tuned for the new feature" me: ok 😭
rip Unity Jesus
@Grammar nazi cause he's been busy teaching us everything. I don't know what you're butt hurt about but this community ain't the place to load off your bull.
At 18:29 ,
B=Best
R=Recommended
A=And
C=Cool/Clever
K=Kind/Key
E=Educational
Y=CZcamsr
S= Smiling
Thank you so much for making game development easy Brackeys!
i am new to game developing , i was watching dani and brackeys for a hole month then i made my very first game play.google.com/store/apps/details?id=com.ganiglaystudio.Reflexcolorswitch Please try it and give me your feedback :)
Hi
I need suggestions.i want to become 2 d game maker for Android and pc
I am learning blender , Photoshop, illustrator,hand drawing, audicity and video editing.
My question:
Do I need to learn c# language. I have to learn it complete . Or just basic?
2) what other things I need to learn.
I have completed my intermediate education. Now I am not doing any study. I am learning skill through online resources and course .
I need your important advice.it really helped me .
Best regards
Student
I think you mis understand my comments. I want to learn c# only for 2d game . I want know what I need to learn in c# language? I don't need to learn complete language for 2d game
@@gngamestudio nice game
@@abrarahmed-qh4qo learn.unity.com is a great resource to learn unity and c#.
It's a real shame that this is the last installment of the series, I was really hoping that we could get a video about working with API's in C# as there are not many good tutorials available. Great series though!
I wish he did c# asp.net web development videos
@@Ali-gh7rj Why would you want to turn a game dev channel into a web dev channel. Go watch one of the thousand other C# ASP.NET channel. Corey Schafer is a good guy to go to if that's what you're looking for.
@@TheSpacecraftX Exactly.
@@Ali-gh7rj Here some web dev video that I really recommend czcams.com/video/dQw4w9WgXcQ/video.html
What is an API?
Console.WriteLine("F");
Console.WriteLine("Its been a good time")
@Mehmet Kara debuger: you just what??
Debug.Log("We Will Miss You");
@@daydreamteam1366 a fellow unity user I see
@@mkwraith8625 Debug.Log("indeed");
I remember learning about classes when I was 14 and "abstract" was a nice way of saying it..
Come back 8 years later and it didn't even click it just makes since. So glad I could finally understand the most important part of C# and OOP.
im 14
Me too.
😥 Brackeys is my most favourite youtube channel ever. I was going to take photo with you in brackeys studio some day. Good bye man! You really hit my heart as a teacher.
Brackeys, you may never see this but I want to thank you from the bottom of my heart, your amazing content has helped me take the first step into this huge world which I've been too nervous to try for almost 5 years, with this simple series and the hundreds of other tutorials you have I'm sure I can make great progress and have a blast while doing it. It was a big shock to see that you've left, but I wish you the best for all your future endeavours!
You forgot to show us the best class.
this one
You started this series at the exact time I needed it.
Thank you so much!!
Same :D
IKR! Perfect timing! :)
i am new to game developing , i was watching dani and brackeys for a hole month then i made my very first game play.google.com/store/apps/details?id=com.ganiglaystudio.Reflexcolorswitch Please try it and give me your feedback :)
@@gngamestudio error 404. lol
Robert Li about that
You probably won't read this comment but I feel good hoping it happens. Thanks man, less than a week ago I got to know your channel and I feel that I have learned a lot with this mini-course. I was "studying" to be a police officer and I quit, I decided to stop wasting my time and build my future from now on, studying what I really like: Programming.
In July I will enroll in the "Bachelor of Systems" career here in Argentina, so at this moment I am learning as much as possible on my own. Your channel is very valuable. Thank you very much again.
I'm gonna miss you dude.
Amazing...
Even if this isn't actually Unity yet, he is already teaching us on how to make a game...
Thank you Brackeys
Programming is the most fundamental aspect of game development, you can make a game with terrible art skills but if you don't know how to code you're cooked
Brackeys : stories will be told of this day
Me : Please live and tell them yourself
Thanks for everything Brackeys. This channel was a miracle and will always be a miracle.
Great series man, you’re doing a good thing for the community.
i am new to game developing , i was watching dani and brackeys for a home month then i made my very first game kani-master.itch.io/reflex-color-switch Please try it and give me your feedback :)
@@gngamestudio the link gives out an error
Goodbye Brackeys! Thank you for all the things you teached us.
Thank you for making this! 🤩
I'll share it with my students!
They've been enjoying the series!
i am new to game developing , i was watching dani and brackeys for a home month then i made my very first game kani-master.itch.io/reflex-color-switch Please try it and give me your feedback :)
Thank you for this series. I'm merely 15 years old and this has given me the best introduction I could ask for. Thank you.
Edit: I MADE A FUNCTIONING CALCULATOR
How?
@@donyajohnson9637 It's been a year and there are multiple tutorials other places on youtube
i am 14 but i made a better one
The Last Tutorial Done By Brackeys :(
Holy cow I just started this series a week ago and was worried that it would take a while for this video. Perfect timing for the final part!!
Brackeys, Thank you for starting my journey into coding.
only if I knew this was the final video....
Months passed and I can't still believe this is the last tutorial. Broke my heart
Finished the 6th one yesterday, perfect timing! Thank you!😄
Thank you SO MUCH for making this playlist! I got a job where I had 14 days to become self-sufficient in both SQL Server and C#. There's no way in hell I would have been able to do it without these videos being clear enough to be understood AND entertaining enough to be engaging and attention-holding. Thank you so much for your time and labor on CZcams ❤😭
Brother, I have to say thank you for your effort and commitment! Ur doing such a great job explaining everything in such a calm and natural way. I just found out about you and your videos and its helping me a lot in my programming studying. Every tutorial I watch, somehow leads to your tutorial and in the end I get the point only after listening you explaining everything. Thank you so much for your teaching!
Thanks so much for this tutorial. I know Java, JS, PHP and Python, and C# gave me Java memories, they are so similar. This videos are by far the best C# explanation I've seen on CZcams. Now it's time to move to Unity tutorials so I can accomplish many goals I have!
he left us a last gift before leaving 😭
This was my first brackeys tutorial that I have watched though I have viewed his work and seen so many people admire and watch him over the last couple of weeks getting started with my own game dev and somehow even though I have watched 1 vid I feel sad about him leaving, idk it just feels bad.
Thank you for this video series. From the first video to now you have helped my confidence in diving into the game dev stuff, even if I am a bit older.
I went from being a bit scared of the coding, to being very excited to keep learning how to program what I want to happen.
I hope I can continue to improve, but again thank you for these videos.
I just wanna say, this one video helped me understand the concept of classes more than any other video. It's also taught me what my computer science teacher couldn't teach me in months, in 20 minutes. It was straight to the point but still very thorough I'm very sad to hear that you're quitting brackeys but very excited for you to find a new future for yourself! We will miss you and good luck with your future endeavors.
Ending Should Be "Thats Pretty Much It For This Video And This Series And This Channel"
*Your Jedi training has been complete.*
Hey Brackeys, Just wanted to thank you for releasing high quality free educational content for C# and unity. You have taught me everything I know about C# and Unity and your lessons explain complex topics so well. Thanks for making game development help so accessable to so many people : D
Been developing for years and this is the first video that explains classes the best
Damn I wished this series was gonna continue on to some of the more advanced topics of c# like Tasks, Events, Async and Await, Delegates etc.
But it was still really amazing was able to recount on my c# knowledge and was always waiting for them challenges at the end. Good job man.
hey ik ur comment is a year old but do you know where i should continue learning c#?
@@ransomm4838 hey ik your comment is a year old too but i have same question can you please tell me where should i continue learing?
@@wdkaza hey ik your comment is almost a year old too but i have same questions. Can you please tell me where I can order a good burger and fries in Italy?
I can't believe he left :/
Thank you for this playlist, It has been super helpful and has taught me a hell lot! You are the only channel that actually taught me stuff super clearly compared to other teaching channels.
Thank you for the videos! Just finished watching all episodes. Really help a lot at learning C#. Episode based tutorial really great at making me stay focused on the series rather than very long video tutorial that hard to keep track on.
Your presentation and jokes really help bring up the fun in the video.
Thanks for everything brackeys :"'
"Last Episode"
........
*Unless*
looooool
Last episode
Everyone disliked that
Barkeys saw this and was like "yeah, this is the last episode"
Did you just shut down Brackeys lol
Well this aged well...
That was a masterstroke using an rpg class to teqch about classes! That will 100% stay in my head.
Hi Brackeys! I just wanted to say thank you for the excellent tutorial videos, I just discovered your channel in 2022 and even though you are no longer posting videos, your channel has still helped me out a lot!
When you realize he has been planning to stop youtube a long time ago and made this tutorial as a last one.
R I P brackeys we will miss you :')
Thank you so much for everything Brackeys, you are the only reason I'm still pursuing coding and gamedev and I appreciate it all so much! Its been fun learning with you and I'm just glad I found you before I gave up
Dude you are awesome, still super helpful 3 years later!!
Does anybody have any recommendations for tutorials or classes to go to after this, I want to keep learning!! And also, I'd really like to say thank you Brackeys, you have given me this initial set of skills during my introduction to the world of programming and I've enjoyed every second of it, so, thank you!!
Little did we know...
Brackeys, hello and thank you so much for posting your series - which the production quality goes beyond many pro courses available today. I know you probably won't see this but you have inspired me and many others to become a great developer and inspired me to stop procrastinating and create games.
Thank you,
-Y
it was a really detailed, great and useful tutorial ! i'm new here and i'm really sad to see that it's the last tutorial, but life goes on and new projects come up ! thanks to you i've been able to create a simple interactive story, i hope and believe it's the beginning of a big journey for me :) so thanks a lot Brackeys. and for the people watching this video, don't give up programing if that's really what you want in life, no matter who you are, where you from and how old you are ! big up to Brackeys and good luck to you all !
Who else just loves this series?
wait what i thought you just stopped youtube
edit: wtf this was uploaded 5 days ago but i just got it in notifications, thanks youtube, very cool
watch his latest video lmao
@@tomekcz3265 i did, is there something i missed?
Shoutout to anyone that made it through the playlist! Lets gooooo!
IF YOU SEE THIS PLEASE make more programming videos, we miss you
Brackeys: You made it to the 8th C# programming course
The undertitles: sEIzUrE pRogRaMMinG cOuRse
XD i only knew that after reading the comments
SAD HES LEAVIN NOW
Hello Brackeys, I know you do not post videos anymore but I wanted to thank you for all of the great videos you have made. I have gotten back into programming, and just finished this mini series, and these videos have really helped me get the gist of C#. Thank you :)
just bought a Udemy course and the series really helped in giving me a much better understanding of C#! thANK YOU KING 👑
"And i will see you in the next video". Little did we know
what the teacher teaches you : cats
the test : WIZARD
What a beautiful video on one of our favorite topics. Classes are the heart of Object-oriented programming.
We miss you Brackeys 🧡🧡🧡🧡🧡
Perfectly tackled classes and constructors in the same video. Very well made!
Anyone else also still learning using this course in 2021?
Yeah, I've learned a lot from him
Yep
The class Brackeys got over abruptly with the video on classes... but hope the class is used again :/
Thanks for this great tutorial series! I've been following it with one of my friends and we've been having a lot of fun with programming!
Thank you, you really taught me some good things about C#.
Your C# tutorials are really helpful for me.
You're awesome guys!
If your looking at the comments... your a legend!!
What about my a legend?
@@TheThursty100 your a legend to
@@n1gh1f1re my a legend to what?
You're*
@@browse7288 😄
"Awesome"
fun fact : this is the last tutorial in all brackeys channel, so i hope this viddeo will still work & all brackeys tutorials for the next 5 to 10 years for all the good young, & new game devs.
from 4 months later, Thanks Brackeys, we hope you are having a nice time as a Community.
I've been trying to understand classes for a while and this tutorial has helped me finally figure it out! Thank you Brakeys, and goodbye.
now this is the last tutorial video
:(
1:52 No patreon link in the description? 😳
Well, after the very, very LAST video I can understand it. 🥺😞
He said as he will not continue making any vids, he shut down the patron. But all of his other websites will be active. He is also active in his discord.
This is the best series I've ever followed. Now I've got a new skill!
Ahh. I just finished this c# tutorial series for game devolopment. But I am so sad cause this is the last tutorial on the channel. We missed you brackeys. Thanks for all things
I know this is pretty petty, but, a bit of the styling you said is wrong. Underscores are to denote either a field (a class/object variable) is to not be touched outside the property, or that it is only meant to be seen either internally or private. You should never use underscores for field names because that will be confusing. I mean, look at the main method header or anytime you create an object using a parametered constructor. None of them use that underscore for any of the parameters. Also, Pascal Casing for a "field" would tell me it is not a static field, but a property. Which, too, is seen throughout libraries and other C# programs.
Onto another issue I have with this. You have made fields public, this is a major no-no for classes. The only time a public field is acceptable is when it is a struct, not a class. The reason is that structs are a ValueType, this means that they reside on the stack when used inside a method, and in the heap when used outside the method. And whenever you pass a ValueType, you are making a copy of it. With a class, it is pass by reference. Classes only live in the heap and cannot live in the stack. Which means that no matter what, access to them is going to be slow since you have to go outside the stack (which is a linear region of memory) into the heap (which is not arranged in any way). If anyone who sees this wants to know how to choose between a struct (ValueType) and a class (ReferenceType), check out this StackOverflow answer (stackoverflow.com/a/1951243/9116918).
I agree with the first paragraph you wrote, especially the part where he says "it is standard practice to always capitalize the first letter in a static variable". But in the second paragraph, there are some more subjective parts. Using public variables in a class is not all bad. While yes it might be slower it is still easier and you have to remember this is a beginner's course. There is optimization that can be done for sure but teaching that to someone who does not even know what a class is would just overwhelm them with information and it's better to let them use this "worse" way for now and then teaching them another way later.
Then how would you add a value type to a class, if not via a field?
@@menyus777 That's the whole point. You don't. ValueType would have to be a Struct instead.
@@phoxsty Sounds kinda stupid a class should not contain value types? O.o
@@menyus777 It's because it is stupid. There are 3 basic rules to use a struct. 1: It should represent a single value (Unity, for instance, uses struct for Vector3, because it represents ONE coordinate, and for many other optimization reason). 2: It should be immutable. 3: It should not be boxed and unboxed frequently.
Unless you are excessively certain that a struct is the best option for your application, and I mean it (like that you know what is a readonly struct, you understand clearly the "in" parameter modifier, that you understand boxing and unboxing, that the specific needs you have require a struct like in DTO pattern, that you understand the importance of passing a struct by ref, that you care immensely about optimization (like in ECS, which would mean you understand what is a cache miss and what the cache line is), you should not even use a struct. If you are a beginner, you should know what a struct is, how to use it, but not declare one because "it's optimal". A slight messup in its usage and it becomes slower than a class.
So to conclude, value types in a class is as normal as clouds in the sky. If you pass a class as a parameter, you're only passing its reference (an int sized pointer), nothing else is passed, so chill.
Why is the thumbnail red
It scared me
Cuz it's the last vid
E02 was even scarier
It was light mode
Coding ID it truly was :(
These tutorial series have been great! Thanks a lot for the help!😁
This was an amazing tutorial-series. Done in a fun way and engaging!
Keep up the good work whatever it is!
Me watching tutorial: Damn this looks so easy, ill make magic out of this!
Me actually writes code: Omg castspell doesn't work pls help
i am new to game developing , i was watching dani and brackeys for a home month then i made my very first game kani-master.itch.io/reflex-color-switch Please try it and give me your feedback
@@gngamestudio man the link does work ._.
@@4ether607 i m very sorry , The game has many errors and I am now busy fixing it. You can download it from the same link when I complete it
@@gngamestudio did you delete your vids?
@@4ether607 ah yes ! I will upload a new version of the game within two days, Thanks for your interest!
I've been waiting (but how do I use this info in unity?)
Noodley Boi Everytime you write script in Unity, you are more or less writing a class but it inherits from mono behaviour, if you wanted to write your own class you just wouldn’t inherit from mono behaviour.
@@gower1973 that does help me but I just can't make the connection between text and a 2d or 3d landscape, with movement and stuff
You're supposed to write code that modifies the properties of a GameObject's components.
@@johnes2337 k thanks now I just need to figure out which components to refrence
@@happyman6701 you can play around with the components in the Unity Editor and you can also find out what each property means in the Unity documentation.
Completed this tutorial 3 years later. Thank you.
Console.WriteLine("F in the chat");
F
Console.Writeline("F");
int i = 0;
while (i == 0);
{
Console.WriteLine("F");
}
Please don't go :(
Great video! Thorough without being boring
Thanks for the awesome tutorial. I recommend this to anyone learning c#.
Fun fact the word long is shorter than short
8?
Final series thank you brackeys thank you for everything
thank you, i watched the whole series because unlick most codign tutorials, it was easy to follow along and fun to do the challenges at the end
Please continue this to higher lessons, it is very useful to us. Pls 😊
Thanks for these awesome videos Brackeys, it really help me getting started with programming and hopefully also making games.
I already wanted to start with the old series but couldn't stick to it, so the start of this new series was the perfect moment to start on what I was putting off.
i am new to game developing , i was watching dani and brackeys for a home month then i made my very first game kani-master.itch.io/reflex-color-switch Please try it and give me your feedback :)
Thank for these tutorials. Really helped me and im pretty sure it helped everyone else.
Thank you for making the concepts so crisp and simple
You made my struggle easier
with programming
thanks again
Best HomeWork assignement EVER! Thanks Brackeys!!!!!!!!!!!!!!!