public void TryActivateAudioOptions()
    {
        AudioListener.volume = PlayerPrefsWrapper.TryGetFloat(Constants.AudioOptionsKey.MenuAudio) ?? AudioListener.volume;

        var isMenuAudioMuted = PlayerPrefsWrapper.TryGetBool(Constants.AudioOptionsKey.MuteMenuAudio);

        AudioListener.volume = isMenuAudioMuted.HasValue && isMenuAudioMuted.Value ? 0 : AudioListener.volume;
    }
Exemplo n.º 2
0
 /// <summary>
 /// Try fill saved option's value to the existing option toggle.
 /// </summary>
 public override void TryFillSavedOption()
 {
     toggle.isOn = PlayerPrefsWrapper.TryGetBool(key) ?? toggle.isOn;
 }
 public void TrySetMouseOptions()
 {
     mouseLook.XSensitivity = PlayerPrefsWrapper.TryGetFloat(Constants.MouseOptionsKey.MouseSensitivityX) ?? mouseLook.XSensitivity;
     mouseLook.YSensitivity = PlayerPrefsWrapper.TryGetFloat(Constants.MouseOptionsKey.MouseSensitivityY) ?? mouseLook.YSensitivity;
     mouseLook.InvertMouse(PlayerPrefsWrapper.TryGetBool(Constants.MouseOptionsKey.InvertMouse));
 }