Game Development Reference
In-Depth Information
Delete or comment out the print line that follows it.
11.
Delete or comment out the int currentBunCount = 0 declaration.
12.
13.
Save the script.
14.
Click Play, and watch the printouts as the zombie bunnies are added to
the scene.
Now you can head back to the ReceivedHit script and have it report deceased zombie bunnies.
1.
Open the ReceivedHit script.
2.
Add the following variable:
public GameObject gameManager; // the master repository for game info
Find the Game Manager in the Start function:
3.
gameManager = GameObject.Find("Game Manager"); // identify and assign the Game Manager object
In the DestroyBun function, add the following:
4.
// send the amount to update the total
gameManager.SendMessage("UpdateCount",-1, SendMessageOptions.DontRequireReceiver);
5.
Save the script.
6.
Click Play, and test the new functionality.
This time the count goes down with each ravenous zombie bunny you destroy, inspiring you to shoot
as many as possible.
7.
Stop Play mode.
Particle Systems
Without special effects, your game is probably a bit boring. Sound effects are relatively easy to add
and have a big impact on the enjoyment factor. Pyrotechnics can add even more excitement and
incentive. In 3D games especially, these will usually involve particle systems. Particle systems are
used for creating smoke, fire, dust, and many specialty effects requiring a large number of similar
objects. While they can utilize 3D meshes, they most often are images on a quad (two triangles). The
way the images are blended together at runtime lets you create a large variety of effects.
Legacy Particle System
While the legacy particle system is older than the newer Shuriken system, it continues to be useful
for a couple of reasons. The first is that there are a great number of prefabs that can get you up and
running [exploding] very quickly. The second reason is that they, unlike the newer Shuriken, have a
parameter that will kill them when they have finished emitting.
 
Search WWH ::




Custom Search