private 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); } } }
public Sound(SoundInfo soundinfo, AudioSource audioSource, AudioSourcePool audioSourcePool) { this.soundInfo = soundinfo; this.audioSource = audioSource; this.audioSourcePool = audioSourcePool; }