public List<Particle> GetParticles()
{
if(particles.Count > 0) {
List<Particle> p;
lock(lckParticles) {
p = particles;
particles = new List<Particle>();
}
return p;
}
return null;
}
public void UpdateAnimations(GameState s, float dt) { var np = s.GetParticles(); if(np == null) np = new List<Particle>(); for(int i = 0; i < FriendlyUnitModels.Count; i++) { FriendlyUnitModels[i].Animate(s, dt, np); } for(int i = 0; i < NonFriendlyUnitModels.Count; i++) { NonFriendlyUnitModels[i].Animate(s, dt, np); } pRenderer.Update(np, dt); }