mixedreality/com.microsoft.mixedreality..../Providers/LeapMotion/Editor/LeapMotionUtilities.cs

37 lines
1.2 KiB
C#
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities.Editor;
using System.IO;
namespace Microsoft.MixedReality.Toolkit.LeapMotion.Utilities
{
/// <summary>
/// Leap Motion Utilities for determining if the Leap Motion Core Assets are in the project.
/// </summary>
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";
/// <summary>
/// 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.
/// </summary>
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;
}
}
}