你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> Unity3d發布IOS9應用時出現中文亂碼的解決方法

Unity3d發布IOS9應用時出現中文亂碼的解決方法

編輯:IOS開發綜合

簡單的說,解決方法就是批量修改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();
  }

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved