From 8159c091e8a6805a7781046ae0f660a3be13862c Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:59:49 +0900 Subject: [PATCH] fix: TextMeshProUGUI disappears when the Y-axis scale is changed close #295 --- Packages/src/Runtime/UIEffectBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/src/Runtime/UIEffectBase.cs b/Packages/src/Runtime/UIEffectBase.cs index 06c5642..f1a3fba 100644 --- a/Packages/src/Runtime/UIEffectBase.cs +++ b/Packages/src/Runtime/UIEffectBase.cs @@ -56,7 +56,7 @@ protected override void OnEnable() if (graphic is TextMeshProUGUI) { _prevLossyScaleY = transform.lossyScale.y; - UIExtraCallbacks.onAfterCanvasRebuild += CheckSDFScaleForTMP; + Canvas.willRenderCanvases += CheckSDFScaleForTMP; UIExtraCallbacks.onScreenSizeChanged += SetVerticesDirtyForTMP; } #endif @@ -69,8 +69,8 @@ protected override void OnEnable() protected override void OnDisable() { #if TMP_ENABLE + Canvas.willRenderCanvases -= CheckSDFScaleForTMP; UIExtraCallbacks.onScreenSizeChanged -= SetVerticesDirtyForTMP; - UIExtraCallbacks.onAfterCanvasRebuild -= CheckSDFScaleForTMP; #endif MaterialRepository.Release(ref _material);