Unity3d发布IOS9应用时出现中文乱码的解决方法
程序员文章站
2022-08-20 15:05:09
简单的说,解决方法就是批量修改ngui的label字体,修复ios就删除arial引起的中文乱码
我们来看具体如何操作
static public void y...
简单的说,解决方法就是批量修改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(); }