Você está na página 1de 1

// DGH1 // Oisin Bourke var mainmenuSkin : GUISkin; //Skin object var areaWidth : float; //GUI Area Width of window

var areaHeight : float; //GUI Area Height of window // This function is reserved for creating a GUI function OnGUI() { //The next line sets the GUI skin to the template is set in the mainmenuSkin var iable, in this case my custom background GUI.skin = mainmenuSkin; //finds horizontal center of screen, halves screen width and halving wid th of button container, subtracting that from screen width. var ScreenX = ((Screen.width * 0.5) - (areaWidth * 0.5)); // finds screen height and halves the container height off of it. var ScreenY = ((Screen.height) - (areaHeight * 0.5)); // This next line is the invisible button container GUILayout.BeginArea (Rect (ScreenX, ScreenY, areaWidth, areaHeight)); // These statements give the Play and Quit buttons, Play button is attac hed to my main scene "OisinSceneforNoel1". // The quit button will only work in a standalone build if(GUILayout.Button("Play")) { Application.LoadLevel("OisinSceneforNoel1"); } if(GUILayout.Button ("Quit")) { Application.Quit(); } GUILayout.EndArea(); }

Você também pode gostar