@@ -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" } ;
33
+ private static string [ ] leapCoreAssetsVersionsSupported = new string [ ] { "4.5.0" , "4.5.1" , "4.6.0" , "4.7.0" , "4.7.1" } ;
34
34
35
35
// The current Leap Core Assets version in this project
36
36
private static string currentLeapCoreAssetsVersion = "" ;
@@ -214,6 +214,14 @@ private static void AddAndUpdateAsmDefs()
214
214
{
215
215
string leapCoreAsmDefPath = Path . Combine ( Application . dataPath , pathDifference , "LeapMotion" , "LeapMotion.asmdef" ) ;
216
216
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" ) ;
219
+
220
+ if ( leapMotionAsmDefFile . Length != 0 )
221
+ {
222
+ return ;
223
+ }
224
+
217
225
// If the asmdef has already been created then do not create another one
218
226
if ( ! File . Exists ( leapCoreAsmDefPath ) )
219
227
{
@@ -232,6 +240,11 @@ private static void AddAndUpdateAsmDefs()
232
240
if ( currentLeapCoreAssetsVersion == "4.5.1" )
233
241
{
234
242
leapAsmDef . AddReference ( "LeapMotion.LeapCSharp" ) ;
243
+
244
+ // If the unity modules version is 4.6.0 or 4.7.0 then add SpatialTracking as a reference
245
+ #if UNITY_2019_3_OR_NEWER
246
+ leapAsmDef . AddReference ( "UnityEngine.SpatialTracking" ) ;
247
+ #endif
235
248
}
236
249
237
250
leapAsmDef . Save ( leapCoreAsmDefPath ) ;
@@ -271,7 +284,7 @@ private static void AddLeapEditorAsmDefs()
271
284
} ;
272
285
273
286
// Add the LeapMotion.LeapCSharp assembly definition to the leap motion tests assembly definition
274
- if ( currentLeapCoreAssetsVersion == "4.5.1" && leapAsmDef . Key == "LeapMotion.Core.Tests.Editor" )
287
+ if ( currentLeapCoreAssetsVersion == "4.5.1" && ( leapAsmDef . Key == "LeapMotion.Core.Tests.Editor" || leapAsmDef . Key == "LeapMotion.Core.Editor" ) )
275
288
{
276
289
leapEditorAsmDef . AddReference ( "LeapMotion.LeapCSharp" ) ;
277
290
}
0 commit comments