diff --git a/Source/Waterfall/Modules/ModuleWaterfallFX.cs b/Source/Waterfall/Modules/ModuleWaterfallFX.cs index 0348b8f..9c4052b 100644 --- a/Source/Waterfall/Modules/ModuleWaterfallFX.cs +++ b/Source/Waterfall/Modules/ModuleWaterfallFX.cs @@ -106,8 +106,9 @@ private void GatherRenderers() hasAdditiveShaders = false; hasAlphaBlendedShaders = false; - foreach (var fx in activeFX) + for (int i = activeFX.Count; i-- > 0;) { + var fx = activeFX[i]; foreach (var renderer in fx.effectRenderers) { Material mat = renderer.material; @@ -116,6 +117,12 @@ private void GatherRenderers() if (mat.HasProperty(ShaderPropertyID._Strength)) { mat.renderQueue = Settings.DistortQueue; + if (!Settings.EnableDistortion) + { + fx.CleanupEffect(); + activeFX.RemoveAt(i); + break; + } } else {