コード例 #1
0
 /* On start, retrieve preferences */
 void Start()
 {
     audioMan = AudioManager.instance;
     musicVolumeSlider.value  = PlayerPrefsInterface.GetMasterVolume();
     soundsVolumeSlider.value = PlayerPrefsInterface.GetSoundsVolume();
     audioMan.setMusicVolume(musicVolumeSlider.value);         // Set volume to the stored value
     audioMan.setGameVolume(soundsVolumeSlider.value);         // Set volume to the stored value
     Debug.Log("Changed music volume successfully to " + musicVolumeSlider.value);
     Debug.Log("Changed sounds volume successfully to " + soundsVolumeSlider.value);
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     audioMan.setMusicVolume(PlayerPrefsInterface.GetMasterVolume());        // Set volume to the value stored previously
     audioMan.setGameVolume(PlayerPrefsInterface.GetSoundsVolume());         // Set volume to the value stored previously
 }