Ejemplo n.º 1
0
 public override void Initialize()
 {
     base.Initialize();
     modelManager = Game.Services.GetService(typeof(ModelManager)) as ModelManager;
     genComponentManager = Game.Services.GetService(typeof(GeneralComponentManager)) as GeneralComponentManager;
     toonAnimatedEffect = Game.Content.Load<Effect>("Shaders\\ToonSkinnedEffect");
     effectCellShading = Game.Content.Load<Effect>("Shaders\\CellShader");
 }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            int height = 600;
            int width = 1000;

            graphics.PreferredBackBufferWidth = width;
            graphics.PreferredBackBufferHeight = height;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();

            float maxX = GraphicsDevice.Viewport.Width;
            float maxY = GraphicsDevice.Viewport.Height;
            float xRatio = maxX / 600;
            float yRatio = maxY / 1000;
            average = (xRatio + yRatio) / 2;

            camera = new CameraComponent(this);
            Components.Add(camera);
            Services.AddService(typeof(CameraComponent), camera);

            modelManager = new ModelManager(this);
            Components.Add(modelManager);
            Services.AddService(typeof(ModelManager), modelManager);

            genComponentManager = new GeneralComponentManager(this);
            Components.Add(genComponentManager);
            Services.AddService(typeof(GeneralComponentManager), genComponentManager);

            entities = new EntityManager(this);
            Components.Add(entities);
            Services.AddService(typeof(EntityManager), entities);

            particles = new ParticleManager(this);
            Components.Add(particles);
            Services.AddService(typeof(ParticleManager), particles);

            modelDrawer = new BoundingBoxDrawer(this);

            base.Initialize();
        }