SDKConfiguration.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. using SC.XR.Unity;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. using SC.XR.Unity.Module_InputSystem;
  7. using SC.XR.Unity.Module_InputSystem.InputDeviceHand;
  8. using SC.XR.Unity.Module_InputSystem.InputDeviceGC;
  9. namespace SC.XR.Unity
  10. {
  11. [Serializable]
  12. public class ActivateDeviceSettings
  13. {
  14. [SerializeField, Tooltip("Headset Input")]
  15. public bool Head = true;
  16. [SerializeField, Tooltip("Hand Tracking Input")]
  17. public bool GGT26Dof = true;
  18. [SerializeField, Tooltip("Bluetooth Gamepad Input")]
  19. public bool BT3Dof = true;
  20. [SerializeField, Tooltip("KS Game Controller Input")]
  21. public bool KS = true;
  22. }
  23. [Serializable]
  24. public class KeyAliasSettings
  25. {
  26. [SerializeField]
  27. public InputKeyCode K11_Left_Enter = InputKeyCode.LTrigger;
  28. [SerializeField]
  29. public InputKeyCode K11_Right_Enter = InputKeyCode.RTrigger;
  30. [SerializeField]
  31. public InputKeyCode K11_Left_Calibration = InputKeyCode.DOWN;
  32. [SerializeField]
  33. public InputKeyCode K11_Right_Calibration = InputKeyCode.A;
  34. [SerializeField]
  35. public InputKeyCode K11_Left_AnotherEnter = InputKeyCode.UP;
  36. [SerializeField]
  37. public InputKeyCode K11_Right_AnotherEnter = InputKeyCode.Y;
  38. [Space(5)]
  39. [SerializeField]
  40. public InputKeyCode K101_Left_Enter = InputKeyCode.LHallForward;
  41. [SerializeField]
  42. public InputKeyCode K101_Right_Enter = InputKeyCode.RHallForward;
  43. [SerializeField]
  44. public InputKeyCode K101_Left_Calibration = InputKeyCode.LFunction;
  45. [SerializeField]
  46. public InputKeyCode K101_Right_Calibration = InputKeyCode.RFunction;
  47. [Space(5)]
  48. [SerializeField]
  49. public InputKeyCode K102_Left_Enter = InputKeyCode.LHallForward;
  50. [SerializeField]
  51. public InputKeyCode K102_Right_Enter = InputKeyCode.RHallForward;
  52. [SerializeField]
  53. public InputKeyCode K102_Left_Calibration = InputKeyCode.LFunction;
  54. [SerializeField]
  55. public InputKeyCode K102_Right_Calibration = InputKeyCode.RFunction;
  56. }
  57. [Serializable]
  58. public class HandInputSettings
  59. {
  60. [SerializeField, Tooltip("Offset of hand model")]
  61. public Vector3 GreyHandOffset = Vector3.zero;
  62. [SerializeField, Tooltip("Whether to use GGT26DofHandDataLerp")]
  63. public bool HandDataLerp = true;
  64. [SerializeField, Tooltip("Whether to enable color effect on GGT26Dof hand model")]
  65. public bool HandEffectColor;
  66. [SerializeField, Tooltip("Whether to show hand lowpower notice")]
  67. public bool ShowHandLowPower = false;
  68. [SerializeField, Tooltip("Whether to show hand cursor")]
  69. public bool ShowHandCursor = true;
  70. [SerializeField, Tooltip("Whether to show hand line")]
  71. public bool ShowHandLine;
  72. [SerializeField, Tooltip("Whether to show hand line out of camera range")]
  73. public bool OutCameraShowHandLine;
  74. [SerializeField, Tooltip("Whether to show hand render")]
  75. public bool ShowHandRender = true;
  76. [SerializeField]
  77. public float HandRenderEmissionIntensity = 0.2f;
  78. [SerializeField]
  79. public HandModelType HandModelType = HandModelType.EffectHand;
  80. [SerializeField]
  81. public Color HandMainColor = new Color(0.5f, 0.5f, 0.5f, 1);
  82. [SerializeField]
  83. public Vector3 FarPointerRotationOffset = new Vector3(-10, 0, 0);
  84. [SerializeField]
  85. public bool EnableHandFarInteraction = true;
  86. [SerializeField]
  87. public bool EnableHandTouchInteraction = true;
  88. [SerializeField]
  89. public bool EnableHandGrabInteraction = true;
  90. }
  91. [Serializable]
  92. public class InputSettings
  93. {
  94. public ActivateDeviceSettings ActivateDevice = new ActivateDeviceSettings();
  95. public KeyAliasSettings KeyAliasSettings = new KeyAliasSettings();
  96. public HandInputSettings HandInputSettings = new HandInputSettings();
  97. [SerializeField, Tooltip("Set 3Dof Mode when using KS")]
  98. public bool KSModeSet3Dof;
  99. [SerializeField, Tooltip("Use K102 Model instead of K101")]
  100. public bool UseK102Model = true;
  101. [SerializeField, Tooltip("Offset of K102 pointer angle")]
  102. public Vector3 K102PointerAngleOffset = new Vector3(43, 0, 0);
  103. [SerializeField, Tooltip("Whether GC has priority over GGT26Dof")]
  104. public bool IsGCPriorityGGT26Dof = true;
  105. [SerializeField, Tooltip("Whether to use hand animation for K102 model")]
  106. public bool EnableK102HandAnimation = true;
  107. [SerializeField, Tooltip("Show KS Logs")]
  108. public bool KS_ShowLog;
  109. [SerializeField, Tooltip("Show DebugMy Logs")]
  110. public bool ShowDebugLog;
  111. }
  112. [Serializable]
  113. public class SlamSettings
  114. {
  115. [SerializeField, Tooltip("Whether to use optics calibration (only works for devices that support this function)")]
  116. public bool UseOpticsCalibration = true;
  117. [SerializeField]
  118. public float trackPositionScale = 1f;
  119. [SerializeField, Tooltip("Whether to use 3Dof mode for SLAM")]
  120. public bool SlamUse3Dof;
  121. [SerializeField, Tooltip("Offset postion of left shoudler")]
  122. public Vector3 LeftShoulder = new Vector3(-0.15f, -0.13f, 0);
  123. [SerializeField]
  124. public bool CreateDepthRT;
  125. [SerializeField]
  126. public bool UseSingleView = true;
  127. }
  128. [Serializable]
  129. public class ActivateDetectorSettings
  130. {
  131. [SerializeField, Tooltip("Battery Detector")]
  132. public bool Battery = true;
  133. [SerializeField, Tooltip("Language Detector")]
  134. public bool Language = true;
  135. [SerializeField, Tooltip("NoNetwork Detector")]
  136. public bool NoNetwork = true;
  137. [SerializeField, Tooltip("Notice Detector")]
  138. public bool Notice = true;
  139. [SerializeField, Tooltip("Recorder Detector")]
  140. public bool Recorder = true;
  141. [SerializeField, Tooltip("Volume Detector")]
  142. public bool Volume = true;
  143. }
  144. [Serializable]
  145. public class DetectorSettings
  146. {
  147. public ActivateDetectorSettings ActivateDetector = new ActivateDetectorSettings();
  148. }
  149. [Serializable]
  150. public class QuitAppSettings
  151. {
  152. [SerializeField, Tooltip("Use a list of keycode to quit app")]
  153. public bool UseQuitKeyCodeList = true;
  154. [SerializeField, Tooltip("Long pressing the key to quit app")]
  155. public bool UseLongPress = true;
  156. }
  157. [Serializable]
  158. public class SDKSystemSettings
  159. {
  160. [SerializeField, Tooltip("Enable safety area height in app")]
  161. public bool UseSafetyAreaHeight = true;
  162. [SerializeField, Tooltip("Whether the load Scene DontDestroy SDKSystem")]
  163. public bool IsDontDestroyOnLoad = false;
  164. }
  165. [CreateAssetMenu(fileName = "SDKConfiguration", menuName = "SCConfig/SDKConfiguration")]
  166. public class SDKConfiguration : ScriptableObject
  167. {
  168. [Space(10)]
  169. [SerializeField]
  170. public InputSettings InputSettings = new InputSettings();
  171. [Space(10)]
  172. [SerializeField]
  173. public SlamSettings SlamSettings = new SlamSettings();
  174. [Space(10)]
  175. [SerializeField]
  176. public DetectorSettings DetectorSettings = new DetectorSettings();
  177. [Space(10)]
  178. [SerializeField]
  179. public QuitAppSettings QuitAppSettings = new QuitAppSettings();
  180. [Space(10)]
  181. [SerializeField]
  182. public SDKSystemSettings SDKSystemSettings = new SDKSystemSettings();
  183. }
  184. [Serializable]
  185. public class Section
  186. {
  187. public string section;
  188. public List<KEY_VALUE> KEY_VALUE;
  189. }
  190. [Serializable]
  191. public class KEY_VALUE
  192. {
  193. public string Name;
  194. public string Value;
  195. }
  196. }