Skip to content

Instantly share code, notes, and snippets.

@gluschenko
Created December 2, 2014 19:45
Show Gist options
  • Save gluschenko/212cc297c942b7f2e2a9 to your computer and use it in GitHub Desktop.
Save gluschenko/212cc297c942b7f2e2a9 to your computer and use it in GitHub Desktop.
if(MenuId == 1)//Settings
{
GUI.Box(new Rect(Screen.width/2 - Perc(35), Screen.height/2 - Perc(35) + Perc(GUIAnim), Perc(70), Perc(70)), Local.Get("Settings"));
GUILayout.BeginArea(new Rect(Screen.width/2 - Perc(34), Screen.height/2 - Perc(30) + Perc(GUIAnim), Perc(68), Perc(55)));
Scroll = GUILayout.BeginScrollView(Scroll);
if(Platform.isStandalone() || Platform.isWeb ())
{
GUILayout.Label(Local.Get("Music volume"));
MusicVolume = GUILayout.HorizontalSlider(MusicVolume, 0f, 1.0f);
GUILayout.Label(Local.Get("Sound volume"));
SoundVolume = GUILayout.HorizontalSlider(SoundVolume, 0f, 1.0f);
}
else
{
GUILayout.Label(Local.Get("Music & Sounds"));
GUILayout.BeginHorizontal();
if(GUILayout.Button((MusicVolume == 1)? Music[0] : Music[1], GUILayout.Height(Perc(10))))
{
MusicVolume = (MusicVolume == 1)? 0 : 1;
ClickSound();
}
if(GUILayout.Button((SoundVolume == 1)? Sound[0] : Sound[1], GUILayout.Height(Perc(10))))
{
SoundVolume = (SoundVolume == 1)? 0 : 1;
ClickSound();
}
GUILayout.EndHorizontal();
}
GUILayout.Label(Local.Get("Language"));
if(GUILayout.Button(Local.Get("Change language"), GUILayout.Height(Perc(11))))
{
SetMenuId(5);
ClickSound();
}
GUILayout.EndScrollView();
GUILayout.EndArea();
///
if(GUI.Button(new Rect(Screen.width/2 - Perc (24), Screen.height/2 + Perc (30) - Perc(7) + Perc(GUIAnim), Perc(48), Perc (11)), Local.Get("Back")))
{
isSettingsChanged = true;
SetMenuId(0);
ClickSound();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment