fix: TextMeshPro is not displayed in prefab mode

close #295
This commit is contained in:
mob-sakai
2025-01-14 19:41:56 +09:00
parent 1d849e54cb
commit 2b44837bb9
2 changed files with 12 additions and 10 deletions
-10
View File
@@ -164,11 +164,6 @@ namespace Coffee.UIEffects
if (isActiveAndEnabled)
{
OnTMPChanged(textMeshProUGUI);
var canvas = graphic.canvas;
if (canvas && graphic.isActiveAndEnabled)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2;
}
}
else if (0 < textMeshProUGUI.textInfo?.meshInfo?.Length
&& 0 < textMeshProUGUI.textInfo.meshInfo[0].vertexCount)
@@ -181,11 +176,6 @@ namespace Coffee.UIEffects
if (graphic)
{
graphic.SetVerticesDirty();
var canvas = graphic.canvas;
if (canvas && graphic.isActiveAndEnabled)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
}
}
}
@@ -65,6 +65,12 @@ namespace Coffee.UIEffects
UIVertexUtil.onLerpVertex = s_OnLerpVertex;
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
UIEffectContext.onModifyVertex = s_OnModifyVertex;
var canvas = graphic.canvas;
if (canvas)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
}
}
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex =
@@ -121,6 +127,12 @@ namespace Coffee.UIEffects
UIVertexUtil.onLerpVertex = s_OnLerpVertex;
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
UIEffectContext.onModifyVertex = s_OnModifyVertex;
var canvas = graphic.canvas;
if (canvas)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2;
}
}
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex =