XRSettings.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Small shim for VRSettings/XRSettings on XboxOne, Switch and PS Vita
  2. #if ((UNITY_XBOXONE || UNITY_SWITCH || UNITY_PSP2) && !UNITY_2018_3_OR_NEWER) && !UNITY_EDITOR
  3. using System;
  4. #if UNITY_2017_2_OR_NEWER
  5. namespace UnityEngine.XR
  6. #else
  7. namespace UnityEngine.VR
  8. #endif
  9. {
  10. #if UNITY_2017_2_OR_NEWER
  11. public static class XRSettings
  12. #elif UNITY_5_6_OR_NEWER
  13. public static class VRSettings
  14. #endif
  15. {
  16. public static bool enabled { get; set; }
  17. public static bool isDeviceActive { get; private set; }
  18. public static bool showDeviceView { get; set; }
  19. [Obsolete("renderScale is deprecated, use XRSettings.eyeTextureResolutionScale instead (UnityUpgradable) -> eyeTextureResolutionScale")]
  20. public static float renderScale { get; set; }
  21. public static float eyeTextureResolutionScale { get; set; }
  22. public static int eyeTextureWidth { get; private set; }
  23. public static int eyeTextureHeight { get; private set; }
  24. public static RenderTextureDescriptor eyeTextureDesc { get; private set; }
  25. public static float renderViewportScale { get; set; }
  26. public static float occlusionMaskScale { get; set; }
  27. public static bool useOcclusionMesh { get; set; }
  28. public static string loadedDeviceName { get; private set; }
  29. public static string[] supportedDevices { get; private set; }
  30. public static void LoadDeviceByName(string deviceName) { }
  31. public static void LoadDeviceByName(string[] prioritizedDeviceNameList) { }
  32. }
  33. }
  34. #endif