OpenRA.Sound.PlayMusicThen C# (CSharp) Method

PlayMusicThen() public method

public PlayMusicThen ( OpenRA.GameRules.MusicInfo m, System.Action then ) : void
m OpenRA.GameRules.MusicInfo
then System.Action
return void
        public void PlayMusicThen(MusicInfo m, Action then)
        {
            if (m == null || !m.Exists)
                return;

            onMusicComplete = then;

            if (m == currentMusic && music != null)
            {
                soundEngine.PauseSound(music, false);
                MusicPlaying = true;
                return;
            }

            StopMusic();

            var sound = sounds[m.Filename];
            if (sound == null)
                return;

            music = soundEngine.Play2D(sound, false, true, WPos.Zero, MusicVolume, false);
            currentMusic = m;
            MusicPlaying = true;
        }