File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Editor/Editors/Inspectors Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . IO ;
23using UnityEditor ;
34using UnityEngine ;
45using UnityEngine . UIElements ;
@@ -57,10 +58,20 @@ public override VisualElement CreateInspectorGUI()
5758 return ;
5859 }
5960
60- string path = EditorUtility . OpenFolderPanel ( "Select folder" , "Assets" , "" ) ;
61- if ( path . Length == 0 )
62- return ;
61+ string path = "" ;
62+ if ( _shader . LastGeneratedShaders != null && _shader . LastGeneratedShaders . Count > 0 && _shader . LastGeneratedShaders [ 0 ] != null )
63+ {
64+ path = Path . GetDirectoryName ( AssetDatabase . GetAssetPath ( _shader . LastGeneratedShaders [ 0 ] ) ) ;
65+ }
6366
67+ if ( string . IsNullOrWhiteSpace ( path ) )
68+ {
69+
70+ path = EditorUtility . OpenFolderPanel ( "Select folder" , "Assets" , "" ) ;
71+ if ( string . IsNullOrWhiteSpace ( path ) )
72+ return ;
73+
74+ }
6475 string localPath = Environment . CurrentDirectory ;
6576 localPath = localPath . Replace ( '\\ ' , '/' ) ;
6677 path = path . Replace ( localPath + "/" , "" ) ;
You can’t perform that action at this time.
0 commit comments