BaseInput2.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.EventSystems;
  4. public class BaseInput2 : BaseInput
  5. {
  6. public override bool GetMouseButtonDown(int button)
  7. {
  8. return NInput.GetMouseButtonDown(button);
  9. }
  10. public override bool GetMouseButtonUp(int button)
  11. {
  12. return NInput.GetMouseButtonUp(button);
  13. }
  14. public override bool GetMouseButton(int button)
  15. {
  16. return NInput.GetMouseButton(button);
  17. }
  18. public override Vector2 mousePosition
  19. {
  20. get
  21. {
  22. if (GameMain.Instance != null && GameMain.Instance.OvrMgr != null && GameMain.Instance.OvrMgr.SystemUICamera)
  23. {
  24. return GameMain.Instance.OvrMgr.SystemUICamera.GetOvrVirtualMouseCurrentSidePos();
  25. }
  26. return Input.mousePosition;
  27. }
  28. }
  29. public override Vector2 mouseScrollDelta
  30. {
  31. get
  32. {
  33. return new Vector2(0f, NInput.GetAxis("Mouse ScrollWheel") * 10f);
  34. }
  35. }
  36. public override bool touchSupported
  37. {
  38. get
  39. {
  40. return false;
  41. }
  42. }
  43. public override int touchCount
  44. {
  45. get
  46. {
  47. return 0;
  48. }
  49. }
  50. public override float GetAxisRaw(string axisName)
  51. {
  52. if (axisName == "Vertical" || axisName == "Horizontal")
  53. {
  54. return 0f;
  55. }
  56. return NInput.GetAxis(axisName);
  57. }
  58. }