SimulatedInputLayoutLoader.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #if UNITY_EDITOR
  2. using UnityEditor;
  3. using UnityEngine;
  4. using UnityEngine.InputSystem;
  5. #endif
  6. using UnityEngine.Scripting;
  7. namespace SC.XR.Unity.Simulation {
  8. /// <summary>
  9. /// This class automatically registers control layouts used by the <see cref="XRDeviceSimulator"/>.
  10. /// </summary>
  11. /// <seealso cref="XRSimulatedHMD"/>
  12. /// <seealso cref="XRSimulatedController"/>
  13. #if UNITY_EDITOR
  14. [InitializeOnLoad]
  15. #endif
  16. [Preserve]
  17. public static class SimulatedInputLayoutLoader
  18. {
  19. [Preserve]
  20. static SimulatedInputLayoutLoader()
  21. {
  22. RegisterInputLayouts();
  23. }
  24. /// <summary>
  25. /// See <see cref="RuntimeInitializeLoadType.BeforeSceneLoad"/>.
  26. /// </summary>
  27. //[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad), Preserve]
  28. public static void Initialize()
  29. {
  30. // Will execute the static constructor as a side effect.
  31. }
  32. static void RegisterInputLayouts()
  33. {
  34. // InputSystem.RegisterLayout<XRSimulatedHMD>();
  35. // InputSystem.RegisterLayout<XRSimulatedController>();
  36. }
  37. }
  38. }