private void RemoveOldEventInstanceIfKeyHasChanged() { if (!_soundEventInstance || _soundEventInstance.GetSoundEvent().key == key) { return; } _soundEventInstance.StopAndDestroy(); _soundEventInstance = null; }
public void Unregister(SoundEventInstance soundEventInstance) { SoundEvent soundEvent = soundEventInstance.GetSoundEvent(); _soundEventInstances[soundEvent.key].Remove(soundEventInstance); }