Game Development Reference
Step 14. The if statement around the button checks for when it is
pressed. Application.LoadLevel causes another scene to be loaded.
The name given to this function MUST be exactly the same as the
name of the scene as it appears in the Project.
Step 15. Before testing the code, the scenes need to be linked in the
build settings. Select File > Build Settings. At the top of the window is
a large area called Scenes in Build. Any scenes that will be in the final
game must be added to this area. You can do this by dragging the
scenes from the Project into the space, as shown in Figure 6.4 .
FIG 6.4 Add scenes to the game
Step 16. The scene at the very top is the one that will open first when
the application is built and run. However, if you are in the Unity Editor,
the scene currently open will be the one run. That way you don't need
to navigate through the scenes each time you want to test something
in the current open scene.
Step 17. With the game scene open, press Play. A Back Button will
appear in the top left corner. Press the button. It will take you back to
the main menu scene. Buttons on the main menu will not take you
anywhere as they are not programmed to do so.
Step 18. Create another scene for the help screen and add a back
button to it. Link up all menus in all scenes such that you can navigate
around the game environment. The function for the quit button is
Application.Quit(). It won't work in the Editor or Web player versions,
but can be tested with the other platform versions.
Step 19. To modify the look of the GUI components, a style can
be added. This allows you to set the color, font, and highlighting