Beispiel #1
0
        public void PlayAmbientSoundEffect(string audioEffectName)
        {
            if (!FxDictionary.ContainsKey(audioEffectName))
            {
                return;
            }

            _ambientSoundEffect.clip = FxDictionary[audioEffectName];

            _ambientSoundEffect.Play();
        }
Beispiel #2
0
        /// <summary>
        /// Play the audio effect (hit, button click)
        /// </summary>
        /// <param name="audioEffectName">Audio effect name.</param>
        public void PlayAudioEffectHit(string audioEffectName)
        {
            if (!FxDictionary.ContainsKey(audioEffectName))
            {
                return;
            }

            _audioSourceEffectHit.clip = FxDictionary[audioEffectName];

            _audioSourceEffectHit.Play();
        }