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