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); } }
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; }