Пример #1
0
 public void Pause()
 {
     if (!this.Enabled)
     {
         return;
     }
     Waiters.Interpolate(0.25, (Action <float>)(step =>
     {
         ActiveAmbience temp_10 = this;
         int temp_15            = (temp_10.cancelPause ? 1 : 0) | (this.resumeRequested ? 1 : (!this.Enabled ? 1 : 0));
         temp_10.cancelPause    = temp_15 != 0;
     }), (Action)(() =>
     {
         if (!this.cancelPause && !this.resumeRequested)
         {
             foreach (ActiveAmbienceTrack item_0 in this.ActiveTracks)
             {
                 item_0.Pause();
             }
             this.Enabled = false;
         }
         this.cancelPause = this.resumeRequested = false;
     }));
 }
Пример #2
0
 public void Stop()
 {
   if (this.ActiveSong != null)
     ServiceHelper.RemoveComponent<ActiveTrackedSong>(this.ActiveSong);
   if (this.ActiveAmbience != null)
     ServiceHelper.RemoveComponent<ActiveAmbience>(this.ActiveAmbience);
   this.ActiveSong = (ActiveTrackedSong) null;
   this.ActiveAmbience = (ActiveAmbience) null;
   this.MusicVolumeFactor = 1f;
 }
Пример #3
0
 public void PlayNewAmbience()
 {
   if (this.ActiveAmbience == null)
     ServiceHelper.AddComponent((IGameComponent) (this.ActiveAmbience = new ActiveAmbience(this.Game, (IEnumerable<AmbienceTrack>) this.LevelManager.AmbienceTracks)));
   else
     this.ActiveAmbience.ChangeTracks((IEnumerable<AmbienceTrack>) this.LevelManager.AmbienceTracks);
 }