| | |
| | | filepaths1.CopyTo(filepaths, 0); |
| | | filepaths2.CopyTo(filepaths, filepaths1.Length); |
| | | Debug.LogFormat("预修改预制体字体总数:{0}", filepaths.Length); |
| | | int startIndex = 0; |
| | | int startIndex = 0; //文件执行个数 |
| | | |
| | | int a = 0; |
| | | int i = 0; |
| | | int a = 0; // 总字体数 |
| | | int i = 0; // 更换字体数 |
| | | EditorApplication.update = delegate () { |
| | | string file = filepaths[startIndex]; |
| | | file = file.Substring(file.IndexOf("Assets")); |
| | |
| | | if (item.font == fromChangeFont) |
| | | { |
| | | item.font = toChangeFont; |
| | | item.fontSize = item.fontSize - 2; |
| | | EditorUtility.SetDirty(_prefab); |
| | | i++; |
| | | } |
| | |
| | | startIndex++; |
| | | |
| | | if (isCancel || startIndex >= filepaths.Length) { |
| | | Debug.LogFormat("字体批量修改成功--检索{0}个预制体, 字体总个数{1},修改{2}", startIndex, a, i); |
| | | EditorUtility.ClearProgressBar(); |
| | | EditorApplication.update = null; |
| | | startIndex = 0; |
| | | AssetDatabase.SaveAssets(); |
| | | AssetDatabase.Refresh(); |
| | | Debug.LogFormat("字体批量修改成功--{0}", i); |
| | | } |
| | | }; |
| | | } |