Beispiel #1
0
        // called before the stage unloads content
        public virtual void UnloadContent()
        {
            if (bloom != null)
            {
                bloom.UnloadContent();
                bloom = null;
            }

            Sun.UnloadContent();
            sun = null;

            particleEffect = null;
            decalEffect = null;

            if ( defaultFont != null )
            {
                defaultFont = null;
            }

            if (spriteBatch != null)
            {
                spriteBatch.Dispose();
                spriteBatch = null;
            }

            RModel.UnloadContent();

            ClearTables();
        }
Beispiel #2
0
        public virtual void LoadContent()
        {
            spriteBatch = new SpriteBatch(graphicsDevice);
            defaultFont = Stage.Content.Load<SpriteFont>("DefaultFont");

            particleEffect = new BasicEffect(graphicsDevice);
            //particleEffect.EnableDefaultLighting();

            particleEffect.TextureEnabled = true;

            decalEffect = new DecalEffect(Stage.Content.Load<Effect>("Effects/v2/Decal"));

            sun = new Sun(Color.White.ToVector4(), new Vector4(.2f, .2f, .2f, 1.0f), 45.0f, 45.0f);

            bloom = new Bloom();
            bloom.LoadContent();
            #if DEBUG
            collisionDebugDrawer = new BEPUphysicsDrawer.Models.InstancedModelDrawer(graphicsDevice, Stage.Content.ServiceProvider);
            #endif
        }