@@ -30,7 +30,7 @@ static class LeapMotionConfigurationChecker
3030 private static bool isLeapRecognizedByMRTK = false ;
3131
3232 // 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" } ;
3434
3535 // The current Leap Core Assets version in this project
3636 private static string currentLeapCoreAssetsVersion = "" ;
@@ -214,6 +214,14 @@ private static void AddAndUpdateAsmDefs()
214214 {
215215 string leapCoreAsmDefPath = Path . Combine ( Application . dataPath , pathDifference , "LeapMotion" , "LeapMotion.asmdef" ) ;
216216
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+
217225 // If the asmdef has already been created then do not create another one
218226 if ( ! File . Exists ( leapCoreAsmDefPath ) )
219227 {
@@ -232,6 +240,11 @@ private static void AddAndUpdateAsmDefs()
232240 if ( currentLeapCoreAssetsVersion == "4.5.1" )
233241 {
234242 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
235248 }
236249
237250 leapAsmDef . Save ( leapCoreAsmDefPath ) ;
@@ -271,7 +284,7 @@ private static void AddLeapEditorAsmDefs()
271284 } ;
272285
273286 // 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" ) )
275288 {
276289 leapEditorAsmDef . AddReference ( "LeapMotion.LeapCSharp" ) ;
277290 }
0 commit comments