From 6b92005ad5fcde61878f1bf850d453c0fcda305b Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 23 十一月 2024 20:55:00 +0800
Subject: [PATCH] 0312 修改字体大小

---
 Assets/Editor/Tool/ChangePrefabsFontSize.cs |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/Assets/Editor/Tool/ChangePrefabsFontSize.cs b/Assets/Editor/Tool/ChangePrefabsFontSize.cs
index c9d17a4..8a97c19 100644
--- a/Assets/Editor/Tool/ChangePrefabsFontSize.cs
+++ b/Assets/Editor/Tool/ChangePrefabsFontSize.cs
@@ -22,8 +22,6 @@
     void OnGUI()
     {
         GUILayout.Label("瀛椾綋");
-        fromFont = (Font)EditorGUILayout.ObjectField(fromFont, typeof(Font), true, GUILayout.MinWidth(100f));
-        fromChangeFont = fromFont;
         if (GUILayout.Button("鏇存崲瀛椾綋澶у皬"))
         {
             Change();
@@ -59,22 +57,21 @@
             Text[] transArr14 = _prefab.GetComponentsInChildren<Text>(true);
             a += transArr14.Length;
 
+            bool change = false;
             foreach (Text item in transArr14)
             {
-                bool change = false;
-                if (item.text == "0")
+                if (item.fontSize == 22 && item.resizeTextForBestFit ==false && item.rectTransform.rect.height == 30)
                 {
-                    item.text = "";
+                    item.fontSize = 21;
                     change = true;
                 }
                     
-                if (change)
-                { 
-                    EditorUtility.SetDirty(_prefab);
-                    Debug.LogFormat("鐣岄潰 {0} 瀛椾綋澶у皬淇敼鎴愬姛", file);
-                    i++;
-                }
-
+            }
+            if (change)
+            {
+                EditorUtility.SetDirty(_prefab);
+                Debug.LogFormat("鐣岄潰 {0} 瀛椾綋澶у皬淇敼鎴愬姛", file);
+                i++;
             }
 
             startIndex++;

--
Gitblit v1.8.0