O'Reilly logo

Unity 5.x Cookbook by Chico Queiroz, Matt Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding volume control with Audio Mixers

Sound volume adjustment can be a very important feature, especially if your game is a standalone. After all, it can be very frustrating to access the operational system volume control. In this recipe, we will use the new Audio Mixer feature to create independent volume controls for Music and Sound FX.

Getting ready

For this recipe, we have provided a Unity package named Volume.unitypackage, containing an initial scene featuring soundtrack music and sound effects. The file is available inside the 1362_09_05 folder.

How to do it...

To add volume control sliders to your scene, follow these steps:

  1. Import Volume.unitypackage into your project.
  2. Open the Volume scene (available in the Assets | Volume folder). Play the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required