少年修仙传客户端基础资源
hch
2020-12-11 6ab4f430f523d7a85589c7eef9523f6fa6c48aea
Assets/Editor/Tool/ImportPrefabsWords.cs
@@ -27,6 +27,7 @@
        string[] lines = File.ReadAllLines(writePath, Encoding.UTF8);
        int startIndex = 0;
        int changeCnt = 0;
        EditorApplication.update = delegate () {
            string[] info = lines[startIndex].Split('\t');
            startIndex++;
@@ -66,9 +67,16 @@
            Text item = transArr[index];
            if (item.name == name)
            {
                item.text = content;
                EditorUtility.SetDirty(_prefab);
            }else
                if (item.text != content)
                {
                    item.text = content;
                    item.fontSize = item.fontSize - 2;
                    EditorUtility.SetDirty(_prefab);
                    changeCnt++;
                    //Debug.LogFormat("字体批量文件--{0} , {1}", file, index);
                 }
            }
            else
            {
                Debug.LogErrorFormat("第{0}行替换失败{1},{2}", startIndex+1, file, name);
            }
@@ -81,6 +89,7 @@
                startIndex = 0;
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
                Debug.LogFormat("字体批量修改成功--{0}", changeCnt);
            }
        };