Game Development Reference
In-Depth Information
if(GUI.Button(new Rect(700, 475, 150, 50),
"Options"))
GetComponent<Config_GUI>().optionsGUI =
true;
if(GUI.Button(new Rect(700, 550, 150, 50),
"Quit Game"))
Application.Quit();
}
GetComponent<Config_GUI>().OnGUI();
}
For this script, all that you will need is the OnGUI function. This code will create a
few buttons that will be used to either play the game, show the options menu, or exit
the game. Save this script and drag it to the main camera as well. When you run the
scene, you should be able to see buttons similar to the ones shown in the following
screenshot:
Search WWH ::




Custom Search