Game Development Reference
In-Depth Information
You will eventually be setting the color according to the percent remaining.
11.
Set the Y Scale back to 1 and the Color back to white.
Cameras and Layers
By now, you have probably noticed that, unlike the GUI Text objects, the sprites are not showing
in the Game view. To have a 3D scene overlaid by 2D sprites, you will be using a second camera.
This will allow you to keep the sprites together and scaled to the scene regardless of what the Main
Camera is looking at.
1.
Create a new camera, and name it Camera GUI .
2.
Remove its Audio Listener component.
The Game view now shows the view from the new camera, but as yet, no battery. The mystery can
be quickly solved with a quick trip back to the 3D scene.
3.
Toggle the scene back to 3D, and switch to a Perspective Top view.
You can now see where the sprite exists in the 3D world and that the camera must be moved back
for the battery to come into view (Figure 9-17 ).
Figure 9-17. The camera and sprites in 2D space (left) and in 3D space (right)
4.
Move the camera back until the Battery appears in the Game view (Figure 9-18 ).
Figure 9-18. The battery sprites visible in the Game view
 
Search WWH ::




Custom Search