From 66adda973d0760adff051fe2e4ae51e129d45091 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 20 Sep 2021 12:09:52 -0700 Subject: [PATCH 1/3] Use OpenFileAtLineExternal instead of directly invoking script editor process... --- .../Editor/Data/Util/GraphUtil.cs | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs index f578776d809..4eb6c448b93 100644 --- a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs @@ -362,26 +362,6 @@ public static bool WriteToFile(string path, string content) } } - static ProcessStartInfo CreateProcessStartInfo(string filePath) - { - string externalScriptEditor = ScriptEditorUtility.GetExternalScriptEditor(); - - ProcessStartInfo psi = new ProcessStartInfo(); - psi.UseShellExecute = false; - - -#if UNITY_EDITOR_OSX - string arg = string.Format("-a \"{0}\" -n --args \"{1}\"", externalScriptEditor, Path.GetFullPath(filePath)); - psi.FileName = "open"; - psi.Arguments = arg; -#else - psi.Arguments = Path.GetFileName(filePath); - psi.WorkingDirectory = Path.GetDirectoryName(filePath); - psi.FileName = externalScriptEditor; -#endif - return psi; - } - public static void OpenFile(string path) { string filePath = Path.GetFullPath(path); @@ -394,8 +374,7 @@ public static void OpenFile(string path) string externalScriptEditor = ScriptEditorUtility.GetExternalScriptEditor(); if (externalScriptEditor != "internal") { - ProcessStartInfo psi = CreateProcessStartInfo(filePath); - Process.Start(psi); + InternalEditorUtility.OpenFileAtLineExternal(filePath, 0, 0); } else { From 9dadf1d38403b7700e9bd70df9a799853541758e Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 20 Sep 2021 12:12:24 -0700 Subject: [PATCH 2/3] Adding changelog --- com.unity.shadergraph/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index f4fb41209e2..aad3131014e 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -20,6 +20,7 @@ The version number for this package has increased due to a version update of a r - Fixed noise nodes to use a deterministic integer hash, instead of platform dependent floating point hashes [1156544] - Fixed the appearance (wrong text color, and not wrapped) of a warning in Node Settings [1356725] (https://issuetracker.unity3d.com/product/unity/issues/guid/1356725/) - Fixed the ordering of inputs on a SubGraph node to match the properties on the blackboard of the subgraph itself [1354463] + - Fixed an issue where ShaderGraph "view shader" commands were opening in individual windows, and blocking Unity from closing [1367188] ## [12.0.0] - 2021-01-11 From c27514e79c174c84ffa5a22e635320ba21a2a156 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Mon, 20 Sep 2021 12:54:46 -0700 Subject: [PATCH 3/3] Update call to go through CodeEditors --- com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs index 4eb6c448b93..624604286a0 100644 --- a/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs +++ b/com.unity.shadergraph/Editor/Data/Util/GraphUtil.cs @@ -374,7 +374,7 @@ public static void OpenFile(string path) string externalScriptEditor = ScriptEditorUtility.GetExternalScriptEditor(); if (externalScriptEditor != "internal") { - InternalEditorUtility.OpenFileAtLineExternal(filePath, 0, 0); + InternalEditorUtility.OpenFileAtLineExternal(filePath, 0); } else {