| #if UNITY_EDITOR | 
| using UnityEditor; | 
| using UnityEngine; | 
| using System.Collections; | 
|   | 
| public class FontMakerWindow : EditorWindow { | 
|   | 
|     void OnGUI () { | 
|   | 
|         GUIStyle labelStyle = new GUIStyle(); | 
|         labelStyle.normal.textColor = Color.yellow; | 
|         labelStyle.fontSize = 14; | 
|         labelStyle.alignment = TextAnchor.MiddleLeft; | 
|   | 
|         GUIStyle ButtonStyle = new GUIStyle(); | 
|         ButtonStyle.normal.textColor = Color.yellow; | 
|         ButtonStyle.fontSize = 14; | 
|         ButtonStyle.alignment = TextAnchor.MiddleCenter; | 
|   | 
|         GUILayout.BeginVertical(); | 
|         GUILayout.Space(20); | 
|         EditorGUILayout.LabelField("1.创建一个CustomFont,并为Font指定该CustomFont", labelStyle); | 
|         GUILayout.Space(10); | 
|         EditorGUI.indentLevel += 1; | 
|         GUILayout.BeginHorizontal(); | 
|         EditorGUILayout.LabelField("Font", labelStyle); | 
|         FontMaker.m_myFont = EditorGUILayout.ObjectField(FontMaker.m_myFont, typeof(Font)) as Font; | 
|         GUILayout.EndHorizontal(); | 
|         EditorGUI.indentLevel -= 1; | 
|         GUILayout.Space(20); | 
|         EditorGUILayout.LabelField("2.将BMF中导出的字体信息文件拷贝到Unity工程中\n并为Data指定该文件", labelStyle); | 
|         GUILayout.Space(10); | 
|         EditorGUI.indentLevel += 1; | 
|         GUILayout.BeginHorizontal(); | 
|         EditorGUILayout.LabelField("Data", labelStyle); | 
|         FontMaker.m_data = EditorGUILayout.ObjectField(FontMaker.m_data, typeof(TextAsset)) as TextAsset; | 
|         GUILayout.EndHorizontal(); | 
|         EditorGUI.indentLevel -= 1; | 
|         GUILayout.Space(20); | 
|   | 
|         GUILayout.BeginHorizontal(); | 
|         GUILayout.Space(150); | 
|         if (GUILayout.Button("创建", GUILayout.Height(40))) { | 
|             FontMaker.GenerateCharacterInfo(); | 
|         } | 
|         GUILayout.Space(150); | 
|         GUILayout.EndHorizontal(); | 
|         GUILayout.EndVertical(); | 
|   | 
|     } | 
|   | 
| } | 
| #endif |