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); } } }
public Sound(SoundConfig soundinfo, AudioSource audioSource, AudioSourcePool audioSourcePool) { SoundConfig = soundinfo; AudioSource = audioSource; AudioSourcePool = audioSourcePool; }