예제 #1
0
 public void Update()
 {
     if (gameOptionsController == null)
     {
         gameOptionsController = FindObjectOfType <GameOptionsController>();
     }
     musicAudioSource.volume = gameOptionsController.musicVolume * gameOptionsController.masterVolume;
 }
예제 #2
0
 public static void LoadAudioConfig(GameOptionsController gameOptionsController)
 {
     gameOptionsController.masterVolume = PlayerPrefs.GetFloat("MasterVolume");
     gameOptionsController.sfxVolume    = PlayerPrefs.GetFloat("SfxVolume");
     gameOptionsController.musicVolume  = PlayerPrefs.GetFloat("MusicVolume");
 }
예제 #3
0
 public static void SaveAudioConfig(GameOptionsController gameOptionsController)
 {
     PlayerPrefs.SetFloat("MasterVolume", gameOptionsController.masterVolume);
     PlayerPrefs.SetFloat("SfxVolume", gameOptionsController.sfxVolume);
     PlayerPrefs.SetFloat("MusicVolume", gameOptionsController.musicVolume);
 }