Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Improve the Create Script default write location
Browse files Browse the repository at this point in the history
Minor UX fix so that clicking Create Script opens the file explorer to the same folder as the behaviour asset file.
  • Loading branch information
FairlySadPanda authored Aug 13, 2021
1 parent 8bb3fb1 commit f5daf77
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Assets/UdonSharp/Editor/Editors/UdonSharpGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit f5daf77

Please sign in to comment.