InputDataKS.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using UnityEngine;
  7. namespace SC.XR.Unity.Module_InputSystem.InputDeviceGC.KS {
  8. public class InputDataKS : InputDataGC {
  9. public InputDeviceKSPart inputDeviceKSPart;
  10. public InputDataKS(InputDeviceKSPart inputDeviceKSPart) : base(inputDeviceKSPart) {
  11. this.inputDeviceKSPart = inputDeviceKSPart;
  12. }
  13. public KSIndex ksIndex {
  14. get {
  15. if(inputDeviceKSPart.PartType == InputDevicePartType.KSLeft) {
  16. return KSIndex.Left;
  17. } else if(inputDeviceKSPart.PartType == InputDevicePartType.KSRight) {
  18. return KSIndex.Right;
  19. }
  20. return KSIndex.UnKnow;
  21. }
  22. }
  23. public override void OnSCDisable() {
  24. base.OnSCDisable();
  25. TempHallDataList.Clear();
  26. BatteryPowerEventDataList.Clear();
  27. KeyTouchDataList.Clear();
  28. TempJoystickDataList.Clear();
  29. ChargingEventDataList.Clear();
  30. StatusDataList.Clear();
  31. TouchPanelDataList.Clear();
  32. }
  33. public class HallData {
  34. public int deviceID;
  35. public int HallFoward;
  36. public int HallInside;
  37. }
  38. public static List<HallData> TempHallDataList = new List<HallData>();
  39. public class BatteryPowerData {
  40. public int deviceID;
  41. public int BatteryPower;
  42. }
  43. public static List<BatteryPowerData> BatteryPowerEventDataList = new List<BatteryPowerData>();
  44. public class KeyTouchData {
  45. public int deviceID;
  46. public int keycode;
  47. public bool touch;
  48. }
  49. public static List<KeyTouchData> KeyTouchDataList = new List<KeyTouchData>();
  50. public class JoystickData {
  51. public int deviceID;
  52. public int JoystickX;
  53. public int JoystickY;
  54. }
  55. public static List<JoystickData> TempJoystickDataList = new List<JoystickData>();
  56. public class ChargingEventData {
  57. public int deviceID;
  58. public bool isCharging;
  59. }
  60. public static List<ChargingEventData> ChargingEventDataList = new List<ChargingEventData>();
  61. public class StatusData {
  62. public int deviceID;
  63. public bool isConnected;
  64. }
  65. public static List<StatusData> StatusDataList = new List<StatusData>();
  66. public class TouchPanelData {
  67. public int deviceID;
  68. public float x;
  69. public float y;
  70. public int action;
  71. }
  72. public static List<TouchPanelData> TouchPanelDataList = new List<TouchPanelData>();
  73. }
  74. }