Пример #1
0
        private void Play()
        {
            SoundEffectInstance instance = this.Style.GetRandomSound().CreateInstance();

            instance.Pitch += this.Style.GetRandomPitch();
            instance.Play();
            SoundInstanceGarbageCollector.Track(instance);
            this.Sound = instance;
            this.Update();
        }
Пример #2
0
        private void Play()
        {
            SoundEffectInstance soundEffectInstance = Style.GetRandomSound().CreateInstance();

            soundEffectInstance.Pitch += Style.GetRandomPitch();
            soundEffectInstance.Play();
            SoundInstanceGarbageCollector.Track(soundEffectInstance);
            Sound = soundEffectInstance;
            Update();
        }
Пример #3
0
 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();
     }
 }