Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 03, 2015 at 04:45 AM by fafase for the following reason:

Question is a programmatic issue that has plenty of explanations online.

avatar image
2
Question by xxBarginsxx · Mar 03, 2015 at 12:50 AM · gameclassesswitchswitch-casescripting-underthehood

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!

Comment
Comments Locked · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cariaga · Mar 03, 2015 at 01:13 AM 0
Share

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.

Switch vs if else

avatar image Glurth · Mar 03, 2015 at 01:25 AM 0
Share

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

avatar image xxBarginsxx · Mar 03, 2015 at 03:44 AM 0
Share

Thanks mate :)

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges