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.

26 lines
1.0 KiB

6 years ago
6 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace IPA.Utilities
  7. {
  8. public static class SteamCheck
  9. {
  10. public static Type SteamVRCamera;
  11. public static Type SteamVRExternalCamera;
  12. public static Type SteamVRFade;
  13. public static bool IsAvailable => FindSteamVRAsset();
  14. private static bool FindSteamVRAsset()
  15. {
  16. // these require assembly qualified names....
  17. SteamVRCamera = Type.GetType("SteamVR_Camera, Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", false);
  18. SteamVRExternalCamera = Type.GetType("SteamVR_ExternalCamera, Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", false);
  19. SteamVRFade = Type.GetType("SteamVR_Fade, Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", false);
  20. return SteamVRCamera != null && SteamVRExternalCamera != null && SteamVRFade != null;
  21. }
  22. }
  23. }