Beispiel #1
0
        public void InitializeAudioSourcePools()
        {
            soundPoolDic = new Dictionary <SoundInfo, AudioSourcePool>(sounds.Length);

            AudioSourcePool standardAudioSourcePool = new AudioSourcePool(standardAudioSource, poolSize, this.transform);

            for (int i = 0; i < sounds.Length; i++)
            {
                SoundInfo sound = sounds[i];
                if (sound.audioSource != null)
                {
                    soundPoolDic.Add(sound, new AudioSourcePool(sound.audioSource, sound.poolSize, this.transform));
                }
                else
                {
                    soundPoolDic.Add(sound, standardAudioSourcePool);
                }
            }
        }
Beispiel #2
0
 public Sound(SoundInfo soundinfo, AudioSource audioSource, AudioSourcePool audioSourcePool)
 {
     this.soundInfo       = soundinfo;
     this.audioSource     = audioSource;
     this.audioSourcePool = audioSourcePool;
 }