/**************************************************** 文件:CreatWindowFont.cs 作者:张铮 邮箱:834207172@qq.com 日期:2022/3/6 16:31:29 功能:对更换字体功能进行重构 *****************************************************/ using System; using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; namespace Stary.Evo.Editor { public class CreatWindowFont : EditorWindow { private FontMode fontMode; private IFontChange fontChange = new ChangeFont(); private IFontChange defaultfontChange = new DefaultFontEditor(); [MenuItem("Evo/Utility/字体设置", false, 1)] static void Create() { GetWindow().Show(); } void OnGUI() { fontMode = (FontMode) GUILayout.Toolbar((int) fontMode, Enum.GetNames(typeof(FontMode))); switch (fontMode) { case FontMode.更换字体: fontChange.Creat(); break; case FontMode.默认字体: defaultfontChange.Creat(); break; } } } enum FontMode { 更换字体, 默认字体 } }