O'Reilly logo

HoloLens Beginner’s Guide by Jason Odom

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating the Update() method

In this section, we will change the Update() method, and then using a Switch statement, change the overall flow of our application.

About the only thing that will not change in the update is the debugTextMesh line at line 70, we are using it a bit more as you will see shortly.

A switch statement is like a gate controller. The programmer calls switch (with a variable) with a number of case statements or potential outcomes. Depending on the value of the variable determines which gate opens up. 

For instance, using the MusicVolume given in the preceding section as an example:

 Switch(myMusic) { case MusicVolume.Loud: { //make the volume loud } break; case MusicVolume.Medium: { //make the volume medium } break; } ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required