diff --git a/Packages/src/Editor/UIEffectPropertyEditor.cs b/Packages/src/Editor/UIEffectPropertyEditor.cs index fb30a5d..f9cec04 100644 --- a/Packages/src/Editor/UIEffectPropertyEditor.cs +++ b/Packages/src/Editor/UIEffectPropertyEditor.cs @@ -229,8 +229,6 @@ namespace Coffee.UIEffects.Editors EditorGUI.indentLevel--; } - EditorGUI.EndChangeCheck(); - // Sampling filter DrawSeparator(); if (DrawHeaderPopup(_samplingFilter)) diff --git a/Packages/src/Runtime/UIEffectReplica.cs b/Packages/src/Runtime/UIEffectReplica.cs index 379abfb..fb57f57 100644 --- a/Packages/src/Runtime/UIEffectReplica.cs +++ b/Packages/src/Runtime/UIEffectReplica.cs @@ -273,5 +273,33 @@ namespace Coffee.UIEffects m_Preset = null; } } + + public void SetTarget(UIEffectBase effect) + { + if (effect is UIEffect pEffect) + { + target = pEffect; + preset = null; + useTargetTransform = true; + customRoot = null; + samplingScale = pEffect.samplingScale; + } + else if (effect is UIEffectReplica pReplica) + { + target = pReplica.target; + preset = pReplica.preset; + useTargetTransform = pReplica.useTargetTransform; + customRoot = pReplica.customRoot; + samplingScale = pReplica.samplingScale; + } + else + { + target = null; + preset = null; + useTargetTransform = true; + customRoot = null; + samplingScale = 1; + } + } } } diff --git a/Packages/src/Runtime/Utilities/TmpProxy.cs b/Packages/src/Runtime/Utilities/TmpProxy.cs index f1cbdcb..b6702c3 100644 --- a/Packages/src/Runtime/Utilities/TmpProxy.cs +++ b/Packages/src/Runtime/Utilities/TmpProxy.cs @@ -282,25 +282,7 @@ namespace Coffee.UIEffects }); } - if (effect is UIEffect pEffect && pEffect.isActiveAndEnabled) - { - replica.target = pEffect; - replica.useTargetTransform = true; - replica.customRoot = null; - } - else if (effect is UIEffectReplica pReplica && pReplica.isActiveAndEnabled) - { - replica.target = pReplica.target; - replica.preset = pReplica.preset; - replica.useTargetTransform = pReplica.useTargetTransform; - replica.customRoot = pReplica.customRoot; - } - else - { - replica.target = null; - replica.customRoot = null; - } - + replica.SetTarget(effect); subMeshUI.GetComponents(subModifiers); foreach (var modifier in subModifiers) { diff --git a/Packages/src/Shaders/UIEffect.cginc b/Packages/src/Shaders/UIEffect.cginc index bb7b2b0..dac01e0 100644 --- a/Packages/src/Shaders/UIEffect.cginc +++ b/Packages/src/Shaders/UIEffect.cginc @@ -614,7 +614,7 @@ half4 uieffect(half4 origin, float2 uv, float4 uvMask, float4 wpos, UIEFFECT_FRA uvMask.x += 4; } - const float isShadow = uvMask.x < 0 ? 1 : 0; + const float isShadow = uvMask.x < -1 ? 1 : 0; uvMask.x += isShadow * 2; // Sampling.Pixelation