Game Development Reference
In-Depth Information
Playtesting
For playtesting, you will need to get a few assets from the Unity Asset Store for the
sound effects, background music, and atmospheric sounds. These are the ones I re-
commend that you use for this example:
•
Future
Weapons
Fantasy
Music
Collection
(Starter)
:
Combat
Collection
Starter
Edition
:
Sample
First, create an empty GameObject, name it
RunningSource
, and add an audio
source to it; this can be done by navigating to
Add Component
|
Audio
|
Audi-
oSource
. On the main camera, add
AudioSource
if there is none. Next, add the
SFX_Manager
script to the camera. For its values, set the following:
•
SFX
volume to
1
•
Run
to
footsteps_runcarpet_1
•
Spell
to
shot_hand_gun
•
Strike
to
whoosh_power_fist
•
Run Source
to the
RunningSource
GameObject
Now open the
SFX_Manager
script and add the
Update
function:
public void Update()
{
if(Input.GetKey(KeyCode.W))
pRun();
if(Input.GetButtonUp("Fire1"))
pStrike();