diff --git a/Basalt/Common/Components/BaseParticleSystem.cs b/Basalt/Common/Components/BaseParticleSystem.cs index 37b1e61..5b02ffa 100644 --- a/Basalt/Common/Components/BaseParticleSystem.cs +++ b/Basalt/Common/Components/BaseParticleSystem.cs @@ -1,5 +1,6 @@ using Basalt.Common.Entities; using Basalt.Types; +using System.Drawing; using System.Numerics; namespace Basalt.Common.Components @@ -94,7 +95,8 @@ public override void OnUpdate() { var dt = Time.DeltaTime; _systemLifetime += dt; - if (!Looping && _systemLifetime > SystemDuration) + + if (!Looping && _systemLifetime > SystemDuration + ParticleLifetime) return; for (int i = 0; i < _particles.Length; i++) @@ -104,6 +106,12 @@ public override void OnUpdate() _particleUpdate?.Invoke(ref _particles[i]); if (_particles[i].Lifetime > ParticleLifetime) { + if (!Looping && _systemLifetime > SystemDuration) + { + _particles[i] = defaults; + _particles[i].Color = Color.FromArgb(0x00000000); + continue; + } _particles[i] = defaults; _onParticleReset?.Invoke(ref _particles[i]); }