Among the extra features we are adding to the prototype, we'd like to provide an example of options screen functionality by showing you how to set up a horizontal slider to control the volume of the background music carpet.
For this recipe, we will use the bkgd_01 audio clip we imported at the beginning of this chapter. Open your project in Unity and ensure that bkgd_01 is configured in the Inspector window, as we did in the first recipe of this chapter.
To make Option Screen for the prototype, we begin by creating a new scene and naming it Option Screen.
Next, add an empty game object to the scene and name it GUI.
Add an Audio Source component to the GUI game object in the scene. Remember that whenever you want a game object to play a sound, an Audio Source component must be attached to it.
Now we add a script to the game object, with the instructions to draw the interface and control its functionality. Create a new C# script and name...