RTSEngine.Data.GameState.GetParticles C# (CSharp) Method

GetParticles() public method

public GetParticles ( ) : List
return List
        public List<Particle> GetParticles()
        {
            if(particles.Count > 0) {
                List<Particle> p;
                lock(lckParticles) {
                    p = particles;
                    particles = new List<Particle>();
                }
                return p;
            }
            return null;
        }

Usage Example

示例#1
0
 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);
 }