fix: TextMeshProUGUI disappears when the Y-axis scale is changed

close #295
This commit is contained in:
mob-sakai
2025-01-14 19:59:49 +09:00
parent 2b44837bb9
commit 8159c091e8
+2 -2
View File
@@ -56,7 +56,7 @@ namespace Coffee.UIEffects
if (graphic is TextMeshProUGUI)
{
_prevLossyScaleY = transform.lossyScale.y;
UIExtraCallbacks.onAfterCanvasRebuild += CheckSDFScaleForTMP;
Canvas.willRenderCanvases += CheckSDFScaleForTMP;
UIExtraCallbacks.onScreenSizeChanged += SetVerticesDirtyForTMP;
}
#endif
@@ -69,8 +69,8 @@ namespace Coffee.UIEffects
protected override void OnDisable()
{
#if TMP_ENABLE
Canvas.willRenderCanvases -= CheckSDFScaleForTMP;
UIExtraCallbacks.onScreenSizeChanged -= SetVerticesDirtyForTMP;
UIExtraCallbacks.onAfterCanvasRebuild -= CheckSDFScaleForTMP;
#endif
MaterialRepository.Release(ref _material);