public void InitUIVolumeSliderBar(NodeAddedEvent e, UIVolumeSliderBarNode uiVolumeSliderBarNode) { uiVolumeSliderBarNode.sliderBar.Value = SoundSettingsUtils.GetSavedVolume(SoundType.UI); }
public void InitSFXVolumeSliderBar(NodeAddedEvent e, SFXVolumeSliderBarNode sfxVolumeSliderBarNode) { sfxVolumeSliderBarNode.sliderBar.Value = SoundSettingsUtils.GetSavedVolume(SoundType.SFX); }
private void SetSoundVolume(SoundType soundType, string param, AudioMixer mixer, float volume, bool isMuted) { SoundSettingsUtils.SaveVolume(soundType, volume); SoundSettingsUtils.SaveMuteFlag(soundType, isMuted); mixer.SetFloat(param, !isMuted ? volume : SoundSettingsUtils.MUTED_VOLUME_VALUE); }
public void InitMusicVolumeSliderBar(NodeAddedEvent e, MusicVolumeSliderBarNode musicVolumeSliderBarNode) { musicVolumeSliderBarNode.sliderBar.Value = SoundSettingsUtils.GetSavedVolume(SoundType.Music); }
public void InitSoundSettings(NodeAddedEvent e, SoundListenerNode listener) { listener.soundListenerResources.Resources.SfxMixer.SetFloat(SoundSettingsUtils.VOLUME_PARAM_KEY, !SoundSettingsUtils.GetSavedMuteFlag(SoundType.SFX) ? SoundSettingsUtils.GetSavedVolume(SoundType.SFX) : SoundSettingsUtils.MUTED_VOLUME_VALUE); listener.soundListenerResources.Resources.UIMixer.SetFloat(SoundSettingsUtils.VOLUME_PARAM_KEY, !SoundSettingsUtils.GetSavedMuteFlag(SoundType.UI) ? SoundSettingsUtils.GetSavedVolume(SoundType.UI) : SoundSettingsUtils.MUTED_VOLUME_VALUE); listener.soundListenerResources.Resources.MusicMixer.SetFloat(SoundSettingsUtils.MUSIC_VOLUME_PARAM_KEY, !SoundSettingsUtils.GetSavedMuteFlag(SoundType.Music) ? SoundSettingsUtils.GetSavedVolume(SoundType.Music) : SoundSettingsUtils.MUTED_VOLUME_VALUE); listener.soundListenerResources.Resources.MusicMixer.SetFloat(SoundSettingsUtils.LAZY_UI_VOLUME_PARAM_KEY, !SoundSettingsUtils.GetSavedMuteFlag(SoundType.UI) ? SoundSettingsUtils.GetSavedVolume(SoundType.UI) : SoundSettingsUtils.MUTED_VOLUME_VALUE); }