@@ -38,6 +38,9 @@ static class LeapMotionConfigurationChecker
38
38
// The path difference between the root of assets and the root of the Leap Motion Core Assets.
39
39
private static string pathDifference = "" ;
40
40
41
+ // The Leap Unity Modules version 4.7.1 already contains a LeapMotion.asmdef file at this path
42
+ private static string leapAsmdefPath_471 = "LeapMotion/Core/Scripts/LeapMotion.asmdef" ;
43
+
41
44
// Array of paths to Leap Motion testing directories that will be removed from the project.
42
45
// Make sure each test directory ends with '/'
43
46
// These paths only need to be deleted if the Leap Core Assets version is 4.4.0
@@ -214,11 +217,14 @@ private static void AddAndUpdateAsmDefs()
214
217
{
215
218
string leapCoreAsmDefPath = Path . Combine ( Application . dataPath , pathDifference , "LeapMotion" , "LeapMotion.asmdef" ) ;
216
219
217
- // If the Leap Unity Modules version is 4.7.1, then do not add the LeapMotion.asmdef because it already exists in the package
218
- FileInfo [ ] leapMotionAsmDefFile = FileUtilities . FindFilesInAssets ( "LeapMotion.asmdef" ) ;
220
+ // The Leap Unity Modules version is 4.7.1 already contains a LeapMotion.asmdef
221
+ string leap471Path = Path . Combine ( Application . dataPath , pathDifference , "Plugins" , leapAsmdefPath_471 ) ;
219
222
220
- if ( leapMotionAsmDefFile . Length != 0 )
223
+ // If the LeapMotion.asmdef is present, then the Leap Unity Modules version is 4.7.1 and the other
224
+ // LeapMotion.asmdef file does not need to be created.
225
+ if ( File . Exists ( leap471Path ) )
221
226
{
227
+ currentLeapCoreAssetsVersion = "4.7.1" ;
222
228
return ;
223
229
}
224
230
@@ -284,7 +290,7 @@ private static void AddLeapEditorAsmDefs()
284
290
} ;
285
291
286
292
// Add the LeapMotion.LeapCSharp assembly definition to the leap motion tests assembly definition
287
- if ( currentLeapCoreAssetsVersion == "4.5.1" && ( leapAsmDef . Key == "LeapMotion.Core.Tests.Editor" || leapAsmDef . Key == "LeapMotion.Core.Editor" ) )
293
+ if ( ( currentLeapCoreAssetsVersion == "4.5.1" || currentLeapCoreAssetsVersion == "4.7.1" ) && ( leapAsmDef . Key == "LeapMotion.Core.Tests.Editor" || leapAsmDef . Key == "LeapMotion.Core.Editor" ) )
288
294
{
289
295
leapEditorAsmDef . AddReference ( "LeapMotion.LeapCSharp" ) ;
290
296
}
0 commit comments