Esempio n. 1
0
            public void Reset(ParticleSystem system)
            {
                available.Clear();

                for (int i = 0; i < particles.Length; i++)
                {
                    available.Add(particles[i]);
                }
            }
Esempio n. 2
0
            public ParticlePool(ParticleSystem system, int maxParticles)
            {
                particles = new Particle[maxParticles];
                available = new List<Particle>();

                for (int i = 0; i < particles.Length; i++)
                {
                    particles[i] = CreateParticle(system);
                }

                Reset(system);
            }
Esempio n. 3
0
 public void Update(ParticleSystem system, long delta)
 {
     timer -= delta;
     if (timer <= 0)
     {
         timer = interval;
         Particle p = system.GetNewParticle(this, 1000);
         p.SetColor(1, 1, 1, 0.5f);
         p.SetPosition(x, y);
         p.SetSize(size);
         float vx = (-0.02f + (MathUtils.Random() * 0.04f));
         float vy = (-(MathUtils.Random() * 0.15f));
         p.SetVelocity(vx, vy, 1.1f);
     }
 }
Esempio n. 4
0
 public Particle(ParticleSystem engine)
 {
     this.engine = engine;
 }
Esempio n. 5
0
 public bool UsePoints(ParticleSystem system)
 {
     return false;
 }
Esempio n. 6
0
 protected internal static Particle CreateParticle(ParticleSystem system)
 {
     return new Particle(system);
 }