// Use this for initialization void Start() { musicPlayer = FindObjectOfType <MusicPlayer>(); pauseMusicPlayer = FindObjectOfType <PauseMusicPlayer>(); levelLoader = FindObjectOfType <LevelLoader>(); musicSlider.value = PlayerPrefsController.GetMusicVolume(); effectsSlider.value = PlayerPrefsController.GetEffectsVolume(); difficultySlider.value = PlayerPrefsController.GetDifficulty(); }
void LoadSliderValues() { masterVolumeSlider.value = PlayerPrefsController.GetMasterVolume(); audioManager.SetMasterVolume(masterVolumeSlider.value); musicVolumeSlider.value = PlayerPrefsController.GetMusicVolume(); audioManager.SetMusicVolume(musicVolumeSlider.value); effectsVolumeSlider.value = PlayerPrefsController.GetEffectsVolume(); audioManager.SetEffectsVolume(effectsVolumeSlider.value); voicesVolumeSlider.value = PlayerPrefsController.GetVoiceVolume(); audioManager.SetVoiceVolume(voicesVolumeSlider.value); difficultySlider.value = PlayerPrefsController.GetDifficulty(); }
public void UnpauseGame() { gameMusic.Play(); optionsController = FindObjectOfType <OptionsController>(); optionsController.SaveAndDontExit(); foreach (SoundEffects soundEffect in soundEffectAudioSources) { soundEffect.SetVolume(PlayerPrefsController.GetEffectsVolume()); } Time.timeScale = 1; pauseMenu.SetActive(false); isPaused = false; }
private void GetPlayerPrefs() { audioSource.volume = PlayerPrefsController.GetEffectsVolume(); switch (PlayerPrefsController.GetDifficulty()) { case 0: moveTimePeriod = 0.3f; break; case 1: moveTimePeriod = 0.2f; break; case 2: moveTimePeriod = 0.1f; break; default: break; } }
// Use this for initialization void Start() { audioSource = GetComponent <AudioSource>(); audioSource.volume = PlayerPrefsController.GetEffectsVolume(); }
private void Awake() { difficultySlider.value = PlayerPrefsController.GetDifficulty(); masterVolumeSlider.value = PlayerPrefsController.GetMasterVolume(); soundEffectsSlider.value = PlayerPrefsController.GetEffectsVolume(); }