The player can now enable or disable sound. It would be even better if they could adjust the game's music and sound effect volumes separately. We can do that!
Before we continue, we'll use the sound toggle box we just created to build a new container box for our future sliders:
With our
Options
|Sound
GameObject selected, hit Ctrl + D to duplicate it:Rename our new duplicate to
Volume
Set its Transform position to
{550, -220, 0}
Select the
Volume
|Label
GameObject:Change Text to
Volume
Now, select our
Volume
|Checkbox
GameObject and delete it.
We are now ready to create our first slider.
Drag the
Colored Scrollbar (1) from our Prefab Toolbar inside our new Volume
GameObject in the Hierarchy view, as shown in the following screenshot:
A new slider appears on the scene. Hit Unity's play button. The slider's thumb can be dragged along the horizontal axis. You may also click anywhere on the slider to jump to the pointed position. The current amount is displayed as a...