private void Play() { SoundEffectInstance instance = this.Style.GetRandomSound().CreateInstance(); instance.Pitch += this.Style.GetRandomPitch(); instance.Play(); SoundInstanceGarbageCollector.Track(instance); this.Sound = instance; this.Update(); }
private void Play() { SoundEffectInstance soundEffectInstance = Style.GetRandomSound().CreateInstance(); soundEffectInstance.Pitch += Style.GetRandomPitch(); soundEffectInstance.Play(); SoundInstanceGarbageCollector.Track(soundEffectInstance); Sound = soundEffectInstance; Update(); }
public static void Update() { if (IsAudioSupported) { SoundInstanceGarbageCollector.Update(); bool flag = (!Main.hasFocus || Main.gamePaused) && Main.netMode == 0; if (!_areSoundsPaused && flag) { _player.PauseAll(); } else if (_areSoundsPaused && !flag) { _player.ResumeAll(); } _areSoundsPaused = flag; _player.Update(); } }