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