Ver Fonte

一张图字体放大

wartheking há 3 semanas atrás
pai
commit
add6a91b81

+ 14 - 5
Assets/Editor/IncreaseTextFontSize.cs

@@ -2,13 +2,21 @@ using UnityEngine;
 using UnityEditor;
 using UnityEngine.UI;
 
-public class IncreaseTextFontSize : MonoBehaviour
+public class IncreaseSelectedTextFontSize : MonoBehaviour
 {
-    [MenuItem("Tools/Text字体工具/字体大小+2")]
-    private static void IncreaseFontSize()
+    [MenuItem("Tools/Text字体工具/选中对象下字体大小+2")]
+    private static void IncreaseFontSizeInSelected()
     {
+        GameObject selected = Selection.activeGameObject;
+        if (selected == null)
+        {
+            Debug.LogWarning("请先在场景中选择一个对象!");
+            return;
+        }
+
+        Text[] texts = selected.GetComponentsInChildren<Text>(true); // true 包括未激活对象
         int count = 0;
-        Text[] texts = GameObject.FindObjectsOfType<Text>(true); // true表示包括未激活对象
+
         foreach (Text text in texts)
         {
             Undo.RecordObject(text, "Increase Font Size");
@@ -16,6 +24,7 @@ public class IncreaseTextFontSize : MonoBehaviour
             EditorUtility.SetDirty(text);
             count++;
         }
-        Debug.Log($"已更新 {count} 个 Text 字体大小 +2");
+
+        Debug.Log($"在 \"{selected.name}\" 下更新了 {count} 个 Text 字体大小 +2");
     }
 }

+ 5 - 5
Assets/Prefabs/UI/LayerBtn.prefab

@@ -35,7 +35,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 180, y: -48.146736}
+  m_AnchoredPosition: {x: 180, y: -43.77}
   m_SizeDelta: {x: 175.1732, y: 32.4934}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &3428914980121713150
@@ -68,7 +68,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 18
+    m_FontSize: 20
     m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 1
@@ -329,8 +329,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 1, y: 0.5}
   m_AnchorMax: {x: 1, y: 0.5}
-  m_AnchoredPosition: {x: -50.583405, y: -1.5}
-  m_SizeDelta: {x: 64.1399, y: 32.4934}
+  m_AnchoredPosition: {x: -50.583405, y: -6}
+  m_SizeDelta: {x: 64.1399, y: 48.2993}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &2668898756655884031
 CanvasRenderer:
@@ -362,7 +362,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 24
+    m_FontSize: 26
     m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 1

+ 1 - 1
Assets/Prefabs/UI/RuntimePoint.prefab

@@ -597,7 +597,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 12
+    m_FontSize: 13
     m_FontStyle: 0
     m_BestFit: 0
     m_MinSize: 1

+ 1 - 1
Assets/Prefabs/UI/SecLayerBtn.prefab

@@ -68,7 +68,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 15
+    m_FontSize: 17
     m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 1

+ 11 - 11
Assets/Prefabs/UI/Thing3.prefab

@@ -36,7 +36,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 39.9909, y: 16}
+  m_SizeDelta: {x: 42.684, y: 23.541}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &4637747036145589441
 CanvasRenderer:
@@ -68,7 +68,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 12
+    m_FontSize: 14
     m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 1
@@ -116,7 +116,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 65.9651, y: 16}
+  m_SizeDelta: {x: 72.4284, y: 21}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &4637747037617293179
 CanvasRenderer:
@@ -148,7 +148,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 12
+    m_FontSize: 14
     m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 1
@@ -196,7 +196,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 33.562, y: 16}
+  m_SizeDelta: {x: 36.7937, y: 21}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &4637747037762015846
 CanvasRenderer:
@@ -228,7 +228,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 12
+    m_FontSize: 14
     m_FontStyle: 0
     m_BestFit: 0
     m_MinSize: 1
@@ -300,7 +300,7 @@ MonoBehaviour:
   m_Padding:
     m_Left: 19
     m_Right: 0
-    m_Top: 7
+    m_Top: 4
     m_Bottom: 0
   m_ChildAlignment: 0
   m_Spacing: 17.2
@@ -429,7 +429,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 30.8308, y: 16}
+  m_SizeDelta: {x: 43.2188, y: 20.8475}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &4637747038139636176
 CanvasRenderer:
@@ -461,7 +461,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 12
+    m_FontSize: 14
     m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 1
@@ -509,7 +509,7 @@ RectTransform:
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 86.3662, y: 16}
+  m_SizeDelta: {x: 88.5206, y: 23.5405}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &6593640882800683398
 CanvasRenderer:
@@ -541,7 +541,7 @@ MonoBehaviour:
       m_Calls: []
   m_FontData:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
-    m_FontSize: 12
+    m_FontSize: 14
     m_FontStyle: 1
     m_BestFit: 0
     m_MinSize: 1

Diff do ficheiro suprimidas por serem muito extensas
+ 241 - 239
Assets/Prefabs/UI/XHYZT/YZT.prefab


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 98
Assets/Scene 1.unity


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff