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


C# EntityManager.RequestEntity方法代码示例

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


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

示例1: LoadContent

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load fonts
            hudFont = Content.Load<SpriteFont>("Fonts/Hud");

            // Load overlay textures
            winOverlay = Content.Load<Texture2D>("Overlays/you_win");
            loseOverlay = Content.Load<Texture2D>("Overlays/you_lose");
            diedOverlay = Content.Load<Texture2D>("Overlays/you_died");

            //Known issue that you get exceptions if you use Media PLayer while connected to your PC
            //See http://social.msdn.microsoft.com/Forums/en/windowsphone7series/thread/c8a243d2-d360-46b1-96bd-62b1ef268c66
            //Which means its impossible to test this from VS.
            //So we have to catch the exception and throw it away
            try
            {
                MediaPlayer.IsRepeating = true;
                MediaPlayer.Play(Content.Load<Song>("Sounds/Music"));
            }
            catch { }

            entityManager = EntityManager.GetInstance;
            entityManager.Kernel = this;
            entityManager.setDevices(GraphicsDevice, Content, spriteBatch);
            for (int i = 0; i < 12500; i++)
            {
                entityManager.RequestEntity<GemNew>();
            }
            entityManager.RequestEntity<TestEntity>();
            LoadNextLevel();
        }
开发者ID:RobinTandy,项目名称:Monoport,代码行数:38,代码来源:Kernel.cs


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