当前位置: 首页 > news >正文

合肥建站软件小工具 wordpress

合肥建站软件,小工具 wordpress,android开发app,什么网站做调查能赚钱想要批量化替换项目预制体资源中Text组件引用的Font字体文件#xff0c;可以采用以下步骤。 1、在项目的Editor文件中#xff0c;新建一个名为FontToolEditor的C#脚本文件#xff0c;然后把以下代码复制粘贴到新建的FontToolEditor的C#脚本文件中。 using System.Collect…想要批量化替换项目预制体资源中Text组件引用的Font字体文件可以采用以下步骤。 1、在项目的Editor文件中新建一个名为FontToolEditor的C#脚本文件然后把以下代码复制粘贴到新建的FontToolEditor的C#脚本文件中。 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; using UnityEngine.UI; using System.Globalization;public class FontToolEditor : EditorWindow {private const string MENU_MAIN_WINDOW Tools/Font替换;private ListFont fontList new ListFont() { null };public Font toChange;static Font toChangeFont;public string path Assets/;static string path1;public int num 0;[MenuItem(MENU_MAIN_WINDOW)]public static void Open(){EditorWindow.GetWindow(typeof(FontToolEditor), true);}void OnGUI(){GUILayout.Space(5);GUILayout.Label(选择老字体, GUILayout.Width(100f));num EditorGUILayout.IntField(字体个数, num);AddMonsScriptList();GUILayout.Space(20);toChange (Font)EditorGUILayout.ObjectField(选择更换新字体, toChange, typeof(Font), true, GUILayout.MinWidth(100));toChangeFont toChange;GUILayout.Space(20);GUILayout.Label(路径, GUILayout.Width(50f));GUILayout.BeginHorizontal();{if (GUILayout.Button(浏览)){path EditorUtility.OpenFolderPanel(窗口标题, Application.streamingAssetsPath, );int index path.IndexOf(Assets);path path.Substring(index, path.Length - index) /;}}GUILayout.EndHorizontal();path1 path;GUILayout.TextField(path);if (GUILayout.Button(确认更换)){Init();}}private void AddMonsScriptList(){int scriptListCount fontList.Count - 1;for (int i 0; i num; i){if (scriptListCount i){//给脚本添加一个空值,为了界面好看,也为了下面缓存脚本fontList.Add(null);}fontList[i] (Font)EditorGUILayout.ObjectField(fontList[i], typeof(Font), true);}}private void Init(){ListGameObject prefabs new ListGameObject();var resourcesPath path1;var absolutePaths System.IO.Directory.GetFiles(resourcesPath, *.prefab, System.IO.SearchOption.AllDirectories);for (int i 0; i absolutePaths.Length; i){EditorUtility.DisplayProgressBar(字体转换中..., 字体转换中..., (float)i / absolutePaths.Length);string path absolutePaths[i].Replace(\\, /);GameObject prefab AssetDatabase.LoadAssetAtPath(path, typeof(GameObject)) as GameObject;//替换fontText[] labels prefab.GetComponentsInChildrenText(true);for (int q 0; q labels.Length; q){if (labels[q].font){for (int w 0; w fontList.Count; w){if (fontList[w].name labels[q].font.name){int fontSize labels[q].fontSize;var fonStyle labels[q].fontStyle;labels[q].font toChangeFont;labels[q].fontSize fontSize;labels[q].fontStyle fonStyle;EditorUtility.SetDirty(labels[q]);}}}}}AssetDatabase.SaveAssets();AssetDatabase.Refresh();EditorUtility.ClearProgressBar();} }2、保存FontToolEditor脚本文件中代码回到Unity中点击Unity主界面左上角中Tools然后再点击Font替换选项。 3、选择好老字体也就是需要被替换掉的字体再然后需要选择好需要更换的新字体再然后选择替换路径(也就是这个选择路径下的预支体才会进行字体替换)最后点击确认更换就可以。
http://www.zqtcl.cn/news/65163/

相关文章:

  • 响应式网站开发费用wordpress如何运行
  • 免费学编程国内网站长沙住房建设部网站
  • 平面设计软件下载官方网站设计培训网页
  • 做手机网站尺寸国外做美食视频网站有哪些
  • 接单网站设计 只做设计图报价安多网站制作
  • 贷款网站源码下载wordpress 2015
  • 怎么做网页导航栏汕头百度seo找谁
  • 自己做的网站怎么上传到网络做网站找顺的
  • 最简单的企业网站学校营销型网站
  • 奇艺广州网站建设熊掌号东营wordpress网站建设
  • 系统中没有安装wordpress外贸网站优化
  • 广东创粤建设有限公司网站百度关键词排名点击器
  • 网站建设公司广州百度站长工具有哪些
  • 国家城乡和住房建设部网站html5企业网站模板
  • 6入空间网站免费观看登封建设局网站
  • 如何建立免费公司网站舞蹈培训东莞网站建设
  • 网站开发培训做企业官网需要多少钱
  • 网站建设注意哪些问题金华建设公司网站
  • 深圳龙岗淘宝网站建设公司有哪些岳阳网红
  • 网站导航设计模板免备案空间哪家好
  • 大型网站建设优化排名电脑系统优化软件哪个好用
  • 那个网站有免费模板永州市建设网站
  • 视频互动网站建设photoshop手机版免费破解版
  • 小企业网站建设的基础知识启迪网站建设
  • 广州市做民宿什么网站比较好惠州响应式网站哪家好
  • 佛山网站建设凤软开源 wordpress 主题
  • 微服务网站wordpress怎么用畅言
  • 做网站优化有什么方法设计网站推荐设计酷站
  • 网站开发 脚本怎么写vs设置网站开发环境
  • 舟山建设网站有哪些网站免费学习建设网站的