mixedreality/com.microsoft.mixedreality..../Providers/WindowsMixedReality/Shared/Editor/WindowsMixedRealityConfigur...

36 lines
1.3 KiB
C#
Raw 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;
using UnityEditor;
namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality
{
/// <summary>
/// Class to perform checks for configuration checks for the Windows Mixed Reality provider.
/// </summary>
static class WindowsMixedRealityConfigurationChecker
{
private const string FileName = "Microsoft.Windows.MixedReality.DotNetWinRT.dll";
private static readonly string[] definitions = { "DOTNETWINRT_PRESENT" };
/// <summary>
/// Ensures that the appropriate symbolic constant is defined based on the presence of the DotNetWinRT binary.
/// </summary>
[MenuItem("Mixed Reality/Toolkit/Utilities/Windows Mixed Reality/Check Configuration")]
private static void ReconcileDotNetWinRTDefine()
{
FileInfo[] files = FileUtilities.FindFilesInAssets(FileName);
if (files.Length > 0)
{
ScriptUtilities.AppendScriptingDefinitions(BuildTargetGroup.WSA, definitions);
}
else
{
ScriptUtilities.RemoveScriptingDefinitions(BuildTargetGroup.WSA, definitions);
}
}
}
}