123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #if UNITY_EDITOR
- using UnityEditor;
- using UnityEngine;
- using UnityEngine.InputSystem;
- #endif
- using UnityEngine.Scripting;
- namespace SC.XR.Unity.Simulation {
- /// <summary>
- /// This class automatically registers control layouts used by the <see cref="XRDeviceSimulator"/>.
- /// </summary>
- /// <seealso cref="XRSimulatedHMD"/>
- /// <seealso cref="XRSimulatedController"/>
- #if UNITY_EDITOR
- [InitializeOnLoad]
- #endif
- [Preserve]
- public static class SimulatedInputLayoutLoader
- {
- [Preserve]
- static SimulatedInputLayoutLoader()
- {
- RegisterInputLayouts();
- }
- /// <summary>
- /// See <see cref="RuntimeInitializeLoadType.BeforeSceneLoad"/>.
- /// </summary>
- //[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad), Preserve]
- public static void Initialize()
- {
- // Will execute the static constructor as a side effect.
- }
- static void RegisterInputLayouts()
- {
- // InputSystem.RegisterLayout<XRSimulatedHMD>();
- // InputSystem.RegisterLayout<XRSimulatedController>();
- }
- }
- }
|