From ac1a05af4a54b0513f06c816fb1681165c6bce68 Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Wed, 9 Oct 2024 13:19:06 -0400 Subject: [PATCH] fix #173: integrators could fail to report as active when inputs don't change -this would then treat the transform as disabled so other integrators wouldn't run on it --- .../EffectIntegrators/EffectFloatIntegrator.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Waterfall/Effects/EffectIntegrators/EffectFloatIntegrator.cs b/Source/Waterfall/Effects/EffectIntegrators/EffectFloatIntegrator.cs index 2672e99..71f4575 100644 --- a/Source/Waterfall/Effects/EffectIntegrators/EffectFloatIntegrator.cs +++ b/Source/Waterfall/Effects/EffectIntegrators/EffectFloatIntegrator.cs @@ -59,11 +59,10 @@ public EffectFloatIntegrator(WaterfallEffect effect, EffectFloatModifier floatMo protected override void Apply() { - bool anyActive; - if (testIntensity) { - anyActive = false; + bool anyActive = false; + bool anyChanged = false; for (int i = renderers.Length; i-- > 0;) { float val = workingValues[i]; @@ -76,6 +75,7 @@ protected override void Apply() if (wasVisible != shouldBeVisible) { renderers[i].enabled = shouldBeVisible; + anyChanged = true; } if (shouldBeVisible) @@ -86,10 +86,12 @@ protected override void Apply() lastValues[i] = val; } + + if (anyChanged) active = anyActive; } else { - anyActive = true; + active = true; for (int i = renderers.Length; i-- > 0;) { float val = workingValues[i]; @@ -100,8 +102,6 @@ protected override void Apply() lastValues[i] = val; } } - - active = anyActive; } } }