Game Development Reference
In-Depth Information
Note More information on the Sprite Editor can be found in the online Unity documentation at
http://docs.unity3d.com/Documentation/Manual/SpriteEditor.html .
Step 7: Importing Audio
Next, it's time to import audio assets into the project. The topic companion files for CMOD feature
only a few audio sound effects, created using the sound generator tool SFXR , which can be
downloaded for free from www.drpetter.se/project_sfxr.html . SFXR is software for procedurally
generating the kinds of sound effects commonly used in old-school video games, such as the
original Super Mario Bros. and Sonic the Hedgehog . For CMOD, there are a total of four sound
effects, all in WAV format, stored in the Chapter2/AssetsToImport/Audio folder. These include
Explosion.wav , played whenever enemies are destroyed; Powerup_Collect.wav , played whenever
the player collects a power-up object, such as cash or a weapon; Weapon_Gun.wav , played whenever
the player fires the gun weapon; and finally, Weapon_Punch.wav , played whenever the player uses the
default punch weapon. Go ahead and import all these sound effects into the Unity project, using
the conventional drag-and-drop method. Make sure the sounds are added to the Audio folder in the
Project panel (see Figure 2-16 ).
Figure 2-16. Importing retro-style audio assets into the project. The audio assets for this topic were generated using the free
program SFXR
Every audio file for this project shares an important characteristic that requires us to adjust the
default import settings applied to them. Specifically, every audio file will be 2D and not 3D . That is,
none of our sounds are located at any specific 3D position in the scene. We don't want or need their
volume to raise or lower based on the nearness or farness of the Player from others in the world.
Rather, the sounds should simply play in all speakers at a single and constant volume. Their purpose
is primarily that of feedback for the Player's actions in-game, such as collecting a power-up or firing
a weapon. To adjust the default import settings to reflect this, select all imported audio assets, and
disable the 3D Sound check box from the Object Inspector (see Figure 2-17 ). Once completed, all
audio assets are now successfully imported and configured ready-for-use in the scene.
 
Search WWH ::




Custom Search