This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/ARPlusSystem-250418/Library/PackageCache/com.unity.xr.arkit@4.2.10/Runtime/Input/InputLayoutLoader.cs

45 lines
1006 B
C#

#if UNITY_INPUT_SYSTEM
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.InputSystem.XR;
using UnityEngine.XR;
using UnityEngine.XR.ARSubsystems;
using Inputs = UnityEngine.InputSystem.InputSystem;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace UnityEngine.XR.ARKit
{
#if UNITY_EDITOR
[InitializeOnLoad]
#endif
public class InputLayoutLoader
{
#if UNITY_EDITOR
static InputLayoutLoader()
{
RegisterLayouts();
}
#endif
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
static void RegisterLayouts()
{
#if !UNITY_EDITOR
if (!Api.AtLeast11_0())
return;
#endif
Inputs.RegisterLayout<HandheldARInputDevice>(
matches: new InputDeviceMatcher()
.WithInterface(XRUtilities.InterfaceMatchAnyVersion)
.WithProduct("(ARKit)")
);
}
}
}
#endif