예제 #1
0
        public void PlayNewSong(string name, float fadeDuration, bool interrupt)
        {
            if (SoundManager.NoMusic)
            {
                return;
            }
            TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong;

            if (!interrupt)
            {
                this.ShelvedSong = this.ActiveSong;
            }
            else if (this.ActiveSong != null)
            {
                this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration);
            }
            if (string.IsNullOrEmpty(name))
            {
                this.ActiveSong = (ActiveTrackedSong)null;
            }
            else
            {
                TrackedSong song = this.CMProvider.CurrentLevel.Load <TrackedSong>("Music/" + name);
                song.Initialize();
                ServiceHelper.AddComponent((IGameComponent)(this.ActiveSong = new ActiveTrackedSong(this.Game, song, this.LevelManager.MutedLoops)));
            }
            if (currentlyPlayingSong == this.CurrentlyPlayingSong)
            {
                return;
            }
            this.SongChanged();
        }
예제 #2
0
        public void PlayNewSong(float fadeDuration)
        {
            if (SoundManager.NoMusic)
            {
                return;
            }
            TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong;

            if (this.ActiveSong != null)
            {
                this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration);
            }
            if (this.LevelManager.Song == null)
            {
                this.ActiveSong = (ActiveTrackedSong)null;
            }
            else
            {
                ServiceHelper.AddComponent((IGameComponent)(this.ActiveSong = new ActiveTrackedSong(this.Game)));
            }
            if (currentlyPlayingSong == this.CurrentlyPlayingSong)
            {
                return;
            }
            this.SongChanged();
        }
예제 #3
0
 public void UnshelfSong()
 {
     if (this.ShelvedSong == null)
     {
         return;
     }
     this.ActiveSong  = this.ShelvedSong;
     this.ShelvedSong = (ActiveTrackedSong)null;
 }
예제 #4
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;
 }
예제 #5
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;
 }
예제 #6
0
 public void UnshelfSong()
 {
   if (this.ShelvedSong == null)
     return;
   this.ActiveSong = this.ShelvedSong;
   this.ShelvedSong = (ActiveTrackedSong) null;
 }
예제 #7
0
 public void PlayNewSong(string name, float fadeDuration, bool interrupt)
 {
   if (SoundManager.NoMusic)
     return;
   TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong;
   if (!interrupt)
     this.ShelvedSong = this.ActiveSong;
   else if (this.ActiveSong != null)
     this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration);
   if (string.IsNullOrEmpty(name))
   {
     this.ActiveSong = (ActiveTrackedSong) null;
   }
   else
   {
     TrackedSong song = this.CMProvider.CurrentLevel.Load<TrackedSong>("Music/" + name);
     song.Initialize();
     ServiceHelper.AddComponent((IGameComponent) (this.ActiveSong = new ActiveTrackedSong(this.Game, song, this.LevelManager.MutedLoops)));
   }
   if (currentlyPlayingSong == this.CurrentlyPlayingSong)
     return;
   this.SongChanged();
 }
예제 #8
0
 public void PlayNewSong(float fadeDuration)
 {
   if (SoundManager.NoMusic)
     return;
   TrackedSong currentlyPlayingSong = this.CurrentlyPlayingSong;
   if (this.ActiveSong != null)
     this.ActiveSong.FadeOutAndRemoveComponent(fadeDuration);
   if (this.LevelManager.Song == null)
     this.ActiveSong = (ActiveTrackedSong) null;
   else
     ServiceHelper.AddComponent((IGameComponent) (this.ActiveSong = new ActiveTrackedSong(this.Game)));
   if (currentlyPlayingSong == this.CurrentlyPlayingSong)
     return;
   this.SongChanged();
 }