public void Music() { if (musicEnabled) { MusicBtn.ReturnBtn(); musicAudioSource.enabled = false; musicEnabled = false; } else { MusicBtn.PlayButtonAnimation(); musicAudioSource.enabled = true; musicEnabled = true; } }
public void MusicControl() { if (MusicBtn.GetComponent <Image>().sprite.name == "On") { //SoundStatus = "false"; MusicBtn.GetComponent <Image>().sprite = OffSprite; //Camera.main.gameObject.GetComponent<AudioSource>().enabled = false; MusicSlider.value = 0; } else { //VibrationStatus = "true"; MusicBtn.GetComponent <Image>().sprite = OnSprite; // Camera.main.gameObject.GetComponent<AudioSource>().enabled = true; MusicSlider.value = PlayerPrefs.GetFloat("volume"); } }