Game Development Reference
In-Depth Information
these will be included, and by importing the CCTV_Cameras Unity Package
earlier, you installed some of these scripts within the project. The entire
Detonator package is available at http://unity3d.com/support/resources/
unity-extensions/explosion-framework . It's a package that includes scripts,
textures, and sample prefabs for all sorts of explosions. The prefabs can
be dropped into a scene, or (as in this case) the particular features desired
for an explosion can be plucked from the menu of Detonator scripts and
dropped on the object you wish to explode.
Some Detonator functionalities (heat wave) are Pro-only features, but most
things work just fine in Unity as well. In this broken version of the camera, I've
dropped on the Detonator script and the Detonator Sparks script (with a few
minor tweaks to color and size). To see the explosion in action, just play the
game and the explosion will fire ( Figure 15.19 ). In fact, what's happening is
the explosion fires when this broken version of the camera (Hallway_CCTV_
Broken) is instantiated. In the upcoming script we will instantiate this broken
version of the Camera when it is shot, which will trigger the explosion and
hide the swap of objects.
Step 10: Explore the broken version of the CCTV camera (in Scenography
Assets called Hallway_CCTV_Broken). Drag it out anywhere in the scene,
select it, and press F on the keyboard to focus on it ( Figure 15.18 ). Notice
Figure 15.18 The broken camera.
Figure 15.19 When playing the
game, the Detonator scripts attached
to the camera will fire.
Search WWH ::




Custom Search