NxrDeviceImpl.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using UnityEngine;
  2. namespace Nxr.Internal
  3. {
  4. public class NxrDeviceImpl : MonoBehaviour
  5. {
  6. private static readonly NxrDeviceImpl _instance = null;
  7. static NxrDeviceImpl()
  8. {
  9. _instance = new NxrDeviceImpl();
  10. }
  11. private NxrDeviceImpl()
  12. {
  13. }
  14. public static NxrDeviceImpl Instance
  15. {
  16. get { return _instance; }
  17. }
  18. Camera GetMainCamera()
  19. {
  20. return NxrViewer.Instance.GetMainCamera();
  21. }
  22. Camera GetLeftEyeCamera()
  23. {
  24. return NxrViewer.Instance.GetLeftEyeCamera();
  25. }
  26. Camera GetRightEyeCamera()
  27. {
  28. return NxrViewer.Instance.GetRightEyeCamera();
  29. }
  30. int GetVolume()
  31. {
  32. return NxrViewer.Instance.GetNibiruService().GetVolumeValue();
  33. }
  34. bool SetVolumeNum(int volume)
  35. {
  36. return true;
  37. }
  38. void ResetController()
  39. {
  40. NxrViewer.Instance.Recenter();
  41. }
  42. bool IsCameraLocked()
  43. {
  44. return NxrViewer.Instance.IsCameraLocked();
  45. }
  46. void SetControllerActive(bool isActive)
  47. {
  48. NxrViewer.Instance.SetControllerActive(isActive);
  49. }
  50. bool IsControllerConnect()
  51. {
  52. return NxrViewer.Instance.IsControllerConnect();
  53. }
  54. void LockCamera(bool isLock)
  55. {
  56. NxrViewer.Instance.LockCamera(isLock);
  57. }
  58. Quaternion GetCameraQuaternion()
  59. {
  60. return NxrViewer.Instance.GetCameraQuaternion();
  61. }
  62. Quaternion GetControllerQuaternion()
  63. {
  64. return NxrViewer.Instance.GetControllerQuaternion();
  65. }
  66. Transform GetRayStartPoint()
  67. {
  68. return NxrViewer.Instance.GetRayStartPoint();
  69. }
  70. Transform GetRayEndPoint()
  71. {
  72. return NxrViewer.Instance.GetRayEndPoint();
  73. }
  74. }
  75. }