/// <summary> /// Find all Text in the scene and change its font. /// </summary> private void ChangeAllFontsButton() { EditorGUILayout.Space(); if (GUILayout.Button("Change All Fonts In Scene")) { GlobalFontManager.ChangeAllFonts(); SceneView.lastActiveSceneView.Repaint(); UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); } }
/// <summary> /// Checks if a FontData assets is created, else it creates one. /// </summary> /// <param name="selectedFont"></param> private void SetGlobalFontData(Font selectedFont) { if (!File.Exists(string.Format("{0}{1}{2}.asset", Application.dataPath, GlobalFontUtils.SAVE_PATH, selectedFont.name))) { GlobalFontUtils.SaveGlobalFont(selectedFont); GlobalFontManager.Init(); } else { if (!GlobalFontManager.IsInit) { EditorPrefs.SetString(GlobalFontUtils.GLOBAL_FONT_KEY, selectedFont.name); GlobalFontManager.Init(); } else { GlobalFontManager.GlobalFontData = GlobalFontUtils.LoadGlobalFont(selectedFont.name); } } }