Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.9 KiB

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License. See LICENSE in the project root for license information.
  3. //
  4. // ###
  5. // # Kindly borrowed and extended from Microsoft MRTK (https://github.com/Microsoft/MixedRealityToolkit-Unity) to work with VRTK.
  6. // ###
  7. namespace VRTK.WindowsMixedReality.Utilities
  8. {
  9. /// <summary>
  10. /// Helper class for determining if a Windows API contract is available.
  11. /// <remarks> See https://docs.microsoft.com/en-us/uwp/extension-sdks/windows-universal-sdk
  12. /// for a full list of contracts.</remarks>
  13. /// </summary>
  14. public static class WindowsApiChecker
  15. {
  16. static WindowsApiChecker()
  17. {
  18. #if !UNITY_EDITOR && UNITY_WSA
  19. UniversalApiContractV5_IsAvailable = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5);
  20. UniversalApiContractV4_IsAvailable = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 4);
  21. UniversalApiContractV3_IsAvailable = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3);
  22. #else
  23. UniversalApiContractV5_IsAvailable = false;
  24. UniversalApiContractV4_IsAvailable = false;
  25. UniversalApiContractV3_IsAvailable = false;
  26. #endif
  27. }
  28. /// <summary>
  29. /// Is the Universal API Contract v5.0 Available?
  30. /// </summary>
  31. public static bool UniversalApiContractV5_IsAvailable { get; private set; }
  32. /// <summary>
  33. /// Is the Universal API Contract v4.0 Available?
  34. /// </summary>
  35. public static bool UniversalApiContractV4_IsAvailable { get; private set; }
  36. /// <summary>
  37. /// Is the Universal API Contract v3.0 Available?
  38. /// </summary>
  39. public static bool UniversalApiContractV3_IsAvailable { get; private set; }
  40. }
  41. }