Esempio n. 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);
 }
Esempio n. 2
0
 public void Reset(ParticleParameters particleParameters)
 {
     IsDestroyed = false;
     _particleParameters = particleParameters;
     _step = 1f / _particleParameters.Duration;
     _state = 0f;
 }
Esempio n. 3
0
 public Particle GetParticle(ParticleParameters particleParameters)
 {
     Particle particle;
     if (_particles.TryTake(out particle))
     {
         particle.Reset(particleParameters);
         return particle;
     }
     return new Particle(particleParameters);
 }
Esempio n. 4
0
 public Particle(ParticleParameters particleParameters)
 {
     Reset(particleParameters);
 }