Inheritance: IDisposable
Exemplo n.º 1
0
        public StageHandler(StageInfo stage)
        {
            info = stage;
            Info = stage;
            startScreen = info.StartScreen;

            if (string.IsNullOrEmpty(startScreen)) startScreen = info.Screens.Keys.First();
            startX = info.PlayerStartX;
            startY = info.PlayerStartY;

            string intropath = (stage.MusicIntroPath != null) ? stage.MusicIntroPath.Absolute : null;
            string looppath = (stage.MusicLoopPath != null) ? stage.MusicLoopPath.Absolute : null;
            if (intropath != null || looppath != null) music = Engine.Instance.SoundSystem.LoadMusic(intropath, looppath, 1);
        }
Exemplo n.º 2
0
        public Music LoadMusic(string intro, string loop, float volume)
        {
            string key = intro + loop;

            if (!string.IsNullOrEmpty(key) && loadedMusic.ContainsKey(intro + loop)) return loadedMusic[intro + loop];

            Music music = new Music(soundSystem, intro, loop, volume);
            loadedMusic[intro + loop] = music;
            return music;
        }