Unity3d发布IOS9应用时出现中文乱码的解决方法
简单的说,解决方法就是批量修改NGUI的label字体,修复ios就删除arial引起的中文乱码
我们来看具体如何操作
staticpublicvoidyaheifont() { uf=AssetDatabase.LoadAssetAtPath("Assets/yahei.prefab",typeof(UIFont))asUIFont; UnityEngine.Object[]objs=Selection.GetFiltered(typeof(UnityEngine.Object),SelectionMode.DeepAssets); foreach(UnityEngine.Object_objinobjs) { stringpath=AssetDatabase.GetAssetPath(_obj); Debug.Log("objname:"+_obj.name); UnityEngine.Object[]arr=AssetDatabase.LoadAllAssetsAtPath(path); Debug.Log("PATH:"+path); foreach(Objectjinarr) { if(j.GetType()==typeof(UILabel)) { (jasUILabel).bitmapFont=uf; Debug.Log("dfdfd:"+j.name+",tyep:"+j.GetType()); } } EditorUtility.SetDirty(_obj); } AssetDatabase.SaveAssets(); }