tanghai 3 лет назад
Родитель
Сommit
c31e90d583

+ 21 - 39
Unity/Assets/Scripts/Editor/Helper/ShellHelper.cs

@@ -6,35 +6,21 @@ namespace ET
 {
     public static class ShellHelper
     {
-        private static string shellApp
-        {
-            get
-            {
-#if UNITY_EDITOR_WIN
-			    string app = "cmd.exe";
-#elif UNITY_EDITOR_OSX
-                string app = "bash";
-#endif
-                return app;
-            }
-        }
-
-        private static volatile bool isFinish;
-
         public static void Run(string cmd, string workDirectory, List<string> environmentVars = null)
         {
-            Process p = new();
+            Process process = new();
             try
             {
-                ProcessStartInfo start = new ProcessStartInfo(shellApp);
-
 #if UNITY_EDITOR_OSX
+                string app = "bash";
                 string splitChar = ":";
-                start.Arguments = "-c";
+                string arguments = "-c";
 #elif UNITY_EDITOR_WIN
+                string app = "cmd.exe";
                 string splitChar = ";";
-                start.Arguments = "/c";
+                string arguments = "/c";
 #endif
+                ProcessStartInfo start = new ProcessStartInfo(app);
 
                 if (environmentVars != null)
                 {
@@ -44,8 +30,8 @@ namespace ET
                     }
                 }
 
-                p.StartInfo = start;
-                start.Arguments += (" \"" + cmd + "\"");
+                process.StartInfo = start;
+                start.Arguments = arguments + " \"" + cmd + "\"";
                 start.CreateNoWindow = true;
                 start.ErrorDialog = true;
                 start.UseShellExecute = false;
@@ -66,11 +52,10 @@ namespace ET
                     start.StandardErrorEncoding = System.Text.Encoding.UTF8;
                 }
 
-                bool hasError = false;
                 bool endOutput = false;
                 bool endError = false;
 
-                p.OutputDataReceived += (sender, args) =>
+                process.OutputDataReceived += (sender, args) =>
                 {
                     if (args.Data != null)
                     {
@@ -82,7 +67,7 @@ namespace ET
                     }
                 };
 
-                p.ErrorDataReceived += (sender, args) =>
+                process.ErrorDataReceived += (sender, args) =>
                 {
                     if (args.Data != null)
                     {
@@ -94,27 +79,24 @@ namespace ET
                     }
                 };
 
-                p.Start();
-                p.BeginOutputReadLine();
-                p.BeginErrorReadLine();
-
-                while (!endOutput || !endError) { }
+                process.Start();
+                process.BeginOutputReadLine();
+                process.BeginErrorReadLine();
 
-                p.CancelOutputRead();
-                p.CancelErrorRead();
-
-                if (hasError)
+                while (!endOutput || !endError)
                 {
-                    UnityEngine.Debug.LogError("has error!");
                 }
+
+                process.CancelOutputRead();
+                process.CancelErrorRead();
             }
             catch (Exception e)
             {
                 UnityEngine.Debug.LogException(e);
-                if (p != null)
-                {
-                    p.Close();
-                }
+            }
+            finally
+            {
+                process.Close();
             }
         }
     }

+ 2 - 4
Unity/Packages/manifest.json

