Exemplo n.º 1
0
        private void Start()
        {
            OnMusicVolumeChanged?.Invoke(MusicVolume);
            OnEffectsVolumeChanged?.Invoke(EffectsVolume);
            OnMiscVolumeChanged?.Invoke(MiscVolume);

            UpdateUI();

            hasInitialized = true;
        }
Exemplo n.º 2
0
        public void SetMusicVolume(float value)
        {
            if (hasInitialized)
            {
                currentMusicVolume = value;

                OnMusicVolumeChanged?.Invoke(MusicVolume);

                SaveSettings();
            }
        }
Exemplo n.º 3
0
        public void ToggleMuted()
        {
            if (hasInitialized)
            {
                isMuted = !isMuted;

                muteButtonText.text = isMuted ? "Unmute" : "Mute";

                OnMusicVolumeChanged?.Invoke(MusicVolume);
                OnEffectsVolumeChanged?.Invoke(EffectsVolume);
                OnMiscVolumeChanged?.Invoke(MiscVolume);

                SaveSettings();
            }
        }