Game Development Reference
In-Depth Information
Step 11: Save and return to Unity. Fix any syntax errors that pop up in the
console.
Step 12: Test the game. As the player walks up to the key (inside the large
dome-like room) or the power closet (down the long hall and in the closet
to the left of the loading bay), the objects should highlight bright white as
the crosshairs go over them ( Figures 14.7 and 14.8 ).
Figure 14.7 Highlighted
power switch.
Figure 14.8 Highlighted key.
Turning on the Lights
Now that we've highlighted that actionable items, we need to make an
action happen when they are clicked. The first thing we're going to do is
make the scene so that when the player enters the scene all the lights are
turned off. The player will be able to use a flashlight to find his way to the
closet where the main power switch is on (the one we created the highlight
mechanism for). When the player clicks on the highlighted switch, the
switch itself needs to animate, and then the lights need to come on. We
will build all this into our current script. However, before we continue on
with the script, let's make some adjustments to the scene file to make this
mechanism work.
Search WWH ::




Custom Search