Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot bbb1f965fd chore(release): 5.3.4 [skip ci]
## [5.3.4](https://github.com/mob-sakai/UIEffect/compare/5.3.3...5.3.4) (2025-02-10)

### Bug Fixes

* UIEffect v5.3.3 with TextMeshPro is not working in play mode in editor ([365c43e](https://github.com/mob-sakai/UIEffect/commit/365c43e21dcaaff349cf1362f9bd25b7deb163f7)), closes [#306](https://github.com/mob-sakai/UIEffect/issues/306)
2025-02-10 06:29:40 +00:00
mob-sakai b778d02131 chore: update test workflow 2025-02-10 14:49:34 +09:00
mob-sakai 365c43e21d fix: UIEffect v5.3.3 with TextMeshPro is not working in play mode in editor
close #306
2025-02-10 14:38:43 +09:00
4 changed files with 29 additions and 10 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ env:
# MINIMUM_VERSION: The minimum version of Unity.
MINIMUM_VERSION: 2020.3
# EXCLUDE_FILTER: The excluded versions of Unity.
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.3)"
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.2|2023.3)"
on:
workflow_dispatch:
+7
View File
@@ -1,3 +1,10 @@
## [5.3.4](https://github.com/mob-sakai/UIEffect/compare/5.3.3...5.3.4) (2025-02-10)
### Bug Fixes
* UIEffect v5.3.3 with TextMeshPro is not working in play mode in editor ([365c43e](https://github.com/mob-sakai/UIEffect/commit/365c43e21dcaaff349cf1362f9bd25b7deb163f7)), closes [#306](https://github.com/mob-sakai/UIEffect/issues/306)
## [5.3.3](https://github.com/mob-sakai/UIEffect/compare/5.3.2...5.3.3) (2025-02-06)
+20 -8
View File
@@ -6,6 +6,7 @@ using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using Object = UnityEngine.Object;
namespace Coffee.UIEffects
{
@@ -54,9 +55,9 @@ namespace Coffee.UIEffects
public override void SetVerticesDirty(Graphic graphic)
{
if (graphic is TextMeshProUGUI textMeshProUGUI)
if (graphic is TextMeshProUGUI textMeshProUGUI && textMeshProUGUI.isActiveAndEnabled)
{
s_ChangedInstances.Add(textMeshProUGUI);
OnChangeText(textMeshProUGUI);
}
}
@@ -107,11 +108,13 @@ namespace Coffee.UIEffects
#if UNITY_EDITOR
[InitializeOnLoadMethod]
#else
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
#endif
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void InitializeOnLoad()
{
s_ChangedInstances.Clear();
s_RegisteredInstances.Clear();
s_SdfScaleCache.Clear();
Register(new TmpProxy());
// When the text is changed, add it to the changed list
@@ -129,16 +132,15 @@ namespace Coffee.UIEffects
var toRemove = InternalListPool<TextMeshProUGUI>.Rent();
foreach (var textMeshProUGUI in s_RegisteredInstances)
{
if (textMeshProUGUI)
if (textMeshProUGUI && textMeshProUGUI.isActiveAndEnabled)
{
var id = textMeshProUGUI.GetHashCode();
var lossyScaleY = textMeshProUGUI.transform.lossyScale.y;
// If the scale has changed, add to the changed list
if (s_SdfScaleCache.TryGetValue(id, out var prev)
&& !Mathf.Approximately(prev, lossyScaleY))
if (s_SdfScaleCache.TryGetValue(id, out var prev) && !Mathf.Approximately(prev, lossyScaleY))
{
s_ChangedInstances.Add(textMeshProUGUI);
OnChangeText(textMeshProUGUI);
}
// Update the scale cache
@@ -157,6 +159,8 @@ namespace Coffee.UIEffects
s_SdfScaleCache.Remove(textMeshProUGUI.GetHashCode());
s_RegisteredInstances.Remove(textMeshProUGUI);
}
InternalListPool<TextMeshProUGUI>.Return(ref toRemove);
};
// Modify the changed TMP mesh
@@ -172,6 +176,14 @@ namespace Coffee.UIEffects
};
}
private static void OnChangeText(Object obj)
{
if (obj is TextMeshProUGUI textMeshProUGUI && textMeshProUGUI.isActiveAndEnabled)
{
s_ChangedInstances.Add(textMeshProUGUI);
}
}
private static void ModifyMesh(TextMeshProUGUI textMeshProUGUI)
{
if (!textMeshProUGUI.TryGetComponent<UIEffectBase>(out var effect)) return;
+1 -1
View File
@@ -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.3.3",
"version": "5.3.4",
"unity": "2020.3",
"license": "MIT",
"repository": {