Book Image

Unity Game Development Scripting

By : Kyle D'Aoust
Book Image

Unity Game Development Scripting

By: Kyle D'Aoust

Overview of this book

Table of Contents (17 chapters)
Unity Game Development Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding all the sounds


Now we will add the background music and atmospheric sounds.

Playing the background music

Create a new empty GameObject and name it Audio_Manager. Drag-and-drop the BG_Music_Manager script on it. For this game, I will only use one song, so set the size of the Song List to 1 and add a song. If the volume isn't already set, set it to 1 as well. Before you can move on, you need to add an Audio Source component to this object. To do this, click on the Add Component button, click on the Audio option, and finally click on the Audio Source option.

Adding the atmospheric sounds

Next, we will add the atmospheric sounds. To do this, we will use a similar process as the background music. Create an empty GameObject and drag-and-drop the ATM_Manager script on it. Set the size of TmpList to 2 and add two sound clips. I am using Open Space Wind1 – 32 Seconds and Open Space Wind2 – 36 Seconds from the sound clips we got in Chapter 8, Aural Integration. Set the Keys size to 2, then set...