| | |
| | | string[] lines = File.ReadAllLines(writePath, Encoding.UTF8); |
| | | |
| | | int startIndex = 0; |
| | | int changeCnt = 0; |
| | | EditorApplication.update = delegate () { |
| | | string[] info = lines[startIndex].Split('\t'); |
| | | startIndex++; |
| | |
| | | Text item = transArr[index]; |
| | | if (item.name == name) |
| | | { |
| | | if (item.text != content) |
| | | { |
| | | item.text = content; |
| | | item.fontSize = item.fontSize - 2; |
| | | EditorUtility.SetDirty(_prefab); |
| | | }else |
| | | changeCnt++; |
| | | //Debug.LogFormat("字体批量文件--{0} , {1}", file, index); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Debug.LogErrorFormat("第{0}行替换失败{1},{2}", startIndex+1, file, name); |
| | | } |
| | |
| | | startIndex = 0; |
| | | AssetDatabase.SaveAssets(); |
| | | AssetDatabase.Refresh(); |
| | | Debug.LogFormat("字体批量修改成功--{0}", changeCnt); |
| | | } |
| | | }; |
| | | |