Сожалеем, но текст оригинала доступен только зарегистрированным пользователям. |
|
|
|
|
|
|
|
|
|
|
|
void Start() { // set up default options, if they have been saved out to // prefs already if(PlayerPrefs.HasKey(gamePrefsName+"_SFXVol")) { audioSFXSliderValue= PlayerPrefs. GetFloat(gamePrefsName+"_SFXVol"); } else { audioSFXSliderValue= 1; } if(PlayerPrefs.HasKey(gamePrefsName+"_MusicVol")) { audioMusicSliderValue= PlayerPrefs. GetFloat(gamePrefsName+"_MusicVol"); } else { audioMusicSliderValue= 1; } if(PlayerPrefs.HasKey(gamePrefsName+"_GraphicsDetail")) { graphicsSliderValue= PlayerPrefs. GetFloat(gamePrefsName+"_GraphicsDetail"); } else { string[] names = QualitySettings.names; detailLevels= names.Length; graphicsSliderValue= detailLevels; } // set the quality setting QualitySettings.SetQualityLevel( (int)graphicsSliderValue, true); }
ilia1395
25.10.14 в 20:26
|
|
|
|
|
string[] names = QualitySettings.names; detailLevels= names.Length;
ilia1395
25.10.14 в 20:26
|
|
|
|
|
graphicsSliderValue= detailLevels;
ilia1395
25.10.14 в 20:26
|
|
|
|
|
QualitySettings.SetQualityLevel( (int)graphicsSliderValue, true);
ilia1395
25.10.14 в 20:26
|
|
|
|
|
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));
ilia1395
25.10.14 в 20:27
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GUI.BeginGroup (new Rect (default _width / 2 - 150, default _height / 2 - 250, 500, 500));
ilia1395
25.10.14 в 20:27
|
|
|
|
|
GUI.Label(new Rect( 0, 50, 300, 50 ), gameDisplayName, "textarea");
ilia1395
25.10.14 в 20:27
|
|
|
|
|
|
|
|
|
|
|
if(GUI.Button(new Rect( 0, 200, 300, 40 ),"START SINGLE", "button"))
ilia1395
25.10.14 в 20:27
|
|
|
|
|
PlayerPrefs.SetInt( "totalPlayers", 1 ); LoadLevel( singleGameStartScene );
ilia1395
25.10.14 в 20:27
|
|
|
|
|
|
|
|
if(coopGameStartScene!="") { if(GUI.Button(new Rect(0, 250, 300, 40 ),"START CO-OP")) { PlayerPrefs.SetInt( "totalPlayers", 2 ); LoadLevel( coopGameStartScene ); } if(GUI.Button(new Rect(0, 300, 300, 40 ),"OPTIONS")) { ShowOptionsMenu(); } } else { if(GUI.Button(new Rect(0, 250, 300, 40 ),"OPTIONS")) { ShowOptionsMenu(); } }
ilia1395
25.10.14 в 20:28
|
|
|
|
|
|
|
|
if(GUI.Button(new Rect(0, 400, 300, 40),"EXIT")) { ConfirmExitGame(); } // End the group we started above. This is very // important to remember! GUI.EndGroup (); break;
ilia1395
25.10.14 в 20:28
|
|
|
|
|
|
|
|
|
|
|
case 1: // Options menu GUI.BeginGroup (new Rect (native_width / 2 - 150, native_height / 2 - 250, 500, 500)); // Are you sure you want to exit? GUI.Label(new Rect(0, 50, 300, 50), "OPTIONS", "textarea"); if(GUI.Button(new Rect(0, 250, 300, 40 ),"AUDIO OPTIONS")) { ShowAudioOptionsMenu(); } if(GUI.Button(new Rect(0, 300, 300, 40),"GRAPHICS OPTIONS")) { ShowGraphicsOptionsMenu(); } if(GUI.Button(new Rect(0, 400, 300, 40),"BACK TO MAIN MENU")) { GoMainMenu(); } GUI.EndGroup ();
ilia1395
25.10.14 в 20:28
|
|
|
|
|
|
|
|
case 2: GUI.BeginGroup (new Rect (default_width / 2 - 150, default_height / 2 - 250, 500, 500)); // Are you sure you want to exit? GUI.Label(new Rect(0, 50, 300, 50), "Are you sure you want to exit?", "textarea"); if(GUI.Button(new Rect(0, 250, 300, 40),"YES, QUIT PLEASE!")) { ExitGame(); } if(GUI.Button(new Rect(0, 300, 300, 40),"NO, DON’T QUIT")) { GoMainMenu(); } GUI.EndGroup (); break;
ilia1395
25.10.14 в 20:29
|
|
|
|
|
case 3: // AUDIO OPTIONS GUI.BeginGroup (new Rect (default_width / 2 - 150, default_height / 2 - 250, 500, 500)); GUI.Label(new Rect(0, 50, 300, 50), "AUDIO OPTIONS", "textarea"); GUI.Label(new Rect(0, 170, 300, 20), "SFX volume:");
ilia1395
25.10.14 в 20:29
|
|
|
|
|
audioSFXSliderValue = GUI.HorizontalSlider (new Rect( 0, 200, 300, 50 ), audioSFXSliderValue, 0.0f, 1f);
ilia1395
25.10.14 в 20:29
|
|
|
|
|