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


C# GameStateManager.pushState方法代码示例

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


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

示例1: LoadContent

        protected override void LoadContent()
        {
            Game1.content = Content;
            FontFactory.setContentManager(content);
            TextureLibrary.initModelLibrary(content);
            WeaponLibrary.initWeaponLibrary();
            TypeConverterLibrary.instantiate();
            Console.WriteLine(TypeConverterLibrary.getTypeConverter<int>().getTypeAsString());

            SpriteBatchWrapper.initialise();
            spriteBatch = new SpriteBatch(GraphicsDevice);
            mousePointer = Content.Load<Texture2D>("editor//mousepointer");
            EffectLibrary.basicEffect = Content.Load<Effect>("effects//effects");
            stateManager = new GameStateManager(new EntityLoader(new EntityManager(),
            (EntityManager entityManager) =>
            {
                entityManager.addEntity(Entity.EntityFactory.createHumanEntity(1000, new Vector2(0, 0), 0, true));
                entityManager.addEntity(Entity.EntityFactory.createHumanEntity(1000, new Vector2(10, 80), 0, true));
                entityManager.addEntity(Entity.EntityFactory.createHumanEntity(1000, new Vector2(300, 100), 1, true));
                entityManager.addEntity(Entity.EntityFactory.createHumanEntity(1000, new Vector2(300, 140), 1, true));
                entityManager.addEntity(Entity.EntityFactory.createMapComponent(new Vector2(100, 100),
                    new Vector2(100, 250), new Vector2(150, 240), new Vector2(140, 90)));
                entityManager.addEntity(Entity.EntityFactory.createMapComponent(new Vector2(-132, 100),
                    new Vector2(-50, -99), new Vector2(-50, -110), new Vector2(-100, -100)));
            }));
            layerManager.addLayerOnTop(new SaveLoadLayer(uiService));
            stateManager.pushState(new UnitSelectState(0, stateManager));
            GlobalStateInfo.setTotalPlayers(2);
            OutputConsole.writeLn("Loading");
        }
开发者ID:AliMohsen,项目名称:untitled-game,代码行数:30,代码来源:Game1.cs


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