@@ -1,11 +1,9 @@
 {
   "dependencies": {
-    "com.unity.ide.rider": "3.0.14",
-    "com.unity.ide.visualstudio": "2.0.15",
-    "com.unity.render-pipelines.universal": "12.1.6",
+    "com.unity.ide.rider": "3.0.15",
+    "com.unity.render-pipelines.universal": "12.1.7",
     "com.unity.textmeshpro": "3.0.6",
     "com.unity.timeline": "1.7.1",
-    "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.1",
     "com.unity.ugui": "1.0.0",
     "com.unity.modules.ai": "1.0.0",
     "com.unity.modules.androidjni": "1.0.0",

+ 15 - 61
Unity/Packages/packages-lock.json

@@ -1,48 +1,39 @@
 {
   "dependencies": {
     "com.unity.burst": {
-      "version": "1.6.5",
+      "version": "1.6.6",
       "depth": 1,
       "source": "registry",
       "dependencies": {
         "com.unity.mathematics": "1.2.1"
       },
-      "url": "https://packages.unity.cn"
+      "url": "https://packages.unity.com"
     },
     "com.unity.ext.nunit": {
       "version": "1.0.6",
       "depth": 1,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.cn"
+      "url": "https://packages.unity.com"
     },
     "com.unity.ide.rider": {
-      "version": "3.0.14",
+      "version": "3.0.15",
       "depth": 0,
       "source": "registry",
       "dependencies": {
         "com.unity.ext.nunit": "1.0.6"
       },
-      "url": "https://packages.unity.cn"
-    },
-    "com.unity.ide.visualstudio": {
-      "version": "2.0.15",
-      "depth": 0,
-      "source": "registry",
-      "dependencies": {
-        "com.unity.test-framework": "1.1.9"
-      },
-      "url": "https://packages.unity.cn"
+      "url": "https://packages.unity.com"
     },
     "com.unity.mathematics": {
       "version": "1.2.6",
       "depth": 1,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.cn"
+      "url": "https://packages.unity.com"
     },
     "com.unity.render-pipelines.core": {
-      "version": "12.1.6",
+      "version": "12.1.7",
       "depth": 1,
       "source": "builtin",
       "dependencies": {
@@ -52,14 +43,14 @@
       }
     },
     "com.unity.render-pipelines.universal": {
-      "version": "12.1.6",
+      "version": "12.1.7",
       "depth": 0,
       "source": "builtin",
       "dependencies": {
         "com.unity.mathematics": "1.2.1",
         "com.unity.burst": "1.5.0",
-        "com.unity.render-pipelines.core": "12.1.6",
-        "com.unity.shadergraph": "12.1.6"
+        "com.unity.render-pipelines.core": "12.1.7",
+        "com.unity.shadergraph": "12.1.7"
       }
     },
     "com.unity.searcher": {
@@ -67,44 +58,17 @@
       "depth": 2,
       "source": "registry",
       "dependencies": {},
-      "url": "https://packages.unity.cn"
+      "url": "https://packages.unity.com"
     },
     "com.unity.shadergraph": {
-      "version": "12.1.6",
+      "version": "12.1.7",
       "depth": 1,
       "source": "builtin",
       "dependencies": {
-        "com.unity.render-pipelines.core": "12.1.6",
+        "com.unity.render-pipelines.core": "12.1.7",
         "com.unity.searcher": "4.9.1"
       }
     },
-    "com.unity.sysroot": {
-      "version": "2.0.2",
-      "depth": 1,
-      "source": "registry",
-      "dependencies": {},
-      "url": "https://packages.unity.cn"
-    },
-    "com.unity.sysroot.linux-x86_64": {
-      "version": "2.0.1",
-      "depth": 1,
-      "source": "registry",
-      "dependencies": {
-        "com.unity.sysroot": "2.0.2"
-      },
-      "url": "https://packages.unity.cn"
-    },
-    "com.unity.test-framework": {
-      "version": "1.1.31",
-      "depth": 1,
-      "source": "registry",
-      "dependencies": {
-        "com.unity.ext.nunit": "1.0.6",
-        "com.unity.modules.imgui": "1.0.0",
-        "com.unity.modules.jsonserialize": "1.0.0"
-      },
-      "url": "https://packages.unity.cn"
-    },
     "com.unity.textmeshpro": {
       "version": "3.0.6",
       "depth": 0,
@@ -112,7 +76,7 @@
       "dependencies": {
         "com.unity.ugui": "1.0.0"
       },
-      "url": "https://packages.unity.cn"
+      "url": "https://packages.unity.com"
     },
     "com.unity.timeline": {
       "version": "1.7.1",
@@ -124,17 +88,7 @@
         "com.unity.modules.audio": "1.0.0",
         "com.unity.modules.particlesystem": "1.0.0"
       },
-      "url": "https://packages.unity.cn"
-    },
-    "com.unity.toolchain.win-x86_64-linux-x86_64": {
-      "version": "2.0.1",
-      "depth": 0,
-      "source": "registry",
-      "dependencies": {
-        "com.unity.sysroot": "2.0.2",
-        "com.unity.sysroot.linux-x86_64": "2.0.1"
-      },
-      "url": "https://packages.unity.cn"
+      "url": "https://packages.unity.com"
     },
     "com.unity.ugui": {
       "version": "1.0.0",

+ 7 - 15
Unity/ProjectSettings/PackageManagerSettings.asset

@@ -12,32 +12,24 @@ MonoBehaviour:
   m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
   m_Name: 
   m_EditorClassIdentifier: 
-  m_EnablePreviewPackages: 1
+  m_EnablePreReleasePackages: 0
   m_EnablePackageDependencies: 1
   m_AdvancedSettingsExpanded: 1
   m_ScopedRegistriesSettingsExpanded: 1
+  m_SeeAllPackageVersions: 0
   oneTimeWarningShown: 1
   m_Registries:
   - m_Id: main
     m_Name: 
-    m_Url: https://packages.unity.cn
+    m_Url: https://packages.unity.com
     m_Scopes: []
     m_IsDefault: 1
     m_Capabilities: 7
   m_UserSelectedRegistryName: 
   m_UserAddingNewScopedRegistry: 0
   m_RegistryInfoDraft:
-    m_ErrorMessage: 
-    m_Original:
-      m_Id: 
-      m_Name: 
-      m_Url: 
-      m_Scopes: []
-      m_IsDefault: 0
-      m_Capabilities: 0
     m_Modified: 0
-    m_Name: 
-    m_Url: 
-    m_Scopes:
-    - 
-    m_SelectedScopeIndex: 0
+    m_ErrorMessage: 
+    m_UserModificationsInstanceId: -844
+    m_OriginalInstanceId: -846
+  m_LoadAssets: 0

+ 2 - 2
Unity/ProjectSettings/ProjectVersion.txt

@@ -1,2 +1,2 @@
-m_EditorVersion: 2021.3.3f1c1
-m_EditorVersionWithRevision: 2021.3.3f1c1 (d43514f36ab8)
+m_EditorVersion: 2021.3.6f1
+m_EditorVersionWithRevision: 2021.3.6f1 (7da38d85baf6)