예제 #1
0
 public void SaveAudioPreferences(AudioPreferences audioPreferences)
 {
     PlayerPrefs.SetFloat("MusicVolume", audioPreferences.MusicVolume);
     PlayerPrefs.SetFloat("SoundVolume", audioPreferences.SoundVolume);
     PlayerPrefs.SetInt("MuteMusic", audioPreferences.MuteMusic? 1 : 0);
     PlayerPrefs.SetInt("MuteSound", audioPreferences.MuteSound? 1 : 0);
     PlayerPrefs.Save();
 }
예제 #2
0
        public AudioPreferences LoadAudioPreferences()
        {
            AudioPreferences preferences = new AudioPreferences();

            preferences.MusicVolume = PlayerPrefs.GetFloat("MusicVolume", 1.0f);
            preferences.SoundVolume = PlayerPrefs.GetFloat("SoundVolume", 1.0f);
            preferences.MuteMusic   = (PlayerPrefs.GetInt("MuteMusic", 0) == 1);
            preferences.MuteSound   = (PlayerPrefs.GetInt("MuteSound", 0) == 1);

            return(preferences);
        }
예제 #3
0
 public void LoadSettings()
 {
     this.audioPreferences = LoadAudioPreferences();
 }