예제 #1
0
        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());
            }
        }
예제 #2
0
        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());
            }
        }