Toggle
Now that we have a volume slider, let's add an enable/disable sound checkbox, which will turn down the volume to 0 and hide our volume slider.
First, create a toggle widget as follows:
Select the Panel GameObject and create a new child with Alt + Shift + N.
Rename that new child as
Sound
. It will be our sound toggle container.Navigate to NGUI | Open | Widget Wizard and perform the following steps:
Select Toggle as Template.
Select the Dark Sprite as Background.
Select the X Sprite as Checkmark.
With the Sound container selected, click on the Add To button.
A checkbox with a label has just been created as shown in the following screenshot:
Parameters
Select our new Toggle GameObject. Let's look at the UIToggle's Inspector parameters:
Group: This is the toggle's group. Toggles of the same group will act as radio buttons; only one of them can be checked at once.
Start State: This defines in which state the toggle will be at the start.
Animation: This is the animation that will play when the checkbox...