mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:33:09 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 889c7ff578 | |||
| 5994f8875e | |||
| b2d70af9c3 | |||
| da535854cc | |||
| bc1578b0ca | |||
| d3779f9f57 |
@@ -1,3 +1,19 @@
|
||||
## [5.2.4](https://github.com/mob-sakai/UIEffect/compare/5.2.3...5.2.4) (2025-01-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* properties may not update correctly when changed via code or animation ([5994f88](https://github.com/mob-sakai/UIEffect/commit/5994f8875ed2280e5c863c30f9c7900d4dce70ed)), closes [#300](https://github.com/mob-sakai/UIEffect/issues/300)
|
||||
|
||||
## [5.2.3](https://github.com/mob-sakai/UIEffect/compare/5.2.2...5.2.3) (2025-01-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `SamplingFilter.None` now correctly respects the sampling scale setting ([bc1578b](https://github.com/mob-sakai/UIEffect/commit/bc1578b0ca91b830b976bf200d387d0ac6963ae6))
|
||||
* fix the shadow mode inspector in editor ([da53585](https://github.com/mob-sakai/UIEffect/commit/da535854ccbeeb98b2556423425d39058bd5f479))
|
||||
* UIEffect may not work correctly when using `FallbackAtlas` with TextMeshProUGUI ([d3779f9](https://github.com/mob-sakai/UIEffect/commit/d3779f9f57d0410fa4526527ebed30885bfbc2dd)), closes [#298](https://github.com/mob-sakai/UIEffect/issues/298)
|
||||
|
||||
## [5.2.2](https://github.com/mob-sakai/UIEffect/compare/5.2.1...5.2.2) (2025-01-18)
|
||||
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@ namespace Coffee.UIEffects.Editors
|
||||
EditorGUILayout.Slider(_shadowDistanceX, 0, 1, "Reflection");
|
||||
EditorGUILayout.PropertyField(_shadowDistanceY, EditorGUIUtility.TrTempContent("Offset"));
|
||||
EditorGUILayout.PropertyField(_shadowMirrorScale);
|
||||
EditorGUILayout.PropertyField(_shadowFade);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,13 +268,14 @@ namespace Coffee.UIEffects.Editors
|
||||
|
||||
EditorGUILayout.PropertyField(_shadowDistance);
|
||||
EditorGUILayout.PropertyField(_shadowIteration);
|
||||
prevColorFilter = (ColorFilter)_shadowColorFilter.intValue;
|
||||
EditorGUILayout.PropertyField(_shadowColorFilter);
|
||||
DrawColor(_shadowColorFilter, _shadowColor, prevColorFilter, false);
|
||||
EditorGUILayout.PropertyField(_shadowColorGlow);
|
||||
EditorGUILayout.PropertyField(_shadowFade);
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(_shadowColorFilter);
|
||||
DrawColorPickerField(_shadowColor, false);
|
||||
EditorGUILayout.PropertyField(_shadowColorGlow);
|
||||
EditorGUILayout.PropertyField(_shadowFade);
|
||||
|
||||
// Shadow blur intensity
|
||||
switch ((SamplingFilter)_samplingFilter.intValue)
|
||||
{
|
||||
case SamplingFilter.BlurFast:
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ToneFilter == value) return;
|
||||
context.toneFilter = m_ToneFilter = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_ToneIntensity, value)) return;
|
||||
context.toneIntensity = m_ToneIntensity = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ColorFilter == value) return;
|
||||
context.colorFilter = m_ColorFilter = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_ColorIntensity, value)) return;
|
||||
context.colorIntensity = m_ColorIntensity = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace Coffee.UIEffects
|
||||
m_Color.a = 1;
|
||||
if (m_Color == value) return;
|
||||
context.color = m_Color = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ColorGlow == value) return;
|
||||
context.colorGlow = m_ColorGlow = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace Coffee.UIEffects
|
||||
if (m_SamplingFilter == value) return;
|
||||
context.samplingFilter = m_SamplingFilter = value;
|
||||
SetVerticesDirty();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_SamplingIntensity, value)) return;
|
||||
context.samplingIntensity = m_SamplingIntensity = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,13 +286,11 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0.01f, 100);
|
||||
if (Mathf.Approximately(m_SamplingScale, value)) return;
|
||||
m_SamplingScale = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public override float actualSamplingScale => samplingFilter != SamplingFilter.None
|
||||
? Mathf.Clamp(m_SamplingScale, 0.01f, 100)
|
||||
: 1;
|
||||
public override float actualSamplingScale => Mathf.Clamp(m_SamplingScale, 0.01f, 100);
|
||||
|
||||
public override bool canModifyShape => m_AllowToModifyMeshShape;
|
||||
|
||||
@@ -307,7 +305,7 @@ namespace Coffee.UIEffects
|
||||
if (m_TransitionFilter == value) return;
|
||||
context.transitionFilter = m_TransitionFilter = value;
|
||||
SetVerticesDirty();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +320,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_TransitionRate, value)) return;
|
||||
context.transitionRate = m_TransitionRate = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +331,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TransitionReverse == value) return;
|
||||
context.transitionReverse = m_TransitionReverse = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +342,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TransitionTex == value) return;
|
||||
context.transitionTex = m_TransitionTex = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,7 +353,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TransitionTexScale == value) return;
|
||||
context.transitionTexScale = m_TransitionTexScale = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,7 +364,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TransitionTexOffset == value) return;
|
||||
context.transitionTexOffset = m_TransitionTexOffset = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +398,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_TransitionWidth, value)) return;
|
||||
context.transitionWidth = m_TransitionWidth = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,7 +410,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_TransitionSoftness, value)) return;
|
||||
context.transitionSoftness = m_TransitionSoftness = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,7 +421,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TransitionColorFilter == value) return;
|
||||
context.transitionColorFilter = m_TransitionColorFilter = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +432,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TransitionColor == value) return;
|
||||
context.transitionColor = m_TransitionColor = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +443,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TransitionColorGlow == value) return;
|
||||
context.transitionColorGlow = m_TransitionColorGlow = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +454,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TargetMode == value) return;
|
||||
context.targetMode = m_TargetMode = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +465,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_TargetColor == value) return;
|
||||
context.targetColor = m_TargetColor = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +477,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_TargetRange, value)) return;
|
||||
context.targetRange = m_TargetRange = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,7 +489,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_TargetSoftness, value)) return;
|
||||
context.targetSoftness = m_TargetSoftness = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +502,7 @@ namespace Coffee.UIEffects
|
||||
(m_SrcBlendMode, m_DstBlendMode) = (m_BlendType, m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
context.srcBlendMode = m_SrcBlendMode;
|
||||
context.dstBlendMode = m_DstBlendMode;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,7 +518,7 @@ namespace Coffee.UIEffects
|
||||
if (m_SrcBlendMode == value) return;
|
||||
context.srcBlendMode = m_SrcBlendMode = value;
|
||||
m_BlendType = (m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,7 +534,7 @@ namespace Coffee.UIEffects
|
||||
if (m_DstBlendMode == value) return;
|
||||
context.dstBlendMode = m_DstBlendMode = value;
|
||||
m_BlendType = (m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,7 +604,7 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0, 1);
|
||||
if (Mathf.Approximately(m_ShadowBlurIntensity, value)) return;
|
||||
context.shadowBlurIntensity = m_ShadowBlurIntensity = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -617,7 +615,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ShadowColorFilter == value) return;
|
||||
context.shadowColorFilter = m_ShadowColorFilter = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -628,7 +626,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ShadowColor == value) return;
|
||||
context.shadowColor = m_ShadowColor = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +637,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ShadowColorGlow == value) return;
|
||||
context.shadowColorGlow = m_ShadowColorGlow = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,13 +726,13 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
(m_SrcBlendMode, m_DstBlendMode) = (m_BlendType, m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
base.OnEnable();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
base.OnDisable();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
@@ -962,7 +960,6 @@ namespace Coffee.UIEffects
|
||||
m_GradationRotation = preset.m_GradationRotation;
|
||||
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
@@ -1024,7 +1021,6 @@ namespace Coffee.UIEffects
|
||||
m_GradationRotation = c.gradationRotation;
|
||||
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,8 @@ namespace Coffee.UIEffects
|
||||
protected override void OnDidApplyAnimationProperties()
|
||||
{
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
|
||||
public virtual void SetVerticesDirty()
|
||||
@@ -176,6 +177,9 @@ namespace Coffee.UIEffects
|
||||
if (graphic)
|
||||
{
|
||||
graphic.SetVerticesDirty();
|
||||
#if UNITY_EDITOR
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,6 +188,9 @@ namespace Coffee.UIEffects
|
||||
if (graphic)
|
||||
{
|
||||
graphic.SetMaterialDirty();
|
||||
#if UNITY_EDITOR
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +265,7 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
else if (i - 1 < subMeshes.Count)
|
||||
{
|
||||
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material);
|
||||
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, i - 1);
|
||||
if (!target || !subMeshUI) break;
|
||||
|
||||
var replica = subMeshUI.GetOrAddComponent<UIEffectReplica>();
|
||||
@@ -285,11 +292,13 @@ namespace Coffee.UIEffects
|
||||
s_Mesh.Clear(false);
|
||||
}
|
||||
|
||||
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material)
|
||||
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material, int start)
|
||||
{
|
||||
for (var j = 0; j < subMeshes.Count; j++)
|
||||
var count = subMeshes.Count;
|
||||
for (var j = 0; j < count; j++)
|
||||
{
|
||||
if (subMeshes[j].sharedMaterial == material) return subMeshes[j];
|
||||
var s = subMeshes[(j + start + count) % count];
|
||||
if (s.sharedMaterial == material) return s;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -50,13 +50,11 @@ namespace Coffee.UIEffects
|
||||
value = Mathf.Clamp(value, 0.01f, 100);
|
||||
if (Mathf.Approximately(m_SamplingScale, value)) return;
|
||||
m_SamplingScale = value;
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public override float actualSamplingScale => target && target.samplingFilter != SamplingFilter.None
|
||||
? Mathf.Clamp(m_SamplingScale, 0.01f, 100)
|
||||
: 1;
|
||||
public override float actualSamplingScale => Mathf.Clamp(m_SamplingScale, 0.01f, 100);
|
||||
|
||||
public override bool canModifyShape => m_AllowToModifyMeshShape;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "com.coffee.ui-effect",
|
||||
"displayName": "UI Effect",
|
||||
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
|
||||
"version": "5.2.2",
|
||||
"version": "5.2.4",
|
||||
"unity": "2020.3",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user