public static Particle createParticle(ParticleEnum particleType,Vector2 position, float size, Vector2 direction)
 {
     Particle particle = new Particle();
     particle.data.Position = position;
     particle.data.Scaling = size;
     particle.data.direction = direction;
     return createParticle(particle,particleType);
 }
示例#2
0
    public DataPlot(DataIntermediatePlot dip)
    {
        Name = dip.Name;

        Enums = new ParticleEnum[dip.Enums.Length];
        dip.Enums.CopyTo(Enums, 0);

        Properties = new Property[dip.Properties.Length];
        dip.Properties.CopyTo(Properties, 0);

        Particles = new FinalParticle[dip.Particles.Length];
        for (int index = 0; index < dip.Particles.Length; index++)
        {
            var p = dip.Particles[index];
            Particles[index] = new FinalParticle(p);
        }
    }
 private static Particle createParticle(Particle particle,ParticleEnum particleType)
 {
     if (particleType == ParticleEnum.Smoke)
     {
         Smoke smoke = new Smoke(particle.data.Position, particle.data.Scaling, particle.data.direction);
         smoke.init(null);
         return smoke;
     }
     if (particleType == ParticleEnum.Explosion)
     {
         Explosion explosion = new Explosion(particle.data.Position,particle.data.Scaling,particle.data.direction);
         explosion.init(null);
         return explosion;
     }
     return null;
 }