Пример #1
0
 public TouchEmitter(ParticleManager man, Vector3 p)
     : base(man, p)
 {
     Emit = false;
     holdParticles = new Particle[6];
     for (int i = 0; i < holdParticles.Length; i++)
     {
         float betweenVal = MyMath.BetweenValue(0, holdParticles.Length, i);
         var part = new GradientEllipse(man, Vector3.Zero, 24)
         {
             Color = new Color(200, 235, 255),
             Scale = new Vector2(MyMath.Between(0.1f, 1f, betweenVal)),
             //Alpha = MyMath.BetweenValue(0.4f, 1, (float)Math.Pow(1 - betweenVal, 0.5f))
             Alpha = 0.25f
         };
         Behaviors.ParticleBehavior be = new Behaviors.Pulsate(part.Scale * 0.9f, part.Scale * 1.1f, betweenVal * 1.1f, 0.03f);
         part.Behaviors.Add(be);
         holdParticles[i] = part;
     }
 }