Exemplo n.º 1
0
        private void InitializeAudioSourcePools()
        {
            _soundPoolDic = new Dictionary <SoundConfig, AudioSourcePool> (Sounds.Length);

            var standardAudioSourcePool = new AudioSourcePool(StandardAudioSource, PoolSize, transform);

            for (var i = 0; i < Sounds.Length; i++)
            {
                var sound = Sounds[i];
                if (sound.Source != null)
                {
                    _soundPoolDic.Add(sound, new AudioSourcePool(sound.Source, sound.PoolSize, transform));
                }
                else
                {
                    _soundPoolDic.Add(sound, standardAudioSourcePool);
                }
            }
        }
Exemplo n.º 2
0
 public Sound(SoundConfig soundinfo, AudioSource audioSource, AudioSourcePool audioSourcePool)
 {
     SoundConfig     = soundinfo;
     AudioSource     = audioSource;
     AudioSourcePool = audioSourcePool;
 }