using UnityEditor; using UnityEngine; namespace TyphoonUI { /// /// 偏好设置 /// public class Preferences : ScriptableObject { /*快捷导出快捷键*/ public string Keymap = "%e"; /*默认命名空间*/ public string DefaultNamespace = "TyphoonUIExport"; /*绘制UIObject*/ public bool DrawUIObjectHierarchy = true; /*绘制导出Node*/ public bool DrawUINodeHierarchy = true; /*运行时任然绘制*/ public bool DrawHierarchyInPlayingMode = true; /*play时自动更新UIPackage*/ public bool UpdateUIPackageOnPlaying = true; private static Preferences _default = null; public static Preferences Default => TyphoonUIEditor.CreateOrLoadScriptableObject($"Assets/Typhoon_Gen/TyphoonUI/Editor/Preferences.asset", ref _default); public void Save() { EditorUtility.SetDirty(this); AssetDatabase.SaveAssets(); } } }