少年修仙传客户端基础资源
hch
2024-11-23 6b92005ad5fcde61878f1bf850d453c0fcda305b
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++;