Game Development Reference
In-Depth Information
GUI.Box (Rect (0,0,80,60), "Score");
GUI.Label (Rect (0, 20, 80, 30), String.Format("{0:0}",
GUI.EndGroup ();
Step 11. Save and select the main camera in the Hierarchy. Locate the
score script component in the Inspector and, at the very bottom set
under scoringObjects, set size to 4 and assign the values for the array
of beaker spheres by dragging and dropping each one in place as
shown in Figure 4.9 .
Fig 4.9 Adding game objects
to an array in another script.
Step 12. Save and play. Your game now keeps score.
Step 13. Save the scene (File Save Scene) and double-click on the
mainmenu Scene in the Project.
Step 14. Open mainmenu.js in the script editor. This script is
attached to the main camera and displays a small menu with a
play button. Play to see this appear on the screen. Click on the play
button and it will take you to the maingame Scene. To swap scenes,
Search Nedrilad ::

Custom Search