Example #1
1
 public void Emit(ParticleParameters particleParameters, Vector2 position, Vector2 speed)
 {
     var particle = _particlePool.GetParticle(particleParameters);
     particle.Position = position;
     particle.Speed = speed;
     _particles.Add(particle);
 }
Example #2
0
 public void Reset(ParticleParameters particleParameters)
 {
     IsDestroyed = false;
     _particleParameters = particleParameters;
     _step = 1f / _particleParameters.Duration;
     _state = 0f;
 }
Example #3
0
 public Particle GetParticle(ParticleParameters particleParameters)
 {
     Particle particle;
     if (_particles.TryTake(out particle))
     {
         particle.Reset(particleParameters);
         return particle;
     }
     return new Particle(particleParameters);
 }
Example #4
0
 public Particle(ParticleParameters particleParameters)
 {
     Reset(particleParameters);
 }