- Home /
Question is a programmatic issue that has plenty of explanations online.
How do switch() statements work?
This may sound like a butt-stupid question, but I never used switches in my life...
How do they work? If you got some good YouTube videos show thanks :) I can't find any good unity or c# switch videos...
Thanks again guys!
let me put it this way its pretty much like if else if and else but simplfied. if you ask me i rather use if and else rather than a switch statement. in terms of nano performance both can beat each others depending on how you use it but keep in $$anonymous$$d this happens in nano seconds so you wouldn't even notice it.the brake;
in a switch statement is similar to else if while the case;
is like a if with a statement.
I think a video might be overkill for explaining how a switch statement works. $$anonymous$$gest you review these two pages & come back with any specific questions. Nothing special about UNITY and switch statements.
https://msdn.microsoft.com/en-us/library/06tc147t.aspx http://www.dotnetperls.com/switch
Follow this Question
Related Questions
Switch statement not running on every frame 1 Answer
What is a more efficient way to write this Switch Statement? 3 Answers
How do i make my code better? (switch statement) 2 Answers
Trying to check "if >" in a switch statement 2 Answers
Help me with this JavaScript class please(Script inside) 2 Answers