Esempio n. 1
0
 public void Update(float dt)
 {
     for (int index = 0; index < this.Particles.Count; ++index)
     {
         ExplodingUIElementEffect.ExplosionParticle particle = this.Particles[index];
         particle.Pos   += Utils.PolarToCartesian(particle.angle, particle.speed * dt);
         particle.speed -= particle.frictionSlowdownPerSec * dt;
         if ((double)particle.speed <= 0.0)
         {
             particle.speed = 0.0f;
         }
         particle.rotation     += particle.rotationRate * dt;
         particle.rotationRate -= (float)((double)particle.frictionSlowdownPerSec * (double)dt * 0.100000001490116);
         if ((double)particle.rotationRate <= 0.0)
         {
             particle.rotationRate = 0.0f;
         }
         particle.fade -= dt;
         if ((double)particle.fade <= 0.0)
         {
             this.Particles.RemoveAt(index);
             --index;
         }
         else
         {
             this.Particles[index] = particle;
         }
     }
 }
Esempio n. 2
0
 public void Render(SpriteBatch sb)
 {
     for (int index = 0; index < this.Particles.Count; ++index)
     {
         ExplodingUIElementEffect.ExplosionParticle particle = this.Particles[index];
         Texture2D texture2D = this.Textures[particle.textureIndex];
         if (texture2D.IsDisposed)
         {
             texture2D = Utils.white;
         }
         Vector2 scale = new Vector2(particle.Size / (float)texture2D.Width, particle.Size / (float)texture2D.Width);
         scale = new Vector2(Math.Min(scale.X, scale.Y), Math.Min(scale.X, scale.Y));
         float num = 1f - Math.Min(1f, Math.Max(0.0f, particle.fade / 2f));
         FlickeringTextEffect.DrawFlickeringSpriteFull(sb, particle.Pos, particle.rotation, scale, texture2D.GetCentreOrigin(), texture2D, particle.FlickerOffset, particle.Size, 0.0f, (object)OS.currentInstance, Utils.AddativeWhite * (particle.fade / 4f));
     }
 }