SDKGlobalConfiguration.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5. using UnityEditor;
  6. namespace SC.XR.Unity
  7. {
  8. [Serializable]
  9. public class RecorderDetectorSettings
  10. {
  11. [SerializeField, Tooltip("Whether is screen recording")]
  12. public bool IsRecording = false;
  13. }
  14. [Serializable]
  15. public class BatteryDetectorSettings
  16. {
  17. [SerializeField, Tooltip("Whether the device is charging")]
  18. public bool IsCharging;
  19. [SerializeField, Tooltip("Whether the battery is under20")]
  20. public bool Under20;
  21. [SerializeField, Tooltip("Whether the battery is under15")]
  22. public bool Under15;
  23. [SerializeField, Tooltip("Whether the battery is under10")]
  24. public bool Under10;
  25. [SerializeField, Tooltip("Whether the battery is under5")]
  26. public bool Under5;
  27. [SerializeField, Tooltip("Whether the battery is under1")]
  28. public bool Under1;
  29. [SerializeField, Tooltip("Whether the right controller is connected")]
  30. public bool IsRightConnect;
  31. [SerializeField, Tooltip("Whether the right controller is unconnecting")]
  32. public bool IsRightUnconnecting;
  33. [SerializeField, Tooltip("Whether the right controller is low-power")]
  34. public bool IsRightLow;
  35. [SerializeField, Tooltip("Whether the left controller is connected")]
  36. public bool IsLeftConnect;
  37. [SerializeField, Tooltip("Whether the left controller is unconnecting")]
  38. public bool IsLeftUnconnecting;
  39. [SerializeField, Tooltip("Whether the left controller is low-power")]
  40. public bool IsLeftLow;
  41. [SerializeField, Tooltip("Whether the hand tracking is enabled")]
  42. public bool IsHandTracking;
  43. }
  44. [Serializable]
  45. public class SafetyAreaSettings
  46. {
  47. [SerializeField, Tooltip("Height of device when setting safety area")]
  48. public float SafetyAreaHeight = 1.6f;
  49. }
  50. [CreateAssetMenu(fileName = "SDKGlobalConfiguration", menuName = "SCConfig/SDKGlobalConfiguration")]
  51. public class SDKGlobalConfiguration : ScriptableObject
  52. {
  53. [Space(10)]
  54. [SerializeField]
  55. public RecorderDetectorSettings RecorderDetectorSettings = new RecorderDetectorSettings();
  56. [Space(10)]
  57. [SerializeField]
  58. public BatteryDetectorSettings BatteryDetectorSettings = new BatteryDetectorSettings();
  59. [Space(10)]
  60. [SerializeField]
  61. public SafetyAreaSettings SafetyAreaSettings = new SafetyAreaSettings();
  62. }
  63. //public class EditorWindows: EditorWindow
  64. //{
  65. // private Editor editor;
  66. // [MenuItem("SDK/Settings/SDK Configuration")]
  67. // public static void ShowConfigWindow()
  68. // {
  69. // var window = EditorWindow.GetWindow<EditorWindows>(true, "SDK Configuration", true);
  70. // window.editor = Editor.CreateEditor(ScriptableObject.CreateInstance<SDKConfiguration>());
  71. // }
  72. // [MenuItem("SDK/Settings/SDK Global Configuration")]
  73. // public static void ShowGlobalConfigWindow()
  74. // {
  75. // var window = EditorWindow.GetWindow<EditorWindows>(true, "SDK Global Configuration", true);
  76. // window.editor = Editor.CreateEditor(ScriptableObject.CreateInstance<SDKGlobalConfiguration>());
  77. // }
  78. // private void OnGUI()
  79. // {
  80. // this.editor.OnInspectorGUI();
  81. // }
  82. //}
  83. }