File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Packages/Sequence-Unity/Sequence/SequenceSDK/Config Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,15 @@ public static string GetVersion()
1919 return ExtractVersionFromJson ( json ) ;
2020 }
2121
22+
2223 private static string FindPackageJsonPath ( )
2324 {
24- string packagesPath = "Packages/Sequence-Unity/package.json" ;
25- if ( File . Exists ( packagesPath ) )
25+ if ( CheckDirectories ( new [ ] {
26+ "Packages/Sequence-Unity/package.json" ,
27+ "Packages/xyz.0xsequence.waas-unity/package.json"
28+ } , out var availableFile ) )
2629 {
27- return packagesPath ;
30+ return availableFile ;
2831 }
2932
3033 string [ ] directories = Directory . GetDirectories ( "Library/PackageCache/" , "xyz.0xsequence.waas-unity*" , SearchOption . TopDirectoryOnly ) ;
@@ -42,6 +45,21 @@ private static string FindPackageJsonPath()
4245 return null ;
4346 }
4447
48+ private static bool CheckDirectories ( string [ ] files , out string availableFile )
49+ {
50+ foreach ( var file in files )
51+ {
52+ if ( File . Exists ( file ) )
53+ {
54+ availableFile = file ;
55+ return true ;
56+ }
57+ }
58+
59+ availableFile = null ;
60+ return false ;
61+ }
62+
4563 private static string ExtractVersionFromJson ( string json )
4664 {
4765 var jsonObj = JsonUtility . FromJson < PackageJson > ( json ) ;
You can’t perform that action at this time.
0 commit comments