From f5daf779012e2795f9f4c6a21c98dae9f76b8074 Mon Sep 17 00:00:00 2001 From: Hannah Giovanna Dawson Date: Fri, 13 Aug 2021 22:35:01 +0100 Subject: [PATCH] Improve the Create Script default write location Minor UX fix so that clicking Create Script opens the file explorer to the same folder as the behaviour asset file. --- Assets/UdonSharp/Editor/Editors/UdonSharpGUI.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Assets/UdonSharp/Editor/Editors/UdonSharpGUI.cs b/Assets/UdonSharp/Editor/Editors/UdonSharpGUI.cs index b7dc28a9..dd441b06 100644 --- a/Assets/UdonSharp/Editor/Editors/UdonSharpGUI.cs +++ b/Assets/UdonSharp/Editor/Editors/UdonSharpGUI.cs @@ -440,10 +440,8 @@ internal static bool DrawCreateScriptButton(UdonSharpProgramAsset programAsset) if (GUILayout.Button("Create Script")) { string thisPath = AssetDatabase.GetAssetPath(programAsset); - //string initialPath = Path.GetDirectoryName(thisPath); string fileName = Path.GetFileNameWithoutExtension(thisPath).Replace(" Udon C# Program Asset", "").Replace(" ", "").Replace("#", "Sharp"); - - string chosenFilePath = EditorUtility.SaveFilePanelInProject("Save UdonSharp File", fileName, "cs", "Save UdonSharp file"); + string chosenFilePath = EditorUtility.SaveFilePanelInProject("Save UdonSharp File", fileName, "cs", "Save UdonSharp file", Path.GetDirectoryName(thisPath)); if (chosenFilePath.Length > 0) {