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; } ...

Get HoloLens Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.