public void ChangeMusic() { var musicAudioSource = audioSourcesManager.GetMainMusic(); if (AudioDataService.HasMusicOn()) { ChangeButton(musicBtn, true); AudioDataService.SetMusic(false); } else { ChangeButton(musicBtn, false); AudioDataService.SetMusic(true); } AudioDataService.CheckMusicOn(new[] { musicAudioSource }); selectAudioSource.Play(); if (AudioDataService.HasMusicOn()) { musicAudioSource.Play(); } }
private void Start() { AudioDataService.CheckMusicOn(musicSources); AudioDataService.CheckSfxOn(sfxSources); }