private void OnEnable() { pauseContainer.SetActive(false); Resume(); _anim = GetComponent <Animator>(); if (AudioMixerControl.GetInstance().musicOn) { _mixer.SetFloat(MUSICPARAMETER, normalVolValue); _musicButton.GetComponent <Image>().sprite = _musicButtonNormalSprite; } else { _mixer.SetFloat(MUSICPARAMETER, minVolValue); _musicButton.GetComponent <Image>().sprite = _musicButtonPressedSprite; } if (AudioMixerControl.GetInstance().sfxOn) { _mixer.SetFloat(SFXPARAMETER, normalVolValue); _sfxButton.GetComponent <Image>().sprite = _sfxButtonNormalSprite; } else { _mixer.SetFloat(SFXPARAMETER, minVolValue); _sfxButton.GetComponent <Image>().sprite = _sfxButtonPressedSprite; } }
public void setupSFX() { if (AudioMixerControl.GetInstance().sfxOn) { _mixer.SetFloat(SFXPARAMETER, minVolValue); _sfxButton.GetComponent <Image>().sprite = _sfxButtonPressedSprite; AudioMixerControl.GetInstance().sfxOn = false; } else { _mixer.SetFloat(SFXPARAMETER, normalVolValue); _sfxButton.GetComponent <Image>().sprite = _sfxButtonNormalSprite; AudioMixerControl.GetInstance().sfxOn = true; } }
//AUDIOCONTOL public void setupMusic() { Debug.Log("audiomixercontrol musicon: " + AudioMixerControl.GetInstance().musicOn); if (AudioMixerControl.GetInstance().musicOn) { _mixer.SetFloat(MUSICPARAMETER, minVolValue); _musicButton.GetComponent <Image>().sprite = _musicButtonPressedSprite; AudioMixerControl.GetInstance().musicOn = false; } else { _mixer.SetFloat(MUSICPARAMETER, normalVolValue); _musicButton.GetComponent <Image>().sprite = _musicButtonNormalSprite; AudioMixerControl.GetInstance().musicOn = true; } }