It would be great to add a checkbox to enable or disable sound for the game. Before we continue, let's prepare a container box for our future checkbox:
Select our
UI Root
|Options
GameObject.Create a new child empty GameObject by pressing Alt + Shift + N.
Rename this new empty GameObject to
Sound
.
We'll add the UISprite
component to our new Sound
holder GameObject to create the sound toggle's box background.
Select our UI Root
| Options
| Sound
GameObject:
Click on the Add Component button in the Inspector view.
Type in
sprite
with your keyboard.Select NGUI Sprite with your keyboard arrows and hit Enter.
Follow these steps to configure the new UISprite
component on our Sound
GameObject:
Select the Wooden Atlas for the Atlas parameter.
Change Sprite to Highlight – Thin.
Change the sprite Type parameter to Sliced.
Change its Color Tint parameter to
{R: 180, G: 125, B: 50, A: 255}
.Set Size to 460 x 280.
Set its Transform position to
{550, 85, 0}
.