C# Switch Statements in Unity! – Beginner Scripting Tutorial

17
1



Watch this video in context on Unity Learn:

Switch statements act like streamline conditionals. They are useful for when you want to compare a single variable against a series of constants. In this video you will learn how to write and use switch statements.

Nguồn:https://wijstaanvooronzegrondrechten.org/

17 COMMENTS

  1. question when doing this tutorial are you supposed to attach it to a game object so that it can produce the text on the console or what do i attach the script to? or does the script even produce a text that is shown? please help :<

  2. 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.

  3. 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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here