瀏覽代碼

编辑器工具菜单优化

guodong 2 年之前
父節點
當前提交
2bfddfd3e6
共有 1 個文件被更改,包括 52 次插入45 次删除
  1. 52 45
      GameClient/Assets/Editor/ToolsMenu.cs

+ 52 - 45
GameClient/Assets/Editor/ToolsMenu.cs

@@ -28,7 +28,7 @@ namespace GFGEditor
         }
 
 #if PT_TEMP || PT_TISHEN || PT_DEV
-        
+
 #else
         [MenuItem("策划/更新并导入所有", false, (int)TOOL_MENU_PRIORITY.UpdateAndImportAll)]
         static void UpdateAndImportAll()
@@ -87,47 +87,9 @@ namespace GFGEditor
         }
 
         [MenuItem("策划/其它/导入配置表", false, (int)TOOL_MENU_PRIORITY.ImportExcel)]
-        public static void ImportExcel()
+        public static void ImportExcelNeiWang()
         {
-            Log.ILog = new UnityLogger();
-            ET.Options.Instance = new ET.Options();
-            EditorUtility.DisplayProgressBar("进度", "正在导入表格", 1);
-            SqliteController.Instance.dirPath = Path.Combine(Environment.CurrentDirectory, ResPathUtil.CONFIG_DIR_PATH);
-            SqliteController.Instance.Init(false, null);
-            SQLiteHelper.Instance.OpenConnection();
-            //try
-            //{
-
-            SQLiteHelper.Instance.ClearAllTables();
-            CodeTemplateFactory.Init();
-
-            if (!Directory.Exists(ExcelConfig.configCodePath))
-            {
-                Directory.CreateDirectory(ExcelConfig.configCodePath);
-            }
-            if (!Directory.Exists(ExcelConfig.configArrayCodePath))
-            {
-                Directory.CreateDirectory(ExcelConfig.configArrayCodePath);
-            }
-
-            ExcelReader.WriteExcle();
-            ExcelReader.ReadExcel(CodeBuilder.GenerateCode);
-            //}
-            //catch (Exception e)
-            //{
-            //    throw (e.InnerException);
-            //}
-            //finally
-            //{
-            SQLiteHelper.Instance.CloseConnection();
-            //}
-            //开始扫描表格,自动生成部分数据
-            ExcelScanner.StartScan();
-            //拷贝slqlite文件至共享库
-            File.Copy(ResPathUtil.SQLITE_FILE_PATH, ExcelConfig.sqliteFilePathCSShare, true);
-            AssetDatabase.Refresh();
-            EditorUtility.ClearProgressBar();
-            SQLiteHelper.Instance.CloseConnection();
+            ImportExcel();
         }
 
         [MenuItem("策划/检查配置表", false, (int)TOOL_MENU_PRIORITY.CheckExcel)]
@@ -140,11 +102,9 @@ namespace GFGEditor
         }
 
         [MenuItem("策划/其它/导入美术资源", false, (int)TOOL_MENU_PRIORITY.ImportArtRes)]
-        public static void ImportArtRes()
+        public static void ImportArtResNeiWang()
         {
-            EditorUtility.DisplayProgressBar("进度", "正在导入美术资源", 1);
-            ImportArtResTool.Import();
-            EditorUtility.ClearProgressBar();
+            ImportArtRes();
         }
 #endif
 
@@ -180,7 +140,54 @@ namespace GFGEditor
             ProcessUtil.ExcuteBat("Assets/Editor/Bat/", "commitBundles.bat");
             EditorUtility.ClearProgressBar();
         }
+        public static void ImportArtRes()
+        {
+            EditorUtility.DisplayProgressBar("进度", "正在导入美术资源", 1);
+            ImportArtResTool.Import();
+            EditorUtility.ClearProgressBar();
+        }
+        public static void ImportExcel()
+        {
+            Log.ILog = new UnityLogger();
+            ET.Options.Instance = new ET.Options();
+            EditorUtility.DisplayProgressBar("进度", "正在导入表格", 1);
+            SqliteController.Instance.dirPath = Path.Combine(Environment.CurrentDirectory, ResPathUtil.CONFIG_DIR_PATH);
+            SqliteController.Instance.Init(false, null);
+            SQLiteHelper.Instance.OpenConnection();
+            //try
+            //{
+
+            SQLiteHelper.Instance.ClearAllTables();
+            CodeTemplateFactory.Init();
 
+            if (!Directory.Exists(ExcelConfig.configCodePath))
+            {
+                Directory.CreateDirectory(ExcelConfig.configCodePath);
+            }
+            if (!Directory.Exists(ExcelConfig.configArrayCodePath))
+            {
+                Directory.CreateDirectory(ExcelConfig.configArrayCodePath);
+            }
+
+            ExcelReader.WriteExcle();
+            ExcelReader.ReadExcel(CodeBuilder.GenerateCode);
+            //}
+            //catch (Exception e)
+            //{
+            //    throw (e.InnerException);
+            //}
+            //finally
+            //{
+            SQLiteHelper.Instance.CloseConnection();
+            //}
+            //开始扫描表格,自动生成部分数据
+            ExcelScanner.StartScan();
+            //拷贝slqlite文件至共享库
+            File.Copy(ResPathUtil.SQLITE_FILE_PATH, ExcelConfig.sqliteFilePathCSShare, true);
+            AssetDatabase.Refresh();
+            EditorUtility.ClearProgressBar();
+            SQLiteHelper.Instance.CloseConnection();
+        }
         static void UpdateAndImportArtRes()
         {
             UpdateArtRes();