private void OnGUI() { try { EditorGUILayout.Space(); EditorUtil.Label("服务器自动热更检测程序"); EditorGUILayout.Space(); EditorUtil.Box("配置信息:", () => { checkRoot = PathField("资源检测路径", checkRoot); tableRoot = PathField("表格文件路径", tableRoot); tableOutRoot = PathField("生成后表格路径", tableOutRoot); quickHotUpdateRoot = PathField("热更新文件路径", quickHotUpdateRoot); }); EditorGUILayout.Space(); EditorUtil.Box("日志:", () => { EditorUtil.ScrollView(() => { EditorUtil.DisableGroup(() => { EditorGUILayout.TextArea(globalLog); }); }); }); EditorGUILayout.Space(); if (isRunning) { if (GUILayout.Button("停止")) { isRunning = false; EditorApplication.update -= EditorUpdate; } } else { if (GUILayout.Button("开始")) { isRunning = true; EditorApplication.update += EditorUpdate; } } EditorGUILayout.Space(); } catch (Exception e) { Debug.LogError("生成失败: " + e.Message + "\n" + e.StackTrace); EditorUtility.ClearProgressBar(); } }
private void OnGUI() { try { EditorGUILayout.Space(); EditorUtil.Label("提示!!! 若需要修改配置文件请转至 TableToolConfig.asset 中修改。"); EditorGUILayout.Space(); EditorUtil.Box("配置信息:", () => { EditorUtil.DisableGroup(() => { EditorUtil.Text("Assembly 名字", settings.assemblyName); EditorUtil.Text("命名空间", settings._namespace); PathField("类模版 文件路径", settings.classTemplatePath); PathField("属性模版 文件路径", settings.propertyTemplatePath); PathField("字典类模版 文件路径", settings.propertyDictionaryTemplatePath); PathField("内置类型 文件路径", settings.internalClassesPath); PathField("Excel表格 目录路径", settings.excelFolderPath); PathField("生成数据类 目录路径", settings.generateClassFolderPath); PathField("生成数据文件 目录路径", settings.generateAssetFolderPath); EditorUtil.Text("数据加密开关", settings.encrypt ? "打开" : "关闭"); EditorUtil.Text("数据加密Key", settings.encryptKey); }); }); EditorGUILayout.Space(); EditorUtil.Box("全部表格:", () => { if (!Directory.Exists(settings.excelFolderPath)) { EditorUtil.Label($"Excel表格路径不存在:{settings.excelFolderPath}", Color.red); } else { EditorUtil.ScrollView(() => { foreach (var fi in GetExcelList()) { EditorUtil.Label(" " + Path.GetFileName(fi)); } }); } }); EditorGUILayout.Space(); if (GUILayout.Button("生成Class")) { GeneAllClasses(); } if (GUILayout.Button("生成Asset")) { GeneAllAssets(); } EditorGUILayout.Space(); } catch (Exception e) { Debug.LogError("生成失败: " + e.Message + "\n" + e.StackTrace); EditorUtility.ClearProgressBar(); } }