// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities.Editor;
using System.IO;
namespace Microsoft.MixedReality.Toolkit.LeapMotion.Utilities
{
///
/// Leap Motion Utilities for determining if the Leap Motion Core Assets are in the project.
///
static class LeapMotionUtilities
{
// The presence of the LeapXRServiceProvider.cs is used to determine if the Leap Motion Core Assets are in the project.
private const string trackedLeapFileName = "LeapXRServiceProvider.cs";
///
/// If true, the LeapXRServiceProvider.cs file is in the project. The presence of this file is used to determine if the
/// Leap Motion Core Assets are in the project.
///
public static bool IsLeapInProject => LeapMotionFileDetected();
// Check if the LeapXRServiceProvider.cs file is in the project.
private static bool LeapMotionFileDetected()
{
FileInfo[] files = FileUtilities.FindFilesInAssets(trackedLeapFileName);
if (files.Length > 0)
{
return true;
}
return false;
}
}
}