private void FireNewMissile() { Missile missile = new Missile(Content, ship); missiles.Add(missile); var effect = new JetParticleEffect(particleSystem, missile); effect.MinXDirection = 0.6f; effect.MaxXDirection = 0.8f; effect.MinZDirection = -0.025f; effect.MaxZDirection = 0.025f; effect.MinYDirection = -0.025f; effect.MaxYDirection = 0.025f; effect.ParticlesPerSecond = 30.0; effect.ParticleLifetime = 2000.0; effect.ParticleSize = 0.2f; effect.ParticleSpeed = 5.0f; missileEffects.Add(effect); missileEffectsByMissile.Add(missile, effect); }
private void DeleteMissile(Missile missile) { missiles.Remove(missile); JetParticleEffect effect; if (missileEffectsByMissile.TryGetValue(missile, out effect)) { effect.StopSpawningParticles(); missileEffectsByMissile.Remove(missile); } }