public void Draw(SpriteBatch theSpriteBatch, ContentManager theContentManager) { if (MyMenuState == MenuState.Startup) { Logo.Draw(theSpriteBatch, theContentManager); PlayButton.Draw(theSpriteBatch, theContentManager); OptionsButton.Draw(theSpriteBatch, theContentManager); HighScoresButton.Draw(theSpriteBatch, theContentManager); ExitGameButton.Draw(theSpriteBatch, theContentManager); } else if (MyMenuState == MenuState.Options1) { MusicOn.Draw(theSpriteBatch, theContentManager); MusicOff.Draw(theSpriteBatch, theContentManager); SoundOn.Draw(theSpriteBatch, theContentManager); SoundOff.Draw(theSpriteBatch, theContentManager); Cheats.Draw(theSpriteBatch, theContentManager); Debug.Draw(theSpriteBatch, theContentManager); Cave1.Draw(theSpriteBatch, theContentManager); Cave2.Draw(theSpriteBatch, theContentManager); Cave3.Draw(theSpriteBatch, theContentManager); Back.Draw(theSpriteBatch, theContentManager); OptionsLabel.Draw(theSpriteBatch, theContentManager); MusicLabel.Draw(theSpriteBatch, theContentManager); SoundFXLabel.Draw(theSpriteBatch, theContentManager); CaveLabel.Draw(theSpriteBatch, theContentManager); } }
// Start is called before the first frame update void Start() { Sound = GameObject.Find("SoundManager").GetComponent <TestSound>(); if (PlayerPrefs.GetInt("Music") == 0) { MusicOn.GetComponent <Button>().interactable = false; MusicOff.GetComponent <Button>().interactable = true; Sound.UnMuteMusic("Background"); } else if (PlayerPrefs.GetInt("Music") == 1) { MusicOn.GetComponent <Button>().interactable = true; MusicOff.GetComponent <Button>().interactable = false; Sound.MuteMusic("Background"); } if (PlayerPrefs.GetInt("Sound") == 0) { SoundOn.GetComponent <Button>().interactable = false; SoundOff.GetComponent <Button>().interactable = true; Sound.UnMuteMusic("1"); Sound.UnMuteMusic("Buzz3"); Sound.UnMuteMusic("Diamond"); PlayerPrefs.SetInt("Sound", 0); } else if (PlayerPrefs.GetInt("Sound") == 1) { SoundOn.GetComponent <Button>().interactable = true; SoundOff.GetComponent <Button>().interactable = false; Sound.MuteMusic("1"); Sound.MuteMusic("Buzz3"); Sound.MuteMusic("Diamond"); } CurrentScene = SceneManager.GetActiveScene(); if (CurrentScene.name == "MainMenu") { ShopDiamonds.text = PlayerPrefs.GetInt("Diamonds").ToString(); MainDiamonds.text = PlayerPrefs.GetInt("Diamonds").ToString(); HighScore.text = PlayerPrefs.GetInt("HighScore").ToString(); } else { manager = GameObject.Find("GameManager").GetComponent <GameManager>(); int back = Random.Range(0, Backgrounds.Length); background.GetComponent <Image>().sprite = Backgrounds[back]; } }
void OnMouseUpAsButton() { if (PlayerPrefs.GetString("Sound") != "no") { GameObject.Find("ClickAudio").GetComponent <AudioSource>().Play(); } switch (gameObject.name) { case "Play": SceneManager.LoadScene("play"); break; case "Quit": Application.Quit(); break; case "Restart": SceneManager.LoadScene("play"); break; case "Home": SceneManager.LoadScene("main"); break; case "Help": SceneManager.LoadScene("help"); break; case "Close": SceneManager.LoadScene("main"); break; case "Sound": if (PlayerPrefs.GetString("Sound") != "no") { PlayerPrefs.SetString("Sound", "no"); soundOn.SetActive(false); SoundOff.SetActive(true); } else { PlayerPrefs.SetString("Sound", "yes"); soundOn.SetActive(true); SoundOff.SetActive(false); } break; } }
void Start() { int soun = PlayerPrefs.GetInt(Constants.Sounds); SoundOn.SetActive(soun == 0); SoundOff.SetActive(soun == 1); if (soun == 0) { MixerSound.SetFloat("VolimeSound", 0); } else { MixerSound.SetFloat("VolimeSound", -100); } }
void Start() { if (gameObject.name == "Sound") { if (PlayerPrefs.GetString("Sound") == "no") { soundOn.SetActive(false); SoundOff.SetActive(true); } else { soundOn.SetActive(true); SoundOff.SetActive(false); } } }
public void SetSound() { int soun = PlayerPrefs.GetInt(Constants.Sounds); soun++; if (soun > 1) { soun = 0; } SoundOn.SetActive(soun == 0); SoundOff.SetActive(soun == 1); PlayerPrefs.SetInt(Constants.Sounds, soun); if (soun == 0) { MixerSound.SetFloat("VolimeSound", 0); } else { MixerSound.SetFloat("VolimeSound", -100); } }
public void Draw(SpriteBatch theSpriteBatch, ContentManager theContentManager) { if (MyMenuState == MenuState.Startup) { Logo.Draw(theSpriteBatch, theContentManager); PlayButton.Draw(theSpriteBatch, theContentManager); OptionsButton.Draw(theSpriteBatch, theContentManager); HighScoresButton.Draw(theSpriteBatch, theContentManager); ExitGameButton.Draw(theSpriteBatch, theContentManager); } else if (MyMenuState == MenuState.Options) { MusicOn.Draw(theSpriteBatch, theContentManager); MusicOff.Draw(theSpriteBatch, theContentManager); SoundOn.Draw(theSpriteBatch, theContentManager); SoundOff.Draw(theSpriteBatch, theContentManager); Cheats.Draw(theSpriteBatch, theContentManager); Debug.Draw(theSpriteBatch, theContentManager); Mouse.Draw(theSpriteBatch, theContentManager); Keyboard.Draw(theSpriteBatch, theContentManager); Kinect.Draw(theSpriteBatch, theContentManager); Back.Draw(theSpriteBatch, theContentManager); OptionsLabel.Draw(theSpriteBatch, theContentManager); MusicLabel.Draw(theSpriteBatch, theContentManager); SoundFXLabel.Draw(theSpriteBatch, theContentManager); ControlsLabel.Draw(theSpriteBatch, theContentManager); } else if (MyMenuState == MenuState.Pause) { backdrop.Draw(theSpriteBatch, theContentManager); Resume.Draw(theSpriteBatch, theContentManager); MainMenu.Draw(theSpriteBatch, theContentManager); Quit.Draw(theSpriteBatch, theContentManager); } }
public void SoundOff_V() { SoundOn.SetActive(true); SoundOff.SetActive(false); Sesler.SetActive(true); }
public void Click(string name) { if (name == "HomeShop") { Shop.SetActive(false); } else if (name == "Shop") { Shop.SetActive(true); } else if (name == "Play") { GameManager.gameOn = true; SceneManager.LoadScene(1); } else if (name == "Pause") { Time.timeScale = 0; pauseWindow.SetActive(true); } else if (name == "Resume") { Time.timeScale = 1; pauseWindow.SetActive(false); } else if (name == "Retry") { GameManager.gameOn = true; Time.timeScale = 1; SceneManager.LoadScene(1); } else if (name == "Home") { Time.timeScale = 1; SceneManager.LoadScene(0); } else if (name == "Settings") { Settings.SetActive(true); } else if (name == "Okay") { Settings.SetActive(false); } else if (name == "MusicOn") { MusicOn.GetComponent <Button>().interactable = true; MusicOff.GetComponent <Button>().interactable = false; Sound.MuteMusic("Background"); PlayerPrefs.SetInt("Music", 1); } else if (name == "MusicOff") { MusicOn.GetComponent <Button>().interactable = false; MusicOff.GetComponent <Button>().interactable = true; Sound.UnMuteMusic("Background"); PlayerPrefs.SetInt("Music", 0); } else if (name == "SoundOn") { SoundOn.GetComponent <Button>().interactable = true; SoundOff.GetComponent <Button>().interactable = false; Sound.MuteMusic("1"); Sound.MuteMusic("Buzz3"); Sound.MuteMusic("Diamond"); PlayerPrefs.SetInt("Sound", 1); } else if (name == "SoundOff") { SoundOn.GetComponent <Button>().interactable = false; SoundOff.GetComponent <Button>().interactable = true; Sound.UnMuteMusic("1"); Sound.UnMuteMusic("Buzz3"); Sound.UnMuteMusic("Diamond"); PlayerPrefs.SetInt("Sound", 0); } else if (name == "Left") { left.GetComponent <Button>().interactable = false; right.GetComponent <Button>().interactable = true; } else if (name == "Right") { left.GetComponent <Button>().interactable = true; right.GetComponent <Button>().interactable = false; } }
public void OnClick(string name) { if (name == "MusicOn") { sounds.MuteMusic("Intro Theme"); MusicOff.SetActive(true); musicOn.SetActive(false); } else if (name == "MusicOff") { sounds.UnMuteMusic("Intro Theme"); musicOn.SetActive(true); MusicOff.SetActive(false); } else if (name == "SoundOn") { sounds.MuteMusic("258269__jcallison__mouth-pop"); sounds.MuteMusic("ClickSound"); SoundOn.SetActive(false); SoundOff.SetActive(true); } else if (name == "SoundOff") { sounds.UnMuteMusic("258269__jcallison__mouth-pop"); sounds.UnMuteMusic("ClickSound"); SoundOn.SetActive(true); SoundOff.SetActive(false); } else if (name == "Play") { FindObjectOfType <FadeInOut>().FadeIn(); Invoke("LoadPiano", 1f); } else if (name == "Sounds") { MusicScreen.SetActive(true); Next.SetActive(false); Prev.SetActive(false); } else if (name == "SoundsOff") { MusicScreen.SetActive(false); Next.SetActive(true); Prev.SetActive(true); } else if (name == "AboutOn") { AboutUs.SetActive(true); Next.SetActive(false); Prev.SetActive(false); } else if (name == "AboutOff") { AboutUs.SetActive(false); Next.SetActive(true); Prev.SetActive(true); } else if (name == "HappyBirthday") { mode = "HappyBirthday"; FindObjectOfType <FadeInOut>().FadeIn(); Invoke("LoadHappy", 1f); } else if (name == "JingleBells") { mode = "JingleBells"; FindObjectOfType <FadeInOut>().FadeIn(); Invoke("LoadJingles", 1f); } else if (name == "OldMan") { mode = "OldMan"; FindObjectOfType <FadeInOut>().FadeIn(); Invoke("LoadOld", 1f); } }