Game Development Reference
In-Depth Information
3.
Assign the Hide From Spy layer to the Smoke, Small explosion2, and
PotatoAmmo prefabs as well.
4.
Save the scene, and save the project.
5.
Open the StartMenu Scene, and play through.
The newly added spy map helps the player reach his goal of eradicating the zombie horde, but it
probably shouldn't be visible the entire game, especially when the garden is hidden. You could set
it (the Camera component) to hide and show with a keyboard toggle, just as you did with the main
menu. Or you could have it automatically appear when the zombie bunny count dropped to, say, 5.
By putting it in the Garden 1 group, it will be visible only if the garden area is visible.
1.
Drag the Camera Spy View into the Garden 1 group.
2.
Enable the Garden 1's Hide At Start component again.
3.
Open the ScoreKeeper script.
4.
Add the following variable:
public Camera cameraSpyView; // the spy map camera
In the UpdateCount function, below the if (currentBunCount == 0)
conditional, add
5.
// show spy map
if (currentBunCount <= 5) cameraSpyView.enabled = true;
else cameraSpyView.enabled = false;
6.
Save the script.
7.
Back in the GardenLevel1 scene, assign the Camera spy View in the Game
Manager's Score Keeper component.
If the garden has been secured, you can hide the spy map.
In the GardenSecure function, below the TriggerMessage line, add
8.
cameraSpyView.enabled = false;
9.
Save the script.
10.
Disable the Camera Spy View's Camera component, and save the scene.
11.
Return to the StartMenu scene, and play through.
The spy map functionality adds to the game with a nominal amount of effort. There are, of course,
lots of options as to how it could have been handled. One variation could allow the player to toggle
the map on and off, but increase the battery drain while it is being displayed.
 
Search WWH ::




Custom Search