Beispiel #1
0
        public Sound GetFxSound(AudioFxTypes type)
        {
            if (_fxClipsTable == null)
            {
                InitializeFxClipsTable();
            }

            return(_fxClipsTable[type]);
        }
Beispiel #2
0
        public void PlayFxSound(AudioFxTypes fxType)
        {
            var sound = audioData.GetFxSound(fxType);

            fxAudioSource.clip   = sound.clip;
            fxAudioSource.loop   = sound.loop;
            fxAudioSource.volume = sound.volume;
            fxAudioSource.pitch  = sound.pitch;
            fxAudioSource.Play();
        }