leafs frame system
This commit is contained in:
parent
21f619b607
commit
ebef28435b
1 changed files with 24 additions and 0 deletions
24
src/VFX.cs
24
src/VFX.cs
|
@ -74,6 +74,30 @@ static class VFX
|
|||
// }
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < leafs.count; i++)
|
||||
{
|
||||
Particle particle = leafs.particles[i];
|
||||
particle.state.Step(particle.pos.y > 0);
|
||||
if (particle.state.state)
|
||||
{
|
||||
particle.pos += particle.vel * Time.Stepf;
|
||||
float x_wind = Maths.smooth_stop(Maths.u_scalar(SKMath.Sin((particle.pos.x * 0.5f) - Time.Totalf)));
|
||||
particle.vel.x += x_wind * Time.Stepf;
|
||||
particle.vel += Vec3.Up * -9.81f * 0.1f * Time.Stepf;
|
||||
particle.ori = Quat.LookDir(particle.vel) * Quat.FromAngles(0, 0, 90);
|
||||
}
|
||||
else
|
||||
{
|
||||
particle.pos.y = 0;
|
||||
particle.vel = Vec3.Zero;
|
||||
|
||||
if (particle.state.delta == -1)
|
||||
{
|
||||
Ripple(particle.pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue