Graphics Reference
In-Depth Information
// set the quality setting
QualitySettings.SetQualityLevel( (int)graphicsSliderValue,
true);
}
void OnGUI()
{
float resX = Screen.width / default_width;
float resY = Screen.height / default_height;
GUI.matrix = Matrix4x4.TRS (new Vector3(0, 0, 0),
Quaternion.identity, new Vector3 (resX, resY, 1));
// set the GUI skin to use our custom menu skin
GUI.skin= menuSkin;
switch(whichMenu)
{
case 0:
GUI.BeginGroup (new Rect (default _width / 2 - 150,
default _height / 2 - 250, 500, 500));
// All rectangles are now adjusted to the group.
// (0,0) is the topleft corner of the group.
GUI.Label(new Rect( 0, 50, 300, 50 ),
gameDisplayName, "textarea");
if(GUI.Button(new Rect( 0, 200, 300, 40 ),"START
SINGLE", "button"))
{
PlayerPrefs.SetInt( "totalPlayers", 1 );
LoadLevel( singleGameStartScene );
}
if(coopGameStartScene!="")
{
if(GUI.Button(new Rect(0, 250, 300,
40 ),"START CO-OP"))
{
PlayerPrefs.SetInt("totalPlayers",2);
Load Level( coopGameStartScene );
}
if(GUI.Button(new Rect(0, 300, 300, 40 ),"OPTIONS"))
{
ShowOptionsMenu();
}
} else {
if(GUI.Button(new Rect(0, 250, 300, 40 ),"OPTIONS"))
{
ShowOptionsMenu();
}
}
if(GUI.Button(new Rect(0, 400, 300, 40 ),"EXIT"))
{
Search WWH ::




Custom Search