Skip to content

Commit d83b49b

Browse files
committed
Update conditions after testing 2018 support
1 parent b450edb commit d83b49b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Assets/MRTK/Providers/LeapMotion/Editor/LeapMotionConfigurationChecker.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ static class LeapMotionConfigurationChecker
3838
// The path difference between the root of assets and the root of the Leap Motion Core Assets.
3939
private static string pathDifference = "";
4040

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+
4144
// Array of paths to Leap Motion testing directories that will be removed from the project.
4245
// Make sure each test directory ends with '/'
4346
// 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()
214217
{
215218
string leapCoreAsmDefPath = Path.Combine(Application.dataPath, pathDifference, "LeapMotion", "LeapMotion.asmdef");
216219

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);
219222

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))
221226
{
227+
currentLeapCoreAssetsVersion = "4.7.1";
222228
return;
223229
}
224230

@@ -284,7 +290,7 @@ private static void AddLeapEditorAsmDefs()
284290
};
285291

286292
// 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"))
288294
{
289295
leapEditorAsmDef.AddReference("LeapMotion.LeapCSharp");
290296
}

0 commit comments

Comments
 (0)