Game Development Reference
In-Depth Information
There is going to be a number of scripts in this scene, therefore I am going to reveal them
in a specific order that delays the scripts which have dependencies. So I am going to begin
with independent scripts that do not need to reference other scripts. Therefore I am going to
leave the shuttle for a while to discuss the targets that our shuttle will be shooting. We are
going to use prefabs to create targets, since we are going to have a relatively large number
of targets in the scene, and it would be great to be able to handle these objects from single
place.
To create the target prefab, add a cube to the scene. We are going to add the script Target
to this cube, which has only one variable called hit . hit is a boolean value that determines
whether the target has already been hit or not. The script Target is shown in Listing 15.
Search WWH ::




Custom Search