From a03c93db2dd64c9e660f0c2eb12e78b3563ff0f8 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 14 五月 2026 11:33:38 +0800
Subject: [PATCH] 634 H5适配 将Text更换为TextEx工具适配异步
---
Assets/Editor/Tool/ChangeTextAndImage.cs | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Assets/Editor/Tool/ChangeTextAndImage.cs b/Assets/Editor/Tool/ChangeTextAndImage.cs
index 6228764..a55c7c4 100644
--- a/Assets/Editor/Tool/ChangeTextAndImage.cs
+++ b/Assets/Editor/Tool/ChangeTextAndImage.cs
@@ -78,7 +78,12 @@
TextEx textEx = go.AddMissingComponent<TextEx>();
textEx.text = textContent;
- textEx.font = FontUtility.preferred;
+ var font = FontUtility.preferred;
+ if (font == null)
+ {
+ font = AssetDatabase.LoadAssetAtPath<Font>("Assets/ResourcesOut/Font/GameFont1.ttf");
+ }
+ textEx.font = font;
textEx.fontSize = textFontSize;
textEx.raycastTarget = false;
textEx.alignment = TextAnchor.MiddleCenter;
--
Gitblit v1.8.0