Game Development Reference
In-Depth Information
Fig 4.14 Changing the size of a font.
Step 17. Modify finish.js to include some code to display a GUI as
shown in Listing 4.23 .
Listing 4.23 Displaying a Simple GUI with a Score
var duckCount = 0;
var myStyle: GUIStyle;
function OnGUI ()
{
GUI.BeginGroup (Rect (Screen.width / 2 100, 10, 250, 70));
GUI.Box (Rect (0,0,250,70), "Duck Herding");
GUI.Label (Rect (10,10,250,70),"Score", myStyle);
GUI.EndGroup ();
}
function OnTriggerEnter(collision: Collider)
{
...
}
Search Nedrilad ::




Custom Search