Пример #1
0
        protected override void LoadContent(DrawState state, Microsoft.Xna.Framework.Content.ContentManager manager)
        {
            SpriteFont font = manager.Load <SpriteFont>("Arial");

            this.stats.Font = font;
            this.text.Font  = font;

            //load the particle systems
            this.fireParticleSystem.ParticleSystemData  = manager.Load <ParticleSystemData>("Particles/Fire");
            this.smokeParticleSystem.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Smoke");
            this.burstParticleSystem.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Burst");

            //set the trigger for the burst effect
            ParticleSystemTrigger trigger = this.burstParticleSystem.GetTriggerByName("burst");

            for (int i = 0; i < this.burstSources.Length; i++)
            {
                this.burstSources[i].SetBurstTrigger(trigger);
            }


            //this will only have effect in DEBUG pc builds
            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.smokeParticleSystem);
            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.fireParticleSystem);
            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.burstParticleSystem);
        }
Пример #2
0
        protected override void LoadContent(DrawState state, Microsoft.Xna.Framework.Content.ContentManager manager)
        {
            //NEW CODE
            //load the particle system data
            this.particles.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Fireworks");


            //This is a special feature for DEBUG PC builds (this method does nothing otherwise).
            //This enables runtime particle system hotloading.
            //Hotloading will reload the particle system if the source file changes, allowing
            //runtime tweaking and editing of the particle system.
            //NOTE: Reloading complex particle systems may be unreliable

            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.particles);
        }
Пример #3
0
        protected override void LoadContent(DrawState state, Microsoft.Xna.Framework.Content.ContentManager manager)
        {
            this.stats.Font = manager.Load <SpriteFont>("Arial");
            this.particles.ParticleSystemData = manager.Load <ParticleSystemData>("Particles/Snow");

            //NEW CODE
            //Mask rendering for the different particle drawers.
            //This allows the snow and fog particles to be drawn using different drawing methods

            this.fogDrawer.SetParticleTypeDrawMask("fog", true);
            this.fogDrawer.SetParticleTypeDrawMask("snow", false);

            this.snowDrawer.SetParticleTypeDrawMask("fog", false);
            this.snowDrawer.SetParticleTypeDrawMask("snow", true);

            //this will only have effect in DEBUG pc builds
            ParticleSystemHotLoader.Monitor(this.UpdateManager, this.particles);
        }