September 2010
Beginner
384 pages
8h 49m
English
We're going to add a button to the title screen through code, using Unity's built-in OnGUI function.
Update function any longer. Instead, we'll be using the built-in OnGUI function. Change the word Update to OnGUI:var customSkin:GUISkin;
function OnGUI() {
}
OnGUI function:var customSkin:GUISkin;
function OnGUI() {
if(GUI.Button(Rect(0,0,100,50),"Play Game")) {
print("You clicked me!");
}
}
A button labeled Play Game appears at the top-left of the screen. When you click on it, ...
Read now
Unlock full access