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


C# ResourceManager.Find方法代码示例

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


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

示例1: Initialize

        protected override void Initialize()
        {
            FontMgr = new ResourceManager<SpriteFont>(this);
            TextureMgr = new ResourceManager<Texture2D>(this);
            ModelMgr = new ResourceManager<Model>(this);
            MusicMgr = new ResourceManager<Song>(this);
            SfxMgr = new ResourceManager<SoundEffect>(this);

            LoadAssets();

            PressStartScreen = TextureMgr.Find("startscreen");
            PressStartRectangle = new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height);
            Texture2D pauseTex = TextureMgr.Find("pause");
            PausedRectangle = new Rectangle((Window.ClientBounds.Width - pauseTex.Width) / 2, (Window.ClientBounds.Height - pauseTex.Height) / 2,
                                            pauseTex.Width, pauseTex.Height);

            MediaPlayer.Play(MusicMgr.Find("RenditionIntro"));

            FpsHandler = new FpsCounter(this, FPS_INTERVAL);
            InputMgr = new InputManager(this);
            ModelDisplayer = new ModelDisplay(this);
            HeadsUpDisplay = new HUD(this);

            Car = new Vehicle(this, "L200-FBX", new Vector3(80, 80, -80), 0.01f, new Vector3(0, MathHelper.Pi, 0));
            Ground = new Terrain(this, new Vector3(0, 0, 0), "colormap", "heightmap", 7.0f, 0.15f);
            GameTrack = new Track(this, Ground);

            GameCamera = Car.Camera;
            //GameCamera = new FreeCamera(this, new Vector3(0, 0, 2), Vector3.Zero, Vector3.Zero);

            Components.Add(FpsHandler);
            Components.Add(InputMgr);
            Components.Add(ModelDisplayer);
            Components.Add(GameTrack);
            Components.Add(Car); //Mettre GameCamera apres Car pour eviter les problemes

            Components.Add(GameCamera);

            //Laisser FpsDisplayer a la fin de la liste pour eviter les problemes d'affichage
            Components.Add(HeadsUpDisplay);

            base.Initialize();

            Car.Enabled = false;
            HeadsUpDisplay.ToggleChronometer();
        }
开发者ID:abusque,项目名称:racexna,代码行数:46,代码来源:RacingGame.cs

示例2: Initialize

        protected override void Initialize()
        {
            //Resource Managers
            FontMgr = new ResourceManager<SpriteFont>(this);
            TextureMgr = new ResourceManager<Texture2D>(this);
            MusicMgr = new ResourceManager<Song>(this);
            SfxMgr = new ResourceManager<SoundEffect>(this);

            LoadAssets();

            FpsHandler = new FpsCounter(this, FPS_INTERVAL);
            InputMgr = new InputManager(this);

            Player = new Player(this, new Vector2(100.0f, 100.0f));
            Level = new Level(this, "testlvl");
            Camera = new Camera(this);
            LevelMusic = MusicMgr.Find("song1");
            //MediaPlayer.Play(LevelMusic);
            MediaPlayer.Volume = 0.5f;
            //Enemies = new List<Enemy>();
            //Enemies.Add(new Enemy(this, new Vector2(200.0f, 300.0f), 75.0f, 100, 10));
            EnemySpawner = new EnemySpawner(this, 100, true, 1.0f, new Vector2(200.0f, 300.0f));
            Pickables = new List<Pickable>();
            Pickables.Add(new GunPickable(this, new Vector2(300.0f, 300.0f), "Shotgun"));
            Pickables.Add(new GunPickable(this, new Vector2(350.0f, 300.0f), "SMG"));
            Pickables.Add(new GunPickable(this, new Vector2(400.0f, 300.0f), "Shotgun"));

            FpsDisplayer = new FpsDisplay(this, "Arial14");
            FpsDisplayer.Enabled = false; //We don't want the FPS to be shown as default
            FpsDisplayer.Initialize();

            HUD = new HUD(this, "Arial14");
            HUD.Initialize();

            Components.Add(FpsHandler);
            Components.Add(InputMgr);
            Components.Add(Level);
            Components.Add(Player);
            Components.Add(EnemySpawner);
            Components.Add(Camera);

            base.Initialize();
        }
开发者ID:lachose1,项目名称:zombiefactory,代码行数:43,代码来源:ZombieGame.cs


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