Skip to content

Commit ada421f

Browse files
committed
fix: bullets don't update in Unity 2019.4.13f1c1
1 parent bdef297 commit ada421f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Packages/bullet-storm-unity/Scripts/Runtime/BulletSystem/BulletSystemBase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected void Start()
5656
/// <summary>
5757
/// Executes tracing module.
5858
/// </summary>
59-
protected void Update()
59+
protected virtual void Update()
6060
{
6161
if (enableTracing) tracing.OnUpdate(this);
6262
}

Packages/bullet-storm-unity/Scripts/Runtime/BulletSystem/ParticleBulletSystem.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ public class ParticleBulletSystem : BulletSystemBase
3535
public override void ChangeVelocity(Func<Vector3, Vector3, Vector3> operation)
3636
{
3737
UpdateParticles();
38+
var renderMode = psr.renderMode;
3839
Parallel.For(0, particleCount, i =>
3940
{
4041
var oldVelocity = particles[i].velocity;
4142
particles[i].velocity = operation(particles[i].position, oldVelocity);
4243
// also change rotation if particle is mesh
43-
if (psr.renderMode == ParticleSystemRenderMode.Mesh)
44+
if (renderMode == ParticleSystemRenderMode.Mesh)
4445
{
4546
particles[i].rotation3D =
4647
(Quaternion.FromToRotation(oldVelocity == Vector3.zero ? Vector3.forward : oldVelocity,
@@ -150,8 +151,9 @@ private void Awake()
150151
#endif
151152
}
152153

153-
private void LateUpdate()
154+
protected override void Update()
154155
{
156+
base.Update();
155157
WriteParticles();
156158
}
157159
}

0 commit comments

Comments
 (0)