| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | namespace DCL.SettingsControls |
| | 4 | | { |
| | 5 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Mute Sound", fileName = "MuteSoundControlController")] |
| | 6 | | public class MuteSoundControlController : ToggleSettingsControlController |
| | 7 | | { |
| 2 | 8 | | public override object GetStoredValue() { return currentGeneralSettings.sfxVolume > 0 ? true : false; } |
| | 9 | |
|
| | 10 | | public override void UpdateSetting(object newValue) |
| | 11 | | { |
| 2 | 12 | | bool newBoolValue = (bool)newValue; |
| 2 | 13 | | currentGeneralSettings.sfxVolume = newBoolValue ? 1 : 0; |
| 2 | 14 | | AudioListener.volume = currentGeneralSettings.sfxVolume; |
| 2 | 15 | | } |
| | 16 | | } |
| | 17 | | } |