Skip to content

Commit f5daf77

Browse files
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.
1 parent 8bb3fb1 commit f5daf77

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Assets/UdonSharp/Editor/Editors/UdonSharpGUI.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,8 @@ internal static bool DrawCreateScriptButton(UdonSharpProgramAsset programAsset)
440440
if (GUILayout.Button("Create Script"))
441441
{
442442
string thisPath = AssetDatabase.GetAssetPath(programAsset);
443-
//string initialPath = Path.GetDirectoryName(thisPath);
444443
string fileName = Path.GetFileNameWithoutExtension(thisPath).Replace(" Udon C# Program Asset", "").Replace(" ", "").Replace("#", "Sharp");
445-
446-
string chosenFilePath = EditorUtility.SaveFilePanelInProject("Save UdonSharp File", fileName, "cs", "Save UdonSharp file");
444+
string chosenFilePath = EditorUtility.SaveFilePanelInProject("Save UdonSharp File", fileName, "cs", "Save UdonSharp file", Path.GetDirectoryName(thisPath));
447445

448446
if (chosenFilePath.Length > 0)
449447
{

0 commit comments

Comments
 (0)