public void Despawn(SoundEvent soundEvent) { if (_pool.Count < _size) { _pool.Add(soundEvent); } }
private void OnSoundEventComplete(SoundEvent soundEvent) { if (_curPlayingTraceableSounds.Find(e => e.EventId == soundEvent.EventId) != null) { _soundEventsToStop.Add(soundEvent.EventId); soundEvent.OnComplete -= OnSoundEventComplete; } }
private void AddSoundToTraceableSounds(int soundEventId, SoundEvent soundEvent) { _curPlayingTraceableSoundIds.Add(soundEventId); _curPlayingTraceableSounds.Add(soundEvent); }