修改Velocity over Lifetime,但是Unity并没有提供直接修改Velocity over Lifetime的方法,我们需要手动修改每个存在的粒子的速度。
void LateUpdate () { ParticleSystem.Particle[] particles = new ParticleSystem.Particle[particleSystem.particleCount]; int count = particleSystem.GetParticles(particles); for(int i = 0; i < count; i++) { particles[i].velocity = new Vector3(0, speed, 0); } particleSystem.SetParticles(particles, count); }