File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Assets/MRTK/StandardAssets/EditorUtilities Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -53,20 +53,29 @@ private static bool AssetsContainsShaders()
5353 }
5454
5555 /// <summary>
56- /// Finds the shader folder within the package cache .
56+ /// Finds the shader folder within a in installed or embedded package .
5757 /// </summary>
5858 /// <returns>
5959 /// DirectoryInfo object representing the shader folder in the package cache.
6060 /// If not found, returns null.</returns>
6161 private static DirectoryInfo FindShaderFolderInPackage ( )
6262 {
63- DirectoryInfo di = new DirectoryInfo ( Path . GetFullPath ( Path . Combine ( "Library" , "PackageCache" ) ) ) ;
64- if ( ! di . Exists ) { return null ; }
63+ List < string > searchPaths = new List < string >
64+ {
65+ Path . GetFullPath ( Path . Combine ( "Library" , "PackageCache" ) ) ,
66+ Path . GetFullPath ( "Packages" )
67+ } ;
6568
66- FileInfo [ ] files = di . GetFiles ( ShaderSentinelFile , SearchOption . AllDirectories ) ;
67- if ( files . Length > 0 )
69+ foreach ( string path in searchPaths )
6870 {
69- return new DirectoryInfo ( files [ 0 ] . DirectoryName ) ;
71+ DirectoryInfo di = new DirectoryInfo ( path ) ;
72+ if ( ! di . Exists ) { continue ; }
73+
74+ FileInfo [ ] files = di . GetFiles ( ShaderSentinelFile , SearchOption . AllDirectories ) ;
75+ if ( files . Length > 0 )
76+ {
77+ return new DirectoryInfo ( files [ 0 ] . DirectoryName ) ;
78+ }
7079 }
7180
7281 return null ;
You can’t perform that action at this time.
0 commit comments