public void PlayBgm(string bgmName) { var bgm = ResourceFacade.LoadAudioClip(bgmName); var bgmAudioSource = _bgmPlayer.GetComponent <AudioSource>(); bgmAudioSource.clip = bgm; bgmAudioSource.loop = true; bgmAudioSource.Play(); }
public async void PlaySfx(string sfxName) { var sfx = ResourceFacade.LoadAudioClip(sfxName); var sfxAudioSource = _sfxPlayer.AddComponent <AudioSource>(); sfxAudioSource.clip = sfx; sfxAudioSource.Play(); await PlaySfxDelay(sfxAudioSource, sfxAudioSource.clip.length); }