Game Development Reference
In-Depth Information
Figure 10-37. The Settings menu
10.
Be sure to check the placement of the extra scene objects with “Maximize
on Play” turned on.
11.
Save the Scene.
Next, you will be adding some of the functionality controlled by the sliders. The difficulty will be
updated according to its value when you are in the regular garden levels. You will have to provide a
sound for the player to adjust in this level. Let's begin by checking up on the values of the two sliders.
Add the following line at the bottom of the OnGUI function:
1.
print (diffSliderValue + " " + ambSliderValue);
2.
Save the script.
3.
Adjust the sliders, and watch the new values being reported in the console.
The sliders stay within their respective ranges and are updated dynamically. To test the ambient
sound volume, you must have an audio clip to sample.
1.
Stop Play mode.
2.
Add an Audio Source component to the Settings Menu object.
3.
Assign the Birds audio clip as its clip.
4.
Set it to Loop.
 
Search WWH ::




Custom Search