Game Development Reference
In-Depth Information
In the Start function, assign one of the clips:
3.
int num = Random.Range(0,soundFX.Length);// get a random number
audio.PlayOneShot(soundFX[num]); // play that element
4.
Save the script, and add it to the Toasted Zombie Parent prefab.
5.
Set the Sound FX array Size to 4.
6.
Load the BunnyScream clips into the array.
7.
Click the Browse button for the Audio Clip, and select None.
8.
Click Play, and test the new sound FX.
Shuriken Particle System
With a toasted dead replacement left in place of the original zombie bunny, a bit of black smoke
to mark incendiary spot would be just the thing! This time you will be using the Shuriken Particle
system to create the special effects. The Shuriken system is a lot more intuitive to use if you are
already familiar with particle systems. It has a lot of parameters, complete with invasive tool tips;
nonetheless, it can be intimidating. Fortunately, Shuriken is a lot more editor-friendly while setting
up the system.
Smoke
The most basic of particle systems is smoke. Particles drift slowly upwards, fanning out, getting
larger and fading out as they near the end of their lifetimes.
1.
From GameObject, Create Other, choose Particle System.
2.
Name it Smoke .
A rising funnel of cotton balls appears in the viewport (Figure 8-17 ).
 
Search WWH ::




Custom Search