private void OnGUI() { EditorGUILayout.Space(); EditorGUILayout.LabelField("选择默认字体"); EditorGUILayout.Space(); m_font = (Font)EditorGUILayout.ObjectField(m_font, typeof(Font), true); EditorGUILayout.Space(); if (GUILayout.Button("确定")) { FontData data = new FontData(); data.defaultFont = m_font; ToolCacheManager.SaveCacheObject(PathManager.FontDataPath, data); window.Close(); } }
public static Font GetFont() { FontData data = AssetDatabase.LoadAssetAtPath <FontData>("Assets/ToolKit/Cache/FontData.asset"); return(data.defaultFont); }