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; }
/// <summary> /// Try fill saved option's value to the existing option slider. /// </summary> public override void TryFillSavedOption() { switch (optionSaveType) { case OptionSaveType.Float: slider.value = PlayerPrefsWrapper.TryGetFloat(key) ?? slider.value; break; case OptionSaveType.Int: slider.value = PlayerPrefsWrapper.TryGetInt(key) ?? slider.value; break; } }
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)); }
public void TrySetVideoOptions() { camera.fieldOfView = PlayerPrefsWrapper.TryGetFloat(Constants.VideoOptionsKey.FieldOfView) ?? camera.fieldOfView; camera.farClipPlane = PlayerPrefsWrapper.TryGetFloat(Constants.VideoOptionsKey.DrawDistance) ?? camera.farClipPlane; }