static void SavePrefabGroup() { string path = EditorUtility.SaveFolderPanel("Export Font Group", Application.dataPath, ""); if (path.Length != 0) { string filePath = string.Empty; Transform[] selection = Selection.transforms; if (selection.Length == 0) { Debug.LogWarning("Please Select Prefab."); return; } XMLFontGroup grp = new XMLFontGroup(); List<string> fontList = new List<string>(); for (int i = 0; i < selection.Length; i++) { GameObject go = selection[i].gameObject; UIFont font = go.GetComponent<UIFont>(); fontList.Add(font.name); } grp.FontNames = fontList.ToArray(); filePath = path + "/Font.xml"; if (ZinSerializerForXML.Serialization<XMLFontGroup>(grp, filePath)) { Debug.Log("Export file: " + filePath); } Selection.objects = selection; } }
private IEnumerator LoadFont (string fileName, string xmlFileName) { // 폰트 xml 로드 yield return StartCoroutine (dataManager.LoadXML (packageName, xmlFileName)); if (dataManager.xml != null) { XMLFontGroup objGrp = ZinSerializerForXML.Deserialization<XMLFontGroup> (dataManager.xml); this.fontXml = objGrp; } else { this.isLoaded = false; yield return 0; } // 폰트 로드 yield return StartCoroutine (dataManager.LoadGameObject (packageName, fileName, this.fontXml.FontNames)); if (dataManager.loadObj != null) { GameObject[] objectList = dataManager.loadObj; for (int i = 0; i < objectList.Length; i++) { this.fontList.Add (objectList [i].name, objectList [i].GetComponent<UIFont> ()); } } else { this.isLoaded = false; } }