Ejemplo n.º 1
0
		//===========================================================
		// Overridden Particle System Functions
		//===========================================================

		// Initialize internal particle systems after this one has been Initialized
		protected override void AfterInitialize()
		{
			mcParticleSystemManager = new ParticleSystemManager();

			mcFireworksExplosionParticleSystem1 = new FireworksExplosionParticleParticleSystem(Game);
			mcFireworksExplosionParticleSystem2 = new FireworksExplosionParticleParticleSystem(Game);
			mcFireworksExplosionParticleSystem3 = new FireworksExplosionParticleParticleSystem(Game);
			mcFireworksExplosionParticleSystem4 = new FireworksExplosionParticleParticleSystem(Game);
			mcFireworksExplosionSmokeParticleSystem = new FireworksExplosionParticleParticleSystem(Game);

			// Add all of the particle systems to the manager
			mcParticleSystemManager.AddParticleSystem(mcFireworksExplosionParticleSystem1);
			mcParticleSystemManager.AddParticleSystem(mcFireworksExplosionParticleSystem2);
			mcParticleSystemManager.AddParticleSystem(mcFireworksExplosionParticleSystem3);
			mcParticleSystemManager.AddParticleSystem(mcFireworksExplosionParticleSystem4);
			mcParticleSystemManager.AddParticleSystem(mcFireworksExplosionSmokeParticleSystem);

			// Initialize all of the Fireworks Particle Systems
			mcParticleSystemManager.AutoInitializeAllParticleSystems(GraphicsDevice, ContentManager, null);

			// Perform additional initialization work on the particle systems
			mcFireworksExplosionParticleSystem1.SetTexture("Textures/Star");
			mcFireworksExplosionParticleSystem2.SetTexture("Textures/Cloud");
			mcFireworksExplosionParticleSystem3.SetTexture("Textures/Spark");
			mcFireworksExplosionParticleSystem4.SetTexture("Textures/Particle");
			mcFireworksExplosionParticleSystem4.LoadShimmeringExplosionParticleEvents();
			mcFireworksExplosionSmokeParticleSystem.SetTexture("Textures/Smoke");
			mcFireworksExplosionSmokeParticleSystem.LoadExplosionSmokeParticleEvents();

			mcFireworksExplosionParticleSystem1.AutoMemoryManagerSettings.SecondsMaxNumberOfParticlesMustExistForBeforeReducingSize = 10;
			mcFireworksExplosionParticleSystem2.AutoMemoryManagerSettings.SecondsMaxNumberOfParticlesMustExistForBeforeReducingSize = 10;
			mcFireworksExplosionParticleSystem3.AutoMemoryManagerSettings.SecondsMaxNumberOfParticlesMustExistForBeforeReducingSize = 10;
			mcFireworksExplosionParticleSystem4.AutoMemoryManagerSettings.SecondsMaxNumberOfParticlesMustExistForBeforeReducingSize = 10;
			mcFireworksExplosionSmokeParticleSystem.AutoMemoryManagerSettings.SecondsMaxNumberOfParticlesMustExistForBeforeReducingSize = 10;
		}
Ejemplo n.º 2
0
		protected override void AfterDestroy()
		{
			if (mcParticleSystemManager != null)
				mcParticleSystemManager.DestroyAndRemoveAllParticleSystems();
			mcParticleSystemManager = null;

			mcFireworksExplosionParticleSystem1 = null;
			mcFireworksExplosionParticleSystem2 = null;
			mcFireworksExplosionParticleSystem3 = null;
			mcFireworksExplosionParticleSystem4 = null;
			mcFireworksExplosionSmokeParticleSystem = null;
		}