示例#1
0
        public void AddParticlesFromSnapshot()
        {
            var particles = new List <Particle>();

            foreach (var snapshot in EmitterSnapshot)
            {
                var p = new Particle();
                //p.CollisionRadius = snapshot.??
                p.Alpha  = snapshot.Alpha;
                p.ColorB = snapshot.ColorB;
                p.ColorG = snapshot.ColorG;
                p.ColorR = snapshot.ColorR;
                p.CurrentAnimationFrame = snapshot.CurrentAnimationFrame;
                p.InitLife = snapshot.InitLife;
                p.IsDead   = snapshot.IsDead;
                p.Life     = snapshot.Life;
                p.Mass     = snapshot.Mass;
                p.Omega    = snapshot.Omega;
                p.Rotation = snapshot.Rotation;
                p.Scale    = snapshot.Scale;
                p.Vx       = snapshot.Vx;
                p.Vy       = snapshot.Vy;
                p.X        = snapshot.X;
                p.Y        = snapshot.Y;
                particles.Add(p);
            }
            Emitter.AddParticles(particles);
        }