C# Switch Statements in Unity! - Beginner Scripting Tutorial

  Рет қаралды 78,459

Unity

Unity

Күн бұрын

Пікірлер: 75
@omaralkaley222
@omaralkaley222 5 жыл бұрын
And by finishing this video I finally finished the series of c# for beginners
@indieprogress7170
@indieprogress7170 5 жыл бұрын
nice
@magnusm4
@magnusm4 4 жыл бұрын
I already knew the whole beginner series. The problem is remembering how to write them and exactly what they do XP I can go a whole month coding and only later try to use a switch statement. Problem is I have nothing yet that compares a single variable only multiple
@IDontReadReplies42069
@IDontReadReplies42069 4 жыл бұрын
Great! now go try and make a game and get frustrated because every example code is gibberish to you, because there's no middle ground between knowing basic syntax/operators and being able to actually program something LOL
@QuackersMcCrackers
@QuackersMcCrackers 4 жыл бұрын
human.intelligence += 5;
@SirRelith
@SirRelith 5 жыл бұрын
I wish Unity would put out more advanced tutorials that go over the modern versions of their software.
@indieprogress7170
@indieprogress7170 5 жыл бұрын
agreed.
@IDontReadReplies42069
@IDontReadReplies42069 4 жыл бұрын
it wouldn't really be worth their time, because if you're actually advanced you can just read through the API or manual much faster than someone explaining something to you
@neillunavat
@neillunavat 4 жыл бұрын
Agreed.
@ThunderStormFortnite
@ThunderStormFortnite 2 жыл бұрын
@@IDontReadReplies42069 who the hells needs to be advanced to do a quick search
@NathanRohner
@NathanRohner 5 жыл бұрын
For years I have been using if statements, knowing there's a better way. Today I finally found a simple alternative 😭🙏
@indieprogress7170
@indieprogress7170 5 жыл бұрын
Switch statements are awesome, especially when using them with Enums.
@NeverEverTM
@NeverEverTM 4 жыл бұрын
i just discovered switch after someone rant someone else beacuse he wasnt using switches xd
@Atlas-bu4vh
@Atlas-bu4vh 4 жыл бұрын
@@NeverEverTM Are you talking about yandere dev ?
@klickklack_pron9504
@klickklack_pron9504 4 жыл бұрын
@@NeverEverTM deadass tho
@soaringsquid0.129
@soaringsquid0.129 4 жыл бұрын
Should we stop using if statements?
@comradeviper4054
@comradeviper4054 4 жыл бұрын
Somebody show this to yandare dev...
@brandonfleming7118
@brandonfleming7118 4 жыл бұрын
Exactly what I was thinking. I am amazed he hasn't used switch statements. It would increase the FPS ten fold.
@ottersaurus
@ottersaurus 4 жыл бұрын
BrandonFleming Actually if you look at the performance even if he did switch all his if else statements to switch statements the game wouldn’t speed up by much. The compiler is also smarter than you where it will detect and use switches if you’re using too many if else statements. Source: Yandere Simulator Complete Source Code Analysis - Code Review
@brandonfleming7118
@brandonfleming7118 4 жыл бұрын
@@ottersaurus Wow, didn't know that. Thanks!
@behindthepickle
@behindthepickle 4 жыл бұрын
He's the reason I thought to look up this video before doing an if statement XD
@hasanmuttaqin464
@hasanmuttaqin464 3 жыл бұрын
@@behindthepickle y know wha? dam, we same
@zealot4325
@zealot4325 4 жыл бұрын
Thank you for this course. Now i feel myself a bit more confident about scripting
@josh_swanson
@josh_swanson 5 жыл бұрын
Sir, don't talk down on yourself. You are definitely of high intelligence!
@aquaarmour4924
@aquaarmour4924 5 жыл бұрын
It's called humor.
@brummi9869
@brummi9869 3 жыл бұрын
"As I am not of particularly high intellignece myself" he says while explaining me C sharp code
@laz3664
@laz3664 4 жыл бұрын
3 yandere dev fans have disliked this video
@ShatabdaRoy115
@ShatabdaRoy115 2 жыл бұрын
lol
@gadgetboyplaysmc
@gadgetboyplaysmc 4 жыл бұрын
I actually reached the end.
@explior6558
@explior6558 4 жыл бұрын
Thank you! Clear, simple, efficient!
@MarchalisVan
@MarchalisVan Жыл бұрын
Now I realize why I have never really run into this. Those switch moments are always one offs in any of my code, rather than asked every Update (negligible). Also, most of the time I might look for a "range" with < or >, or need a calculation done for the next check, also think of Raycast checks as well. Actual sufficiently beneficial use case for a switch opposed to using "else if" is really low in moooooost game scenarios. And computers are so fast these days that an int check with "else" if is practically free. I mean test it, run 10 else if statements (All wrong) ending with else in Update, so it checks them all. then copy paste 1000-10,000 times and see what the performance drop is lol, probably 0 loss in frames.
@fuzzy-02
@fuzzy-02 4 жыл бұрын
Did this cover all code of unity in C# or the videos stopped coming out please all mighty Unity gods heed my calls
@wadewarman6063
@wadewarman6063 Жыл бұрын
For some reason, the switch statement doesnt actually print to console for me. Anyone have any advice? Thanks!
@j_lucas8422
@j_lucas8422 7 ай бұрын
Print was just a demonstration, if you're using Unity change print to "Debug.Log()"
@thapelomokoena1953
@thapelomokoena1953 4 жыл бұрын
Yandare dev knows this. They have switch statements and if statements for the same thing
@templetherapy
@templetherapy 4 жыл бұрын
These were great
@sashmaster3433
@sashmaster3433 4 жыл бұрын
200 iq guide. Yes. But actually I already forgot everything.
@moonglowmelodies7336
@moonglowmelodies7336 4 жыл бұрын
Sash Master take a screen shot then
@6959-n6n
@6959-n6n 3 жыл бұрын
Someone: Hi there! The Character: Grog SMASH!
@relhimp
@relhimp 5 жыл бұрын
Wanna use object's type as switch? Make a dictionary with type keys.
@Quellrid
@Quellrid 4 жыл бұрын
Case 2 is reference to Critical Role?!
@SketchyCreaseURL123
@SketchyCreaseURL123 4 жыл бұрын
i thought same lol
@karacter3369
@karacter3369 3 жыл бұрын
yo babeeee finisheeddd
@ngoquangao1803
@ngoquangao1803 5 жыл бұрын
Done!
@CowboyCola6
@CowboyCola6 2 жыл бұрын
finished,yeah!
@Yes-ok5me
@Yes-ok5me 4 жыл бұрын
wow just finished and made unity easily to me
@unity
@unity 4 жыл бұрын
We're so glad to hear that, what's your next step?
@Yes-ok5me
@Yes-ok5me 4 жыл бұрын
@@unity if you could help me it will be thanksfull im good at unity but now know it better and easiy another question could i create non games apps for android its ok???
@MEGA_TREE
@MEGA_TREE 2 жыл бұрын
Good programming
@WerIstWieJesus
@WerIstWieJesus 5 жыл бұрын
I Like those videos. But here the example was not so good. If all cases between 1..5 are examined it is much more efficient to use an array of strings to address directly the good answer with the integer "intelligence" after having verified that "intelligence is in the range.
@justincash1181
@justincash1181 5 жыл бұрын
WerIstWieJesus an array has a set data type and no default (thought it wouldn’t be hard to create a default, just inconvenient)
@marcof.4812
@marcof.4812 4 жыл бұрын
Anything can be optimized but these video are meant for beginners, I believe the goal is to best explain how switch statements work. I appreciate your suggestion though!
@fuzzy-02
@fuzzy-02 4 жыл бұрын
Thats verry smart
@hpenvy15
@hpenvy15 6 ай бұрын
Thank you good sir! Super easy to understand and finally i think i could use it. Intelligence 1; blabliplarbrbrbr ❤
@TheFingledorf
@TheFingledorf 4 жыл бұрын
"greeting based on intelligence" - Fallout? ;)
@piipitkanen3080
@piipitkanen3080 5 жыл бұрын
do next how get blocks moving :) and why it comes only errors when i do somebady command :( tell me plz
@happypixel6914
@happypixel6914 4 жыл бұрын
What...?
@zachdavis6624
@zachdavis6624 2 жыл бұрын
If only unity and intellisense actually worked well together...
@_aralgames_1986
@_aralgames_1986 5 жыл бұрын
When russian subtitres?
@athanasiusrisang
@athanasiusrisang 3 жыл бұрын
YandereDev needs to watch this video if he wants his game to have better performance.
@Nikkcoaaa
@Nikkcoaaa 4 жыл бұрын
YandereDev need see that vide
@lollipopofdoom6927
@lollipopofdoom6927 4 жыл бұрын
Gilb blu bll bub?
@RodMen_89
@RodMen_89 Жыл бұрын
and why not just simply put: if(inteligence==5) { print } else if(inteligence==4) { print}...?
@anaislake
@anaislake 5 жыл бұрын
hello darlings, i am more than a mom, but humbly i submit that there is one huge error in this tutorial for beginners. the script names wrongly named shows up in the autofill in visual studio. this is a total pain, eg. transform. even if you rename the script, i am unsure how to remove an autofill class. you can see that autofilling and typing Trans you immediately get this script and have to click off and it is quite tiresome. also, as i am venus in virgo and in fact today venus is in virgo, my perfectionism wants you to know that future beginner lessons can be much improved by simplifying the scene with just a plane and cube. no need for the other drama when teaching beginning concepts. thank you and good day and happy full moon in pisces and happy friday the 13th.
@NeverEverTM
@NeverEverTM 4 жыл бұрын
One question... uh *_Edited what_*
@Andrelas11
@Andrelas11 4 жыл бұрын
I thought the video was a bit hard to follow but then I came here and I feel much better about the video now lol. ;P
@skitskiti2940
@skitskiti2940 5 жыл бұрын
Здрасте
C# Classes in Unity! - Beginner Scripting Tutorial
6:33
Unity
Рет қаралды 128 М.
Learn C# BASICS in 10 MINUTES!
10:55
Code Monkey
Рет қаралды 794 М.
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 10 МЛН
C# Enumerations in Unity! - Beginner Scripting Tutorial
4:27
🔍 When and How to Use Switch Statements in C#: Tips and Tricks 💡
11:49
C# Loops in Unity! - Beginner Scripting Tutorial
6:32
Unity
Рет қаралды 121 М.
12. How to program in C# - ENUMS - Beginner Tutorial
10:34
Brackeys
Рет қаралды 197 М.
C# in 100 Seconds
2:27
Fireship
Рет қаралды 2,1 МЛН
What is JSON?
7:00
Code Monkey
Рет қаралды 96 М.
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47