AVRControllerButtons.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using UnityEngine;
  3. public abstract class AVRControllerButtons : MonoBehaviour
  4. {
  5. protected virtual void Awake()
  6. {
  7. if (base.gameObject.name.ToLower().Contains("left"))
  8. {
  9. this.m_bHandL = true;
  10. }
  11. else if (base.gameObject.name.ToLower().Contains("right"))
  12. {
  13. this.m_bHandL = false;
  14. }
  15. }
  16. public AVRControllerButtons.TYPE Type
  17. {
  18. get
  19. {
  20. return this.m_eType;
  21. }
  22. }
  23. public virtual bool HandSide
  24. {
  25. get
  26. {
  27. return this.m_bHandL;
  28. }
  29. set
  30. {
  31. this.m_bHandL = value;
  32. }
  33. }
  34. public abstract bool ShowHand { get; set; }
  35. public abstract void Haptic(byte f_byFoce, float f_fTime);
  36. public abstract bool GetPressDown(AVRControllerButtons.BTN f_eBtn);
  37. public abstract bool GetPress(AVRControllerButtons.BTN f_eBtn);
  38. public abstract bool GetPressUp(AVRControllerButtons.BTN f_eBtn);
  39. public abstract bool GetTouchDown(AVRControllerButtons.TOUCH f_eTouch);
  40. public abstract bool GetTouch(AVRControllerButtons.TOUCH f_eTouch);
  41. public abstract bool GetTouchUp(AVRControllerButtons.TOUCH f_eTouch);
  42. public abstract Vector2 GetAxis();
  43. public abstract float GetTriggerRate();
  44. protected bool m_bHandL = true;
  45. protected AVRControllerButtons.TYPE m_eType = AVRControllerButtons.TYPE.TOUCH;
  46. public enum BTN
  47. {
  48. VIRTUAL_MENU,
  49. VIRTUAL_L_CLICK,
  50. VIRTUAL_R_CLICK,
  51. VIRTUAL_GRUB,
  52. MENU,
  53. TRIGGER,
  54. STICK_PAD,
  55. GRIP,
  56. MAX
  57. }
  58. public enum TOUCH
  59. {
  60. TRIGGER,
  61. STICK_PAD,
  62. REST,
  63. YB,
  64. XA,
  65. MAX
  66. }
  67. public enum TYPE
  68. {
  69. NON_DUMMY,
  70. TOUCH,
  71. VIVE
  72. }
  73. }