@@ -30,7 +30,7 @@ static class LeapMotionConfigurationChecker
30
30
private static bool isLeapRecognizedByMRTK = false ;
31
31
32
32
// The current supported Leap Core Assets version numbers.
33
- private static string [ ] leapCoreAssetsVersionsSupported = new string [ ] { "4.5.0" , "4.5.1" , "4.6.0" , "4.7.0" , "4.7.1" , "4.8.0" } ;
33
+ private static string [ ] leapCoreAssetsVersionsSupported = new string [ ] { "4.5.0" , "4.5.1" , "4.6.0" , "4.7.0" , "4.7.1" , "4.8.0" , "4.9.1" } ;
34
34
35
35
// The current Leap Core Assets version in this project
36
36
private static string currentLeapCoreAssetsVersion = "" ;
@@ -179,30 +179,32 @@ private static bool LeapCoreAssetsVersionSupport()
179
179
180
180
// The Leap Motion Unity modules Version.txt has remained 4.5.1 across versions 4.6.0, 4.7.0, 4.7.1, and 4.8.0 check for the presence
181
181
// of certain paths to infer the version number.
182
-
183
- // This path is only present in 4.7.1
184
- string leap471Path = Path . Combine ( Application . dataPath , pathDifference , leapAsmDefPath_471 ) ;
185
-
186
- // This path is present in versions 4.7.0 and 4.7.1
187
- string testDirectoryPath = Path . Combine ( Application . dataPath , pathDifference , leapTestsPath_470 ) ;
188
-
189
- // This path is present in 4.6.0 and not 4.5.1
190
- string xrPath = Path . Combine ( Application . dataPath , pathDifference , leapXRPath_460 ) ;
191
-
192
- if ( File . Exists ( leap471Path ) )
193
- {
194
- // The Leap Motion Unity modules Core package version 4.7.1 is identical to the version 4.8.0
195
- // Core package. Due to the lack of differences between the two versions, the modules will be marked as 4.7.1 even
196
- // if they are version 4.8.0.
197
- currentLeapCoreAssetsVersion = "4.7.1" ;
198
- }
199
- else if ( ! File . Exists ( leap471Path ) && Directory . Exists ( testDirectoryPath ) )
200
- {
201
- currentLeapCoreAssetsVersion = "4.7.0" ;
202
- }
203
- else if ( ! File . Exists ( leap471Path ) && ! Directory . Exists ( testDirectoryPath ) && File . Exists ( xrPath ) )
182
+ if ( currentLeapCoreAssetsVersion == "4.5.1" )
204
183
{
205
- currentLeapCoreAssetsVersion = "4.6.0" ;
184
+ // This path is only present in 4.7.1
185
+ string leap471Path = Path . Combine ( Application . dataPath , pathDifference , leapAsmDefPath_471 ) ;
186
+
187
+ // This path is present in versions 4.7.0 and 4.7.1
188
+ string testDirectoryPath = Path . Combine ( Application . dataPath , pathDifference , leapTestsPath_470 ) ;
189
+
190
+ // This path is present in 4.6.0 and not 4.5.1
191
+ string xrPath = Path . Combine ( Application . dataPath , pathDifference , leapXRPath_460 ) ;
192
+
193
+ if ( File . Exists ( leap471Path ) )
194
+ {
195
+ // The Leap Motion Unity modules Core package version 4.7.1 is identical to the version 4.8.0
196
+ // Core package. Due to the lack of differences between the two versions, the modules will be marked as 4.7.1 even
197
+ // if they are version 4.8.0.
198
+ currentLeapCoreAssetsVersion = "4.7.1" ;
199
+ }
200
+ else if ( ! File . Exists ( leap471Path ) && Directory . Exists ( testDirectoryPath ) )
201
+ {
202
+ currentLeapCoreAssetsVersion = "4.7.0" ;
203
+ }
204
+ else if ( ! File . Exists ( leap471Path ) && ! Directory . Exists ( testDirectoryPath ) && File . Exists ( xrPath ) )
205
+ {
206
+ currentLeapCoreAssetsVersion = "4.6.0" ;
207
+ }
206
208
}
207
209
208
210
return true ;
@@ -262,7 +264,7 @@ private static void AddAndUpdateAsmDefs()
262
264
string leapCoreAsmDefPath = Path . Combine ( Application . dataPath , pathDifference , "LeapMotion" , "LeapMotion.asmdef" ) ;
263
265
264
266
// If the Leap Unity Modules version is 4.7.1, the LeapMotion.asmdef file does not need to be created
265
- if ( currentLeapCoreAssetsVersion == "4.7.1" )
267
+ if ( currentLeapCoreAssetsVersion == "4.7.1" || currentLeapCoreAssetsVersion == "4.9.1" )
266
268
{
267
269
return ;
268
270
}
@@ -329,7 +331,7 @@ private static void AddLeapEditorAsmDefs()
329
331
} ;
330
332
331
333
// Add the LeapMotion.LeapCSharp assembly definition to the leap motion tests assembly definition
332
- if ( ( currentLeapCoreAssetsVersion == "4.5.1" || currentLeapCoreAssetsVersion == "4.6.0" || currentLeapCoreAssetsVersion == "4.7.0" || currentLeapCoreAssetsVersion == "4.7.1" ) && ( leapAsmDef . Key == "LeapMotion.Core.Tests.Editor" || leapAsmDef . Key == "LeapMotion.Core.Editor" ) )
334
+ if ( ( currentLeapCoreAssetsVersion == "4.5.1" || currentLeapCoreAssetsVersion == "4.6.0" || currentLeapCoreAssetsVersion == "4.7.0" || currentLeapCoreAssetsVersion == "4.7.1" || currentLeapCoreAssetsVersion == "4.9.1" ) && ( leapAsmDef . Key == "LeapMotion.Core.Tests.Editor" || leapAsmDef . Key == "LeapMotion.Core.Editor" ) )
333
335
{
334
336
leapEditorAsmDef . AddReference ( "LeapMotion.LeapCSharp" ) ;
335
337
}
0 commit comments