当前位置: 首页>>代码示例>>C#>>正文


C# StateManager.SetState方法代码示例

本文整理汇总了C#中StateManager.SetState方法的典型用法代码示例。如果您正苦于以下问题:C# StateManager.SetState方法的具体用法?C# StateManager.SetState怎么用?C# StateManager.SetState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StateManager的用法示例。


在下文中一共展示了StateManager.SetState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadContent

        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Intro sounds
            audioManager.addEffect(audioList.getValue("Intro", "startup"), "intro_startup");

            // Main Menu Sounds
            audioManager.addEffect(audioList.getValue("MainMenu", "move"), "menu_move");
            audioManager.addEffect(audioList.getValue("MainMenu", "select"), "menu_select");
            audioManager.addEffect(audioList.getValue("MainMenu", "start"), "menu_start");
            audioManager.addSong(audioList.getValue("MainMenu", "music"), "menu_music");

            // World Map Sounds
            audioManager.addEffect(audioList.getValue("WorldMap", "select"), "map_select");
            audioManager.addEffect(audioList.getValue("WorldMap", "move"), "map_move");
            audioManager.addEffect(audioList.getValue("WorldMap", "selectMap"), "map_select_map");
            audioManager.addEffect(audioList.getValue("WorldMap", "back"), "map_back");
            audioManager.addSong(audioList.getValue("WorldMap", "music"), "map_music");

            // In Game Sounds
            audioManager.addEffect(audioList.getValue("InGame", "player_shoot"), "player_shoot");
            audioManager.addEffect(audioList.getValue("InGame", "player_die"), "player_die");
            audioManager.addEffect(audioList.getValue("InGame", "player_powerup_pickup"), "player_powerup_pickup");
            audioManager.addEffect(audioList.getValue("InGame", "dark_thought_shoot"), "dark_thought_shoot");
            audioManager.addEffect(audioList.getValue("InGame", "dark_thought_die"), "dark_thought_die");
            audioManager.addEffect(audioList.getValue("InGame", "red_bloodvessel_die"), "red_bloodvessel_die");
            audioManager.addEffect(audioList.getValue("InGame", "blue_bloodvessel_die"), "blue_bloodvessel_die");
            audioManager.addEffect(audioList.getValue("InGame", "purple_bloodvessel_die"), "purple_bloodvessel_die");
            audioManager.addEffect(audioList.getValue("InGame", "nightmare_die"), "nightmare_die");
            audioManager.addEffect(audioList.getValue("InGame", "nightmare_hit"), "nightmare_hit");
            audioManager.addEffect(audioList.getValue("InGame", "inner_demon_die"), "inner_demon_die");
            audioManager.addEffect(audioList.getValue("InGame", "lesser_demon_spawn"), "lesser_demon_spawn");
            audioManager.addEffect(audioList.getValue("InGame", "lesser_demon_die"), "lesser_demon_die");
            audioManager.addEffect(audioList.getValue("InGame", "dark_whisper_die"), "dark_whisper_die");
            audioManager.addEffect(audioList.getValue("InGame", "dark_whisper_release_spikes"), "release_spikes");
            audioManager.addEffect(audioList.getValue("InGame", "pause_appear"), "pause_appear");
            audioManager.addSong(audioList.getValue("InGame", "music"), "main_music");
            audioManager.addSong(audioList.getValue("InGame", "music_secondary"), "secondary_music");

            stateManager = new StateManager();

            controls = new InputManager(this);
            State state = new IntroState(spriteBatch, this, audioManager, controls, "IntroState");
            stateManager.AddState(state);
            state = new MenuState(spriteBatch, this, graphics, displayModes, audioManager, controls, "MenuState");
            stateManager.AddState(state);
            state = new CreditsState(spriteBatch, this, audioManager, controls, "CreditsState");
            stateManager.AddState(state);
            state = new WorldMapState(spriteBatch, this, audioManager, controls, "WorldMapState");
            stateManager.AddState(state);
            state = new PlayState(spriteBatch, this, audioManager, controls, "PlayState");
            stateManager.AddState(state);
            state = new WarningState(spriteBatch, this, audioManager, controls, "WarningState");
            stateManager.AddState(state);
            stateManager.SetState(config.getValue("General", "StartState"));
        }
开发者ID:rodstrom,项目名称:soul,代码行数:57,代码来源:Soul.cs


注:本文中的StateManager.SetState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。