public void PlaySFX(AudioID audioId) { AudioTuple clip = _soundMap.Find(audio => audio.Id == audioId); if (clip != null) { SFXSource.PlayOneShot(clip.Sound); } else { GameLog.LogError("No sound configured for id: " + audioId.ToString()); } }
public void PlayBackgroundMusic(AudioID audioId) { AudioTuple clip = _soundMap.Find(audio => audio.Id == audioId); if (clip != null) { MusicSource.clip = clip.Sound; MusicSource.Play(); } else { GameLog.LogError("No sound configured for id: " + audioId.ToString()); } }