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.

27 lines
1.1 KiB

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