- 结构上迁移文件,将脚本分成 Base/Runtime/Presentation/Procedure/Editor 五大文件夹 - 调整 DataTable 和 Definition 下脚本的命名空间 - 依据 UI-5层架构设计规范 拆分原先的 UI 到 Runtime 和 Presentation 下
27 lines
916 B
C#
27 lines
916 B
C#
using UnityEditor;
|
|
|
|
namespace SepCore.Editor
|
|
{
|
|
public static class AutoRefreshToggle
|
|
{
|
|
private const string MenuPrefix = "Tools/Auto Refresh/";
|
|
|
|
[MenuItem(MenuPrefix + "Disable Auto Refresh &c", false, 1)]
|
|
public static void DisableAutoRefresh()
|
|
{
|
|
AssetDatabase.DisallowAutoRefresh();
|
|
EditorApplication.LockReloadAssemblies();
|
|
EditorUtility.DisplayDialog("Auto Refresh", "Auto refresh and assembly reload locked.", "OK");
|
|
}
|
|
|
|
[MenuItem(MenuPrefix + "Enable Auto Refresh &v", false, 2)]
|
|
public static void EnableAutoRefresh()
|
|
{
|
|
AssetDatabase.AllowAutoRefresh();
|
|
EditorApplication.UnlockReloadAssemblies();
|
|
AssetDatabase.Refresh();
|
|
EditorUtility.DisplayDialog("Auto Refresh", "Auto refresh and assembly reload enabled. Compiling now...", "OK");
|
|
}
|
|
}
|
|
}
|