简单的说,解决方法就是批量修改NGUI的label字体,修复ios就删除arial引起的中文乱码
我们来看具体如何操作
static public void yaheifont() { uf = AssetDatabase.LoadAssetAtPath(\"Assets/yahei.prefab\",typeof( UIFont)) as UIFont; UnityEngine.Object[] objs = Selection.GetFiltered (typeof(UnityEngine.Object), SelectionMode.DeepAssets); foreach (UnityEngine.Object _obj in objs) { string path = AssetDatabase.GetAssetPath(_obj); Debug.Log(\"objname:\"+_obj.name); UnityEngine.Object[] arr = AssetDatabase.LoadAllAssetsAtPath(path); Debug.Log(\"PATH:\"+path); foreach (Object j in arr) { if(j.GetType()==typeof(UILabel)) { (j as UILabel).bitmapFont = uf; Debug.Log(\"dfdfd:\" + j.name + \",tyep:\" + j.GetType()); } } EditorUtility.SetDirty(_obj); } AssetDatabase.SaveAssets(); }
本文地址:https://www.stayed.cn/item/25983
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我