mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:42:37 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b1af29cd4 | |||
| 65a00b480f | |||
| f508eb32ca | |||
| ecd265e482 | |||
| 58b197e551 | |||
| 8a0e7d6b26 | |||
| 3b52c3a8fc | |||
| 88261e2af0 | |||
| 791d867076 | |||
| 68ebae28e0 | |||
| 5cd48a4633 |
@@ -86,7 +86,8 @@ jobs:
|
||||
run: |
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git merge origin/${{ github.event.pull_request.base.ref }} --no-edit
|
||||
git rebase ${{ github.event.pull_request.base.sha }}
|
||||
git log --oneline -n 10
|
||||
|
||||
- name: 📥 Cache library
|
||||
uses: actions/cache@v4
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
## [5.8.7](https://github.com/mob-sakai/UIEffect/compare/5.8.6...5.8.7) (2025-06-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `GradationGradient` and `TransitionGradient` in reprica will be not dirty (editor) ([58b197e](https://github.com/mob-sakai/UIEffect/commit/58b197e551aea8efca10e12da8df132853d4a24e))
|
||||
* changes not reflected in rendering when TextMeshPro is cleared ([f508eb3](https://github.com/mob-sakai/UIEffect/commit/f508eb32caf6757eb4c27b98ac29a1582dcd14b4)), closes [#351](https://github.com/mob-sakai/UIEffect/issues/351)
|
||||
* setting `gradationScale` to 0 throws `DivideByZeroException` ([ecd265e](https://github.com/mob-sakai/UIEffect/commit/ecd265e4828c7f81c96a76c16df147b6c4804429))
|
||||
|
||||
## [5.8.6](https://github.com/mob-sakai/UIEffect/compare/5.8.5...5.8.6) (2025-05-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* some methods may be called multiple times when domain reload on play is disabled (editor) ([3b52c3a](https://github.com/mob-sakai/UIEffect/commit/3b52c3a8fc67980d426b8e4e2ed2067c725ca262))
|
||||
|
||||
## [5.8.5](https://github.com/mob-sakai/UIEffect/compare/5.8.4...5.8.5) (2025-05-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* skip processing when graphic is invalid ([5cd48a4](https://github.com/mob-sakai/UIEffect/commit/5cd48a463309270ec3d6501bde2add9944bbaf02))
|
||||
* TextMeshPro strikethrough and underline not displaying ([68ebae2](https://github.com/mob-sakai/UIEffect/commit/68ebae28e02045cb45996bf5b77d7d93d2f0ca82)), closes [#344](https://github.com/mob-sakai/UIEffect/issues/344)
|
||||
* TMP SubMeshUI generates overhead every frame (since 5.6.0) ([791d867](https://github.com/mob-sakai/UIEffect/commit/791d8670761902466d81412d832cddf013cd28cd)), closes [#343](https://github.com/mob-sakai/UIEffect/issues/343) [#345](https://github.com/mob-sakai/UIEffect/issues/345)
|
||||
|
||||
## [5.8.4](https://github.com/mob-sakai/UIEffect/compare/5.8.3...5.8.4) (2025-04-30)
|
||||
|
||||
|
||||
|
||||
@@ -1263,6 +1263,7 @@ namespace Coffee.UIEffects
|
||||
get => m_GradationScale;
|
||||
set
|
||||
{
|
||||
value = Mathf.Clamp(value, 0.01f, 10f);
|
||||
if (Mathf.Approximately(m_GradationScale, value)) return;
|
||||
context.m_GradationScale = m_GradationScale = value;
|
||||
SetMaterialDirty();
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
_canModifyMesh = true;
|
||||
_onBeforeCanvasRebuild ??= OnBeforeCanvasRebuild;
|
||||
_onAfterCanvasRebuild ??= OnAfterCanvasRebuild;
|
||||
UIExtraCallbacks.onBeforeCanvasRebuild += _onBeforeCanvasRebuild;
|
||||
@@ -99,8 +100,10 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected virtual void OnBeforeCanvasRebuild()
|
||||
{
|
||||
// If the mesh is not modified in the previous frame, try to modify it if possible.
|
||||
if (!_canModifyMesh && CanModifyMesh())
|
||||
{
|
||||
_canModifyMesh = true;
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
@@ -129,6 +132,8 @@ namespace Coffee.UIEffects
|
||||
|
||||
private bool CanModifyMesh()
|
||||
{
|
||||
if (!graphic || !graphic.isActiveAndEnabled) return false;
|
||||
|
||||
// The transitionRoot is same as the transform => true.
|
||||
var root = transitionRoot;
|
||||
if (transform == root) return true;
|
||||
|
||||
@@ -149,6 +149,12 @@ namespace Coffee.UIEffects
|
||||
protected override void OnValidate()
|
||||
{
|
||||
RefreshTarget(target);
|
||||
|
||||
if (preset || (target && !isTargetInScene))
|
||||
{
|
||||
context?.SetGradationDirty();
|
||||
}
|
||||
|
||||
base.OnValidate();
|
||||
}
|
||||
|
||||
|
||||
@@ -111,10 +111,19 @@ namespace Coffee.UIEffects
|
||||
private static readonly HashSet<TextMeshProUGUI> s_RegisteredInstances = new HashSet<TextMeshProUGUI>();
|
||||
private static readonly Dictionary<int, float> s_SdfScaleCache = new Dictionary<int, float>();
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void RuntimeInitializeOnLoadMethod()
|
||||
{
|
||||
s_ChangedInstances.Clear();
|
||||
s_RegisteredInstances.Clear();
|
||||
s_SdfScaleCache.Clear();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
#endif
|
||||
#else
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
#endif
|
||||
private static void InitializeOnLoad()
|
||||
{
|
||||
s_ChangedInstances.Clear();
|
||||
@@ -225,8 +234,15 @@ namespace Coffee.UIEffects
|
||||
for (var i = 0; i < textMeshProUGUI.textInfo.meshInfo.Length; i++)
|
||||
{
|
||||
var meshInfo = textMeshProUGUI.textInfo.meshInfo[i];
|
||||
if (meshInfo.vertexCount == 0)
|
||||
{
|
||||
s_Mesh.Clear(false);
|
||||
textMeshProUGUI.canvasRenderer.SetMesh(s_Mesh);
|
||||
continue;
|
||||
}
|
||||
|
||||
s_VertexHelper.Clear();
|
||||
meshInfo.mesh.CopyTo(s_VertexHelper, meshInfo.vertexCount, meshInfo.vertexCount * 6 / 4);
|
||||
meshInfo.mesh.CopyTo(s_VertexHelper);
|
||||
if (i == 0)
|
||||
{
|
||||
foreach (var modifier in modifiers)
|
||||
|
||||
@@ -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.8.4",
|
||||
"version": "5.8.7",
|
||||
"unity": "2020.3",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user