using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading; using AOT; using UnityEngine.Analytics; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; using UnityEngine.InputSystem.XR; using UnityEngine.Rendering; using UnityEngine.Scripting; using UnityEngine.Serialization; using UnityEngine.XR.Management; using UnityEngine.XR.OpenXR.Features; using UnityEngine.XR.OpenXR.Features.Interactions; using UnityEngine.XR.OpenXR.Input; using UnityEngine.XR.OpenXR.NativeTypes; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Editor")] [assembly: InternalsVisibleTo("UnityEditor.XR.OpenXR.Tests")] [assembly: Preserve] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.TestHelpers")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests.Editor")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: InternalsVisibleTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [CompilerGenerated] [EditorBrowsable(EditorBrowsableState.Never)] [GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)] internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 { private struct MonoScriptData { public byte[] FilePathsData; public byte[] TypesData; public int TotalTypes; public int TotalFiles; public bool IsEditorOnly; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static MonoScriptData Get() { return new MonoScriptData { FilePathsData = new byte[4123] { 0, 0, 0, 2, 0, 0, 0, 108, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 92, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 70, 101, 97, 116, 117, 114, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 92, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 84, 121, 112, 101, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 70, 111, 118, 101, 97, 116, 101, 100, 82, 101, 110, 100, 101, 114, 105, 110, 103, 70, 101, 97, 116, 117, 114, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 97, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 68, 80, 97, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 100, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 69, 121, 101, 71, 97, 122, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 108, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 97, 110, 100, 67, 111, 109, 109, 111, 110, 80, 111, 115, 101, 115, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 104, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 109, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 80, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 72, 84, 67, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 108, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 117, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 116, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 114, 111, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 106, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 105, 99, 114, 111, 115, 111, 102, 116, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 114, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 77, 105, 99, 114, 111, 115, 111, 102, 116, 77, 111, 116, 105, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 110, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 101, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 80, 97, 108, 109, 80, 111, 115, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 109, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 92, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 82, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 73, 110, 116, 101, 114, 110, 97, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 90, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 6, 0, 0, 0, 93, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 70, 101, 97, 116, 117, 114, 101, 115, 92, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 79, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 72, 97, 112, 116, 105, 99, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 78, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 79, 112, 101, 110, 88, 82, 68, 101, 118, 105, 99, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 75, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 79, 112, 101, 110, 88, 82, 72, 109, 100, 46, 99, 115, 0, 0, 0, 4, 0, 0, 0, 77, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 77, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 105, 110, 112, 117, 116, 92, 80, 111, 115, 101, 67, 111, 110, 116, 114, 111, 108, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 75, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 65, 110, 97, 108, 121, 116, 105, 99, 115, 46, 99, 115, 0, 0, 0, 2, 0, 0, 0, 88, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 67, 111, 108, 111, 114, 83, 117, 98, 109, 105, 115, 115, 111, 110, 77, 111, 100, 101, 76, 105, 115, 116, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 75, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 67, 111, 110, 115, 116, 97, 110, 116, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 82, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 68, 105, 97, 103, 110, 111, 115, 116, 105, 99, 82, 101, 112, 111, 114, 116, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 72, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 76, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 81, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 78, 111, 80, 114, 101, 73, 110, 105, 116, 46, 99, 115, 0, 0, 0, 7, 0, 0, 0, 77, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 80, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 82, 101, 110, 100, 101, 114, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 75, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 82, 101, 115, 116, 97, 114, 116, 101, 114, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 73, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 82, 117, 110, 116, 105, 109, 101, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 74, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 79, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 83, 112, 97, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 46, 99, 115, 0, 0, 0, 3, 0, 0, 0, 74, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 85, 110, 105, 116, 121, 65, 80, 73, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 73, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 79, 112, 101, 110, 88, 82, 85, 116, 105, 108, 105, 116, 121, 46, 99, 115, 0, 0, 0, 1, 0, 0, 0, 80, 92, 76, 105, 98, 114, 97, 114, 121, 92, 80, 97, 99, 107, 97, 103, 101, 67, 97, 99, 104, 101, 92, 99, 111, 109, 46, 117, 110, 105, 116, 121, 46, 120, 114, 46, 111, 112, 101, 110, 120, 114, 64, 49, 46, 49, 52, 46, 51, 92, 82, 117, 110, 116, 105, 109, 101, 92, 87, 97, 105, 116, 70, 111, 114, 82, 101, 115, 116, 97, 114, 116, 70, 105, 110, 105, 115, 104, 46, 99, 115 }, TypesData = new byte[5137] { 0, 0, 0, 0, 90, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 124, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 70, 101, 97, 116, 117, 114, 101, 0, 0, 0, 0, 100, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 46, 88, 114, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 70, 101, 97, 116, 117, 114, 101, 124, 78, 97, 116, 105, 118, 101, 65, 112, 105, 0, 0, 0, 0, 91, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 46, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 83, 101, 116, 116, 105, 110, 103, 115, 124, 80, 101, 114, 102, 111, 114, 109, 97, 110, 99, 101, 67, 104, 97, 110, 103, 101, 78, 111, 116, 105, 102, 105, 99, 97, 116, 105, 111, 110, 0, 0, 0, 0, 55, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 70, 111, 118, 101, 97, 116, 101, 100, 82, 101, 110, 100, 101, 114, 105, 110, 103, 70, 101, 97, 116, 117, 114, 101, 0, 0, 0, 0, 59, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 68, 80, 97, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 64, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 68, 80, 97, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 68, 80, 97, 100, 0, 0, 0, 0, 62, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 69, 121, 101, 71, 97, 122, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 76, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 69, 121, 101, 71, 97, 122, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 69, 121, 101, 71, 97, 122, 101, 68, 101, 118, 105, 99, 101, 0, 0, 0, 0, 61, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 69, 121, 101, 84, 114, 97, 99, 107, 105, 110, 103, 85, 115, 97, 103, 101, 115, 0, 0, 0, 0, 70, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 97, 110, 100, 67, 111, 109, 109, 111, 110, 80, 111, 115, 101, 115, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 91, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 97, 110, 100, 67, 111, 109, 109, 111, 110, 80, 111, 115, 101, 115, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 111, 115, 101, 115, 0, 0, 0, 0, 66, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 82, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 80, 114, 111, 102, 105, 108, 101, 124, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 71, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 80, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 90, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 80, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 82, 101, 118, 101, 114, 98, 71, 50, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 72, 84, 67, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 83, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 72, 84, 67, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 86, 105, 118, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 70, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 90, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 75, 72, 82, 83, 105, 109, 112, 108, 101, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 79, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 104, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 108, 117, 115, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 78, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 114, 111, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 102, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 101, 116, 97, 81, 117, 101, 115, 116, 84, 111, 117, 99, 104, 80, 114, 111, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 81, 117, 101, 115, 116, 80, 114, 111, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 105, 99, 114, 111, 115, 111, 102, 116, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 81, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 105, 99, 114, 111, 115, 111, 102, 116, 72, 97, 110, 100, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 72, 111, 108, 111, 76, 101, 110, 115, 72, 97, 110, 100, 0, 0, 0, 0, 76, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 77, 105, 99, 114, 111, 115, 111, 102, 116, 77, 111, 116, 105, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 97, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 77, 105, 99, 114, 111, 115, 111, 102, 116, 77, 111, 116, 105, 111, 110, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 87, 77, 82, 83, 112, 97, 116, 105, 97, 108, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 72, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 94, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 79, 99, 117, 108, 117, 115, 84, 111, 117, 99, 104, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 0, 0, 0, 0, 63, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 80, 97, 108, 109, 80, 111, 115, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 0, 0, 0, 0, 72, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 80, 97, 108, 109, 80, 111, 115, 101, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 124, 80, 97, 108, 109, 80, 111, 115, 101, 0, 0, 0, 0, 71, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 124, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 0, 0, 0, 0, 92, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 115, 46, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 80, 114, 111, 102, 105, 108, 101, 124, 86, 97, 108, 118, 101, 73, 110, 100, 101, 120, 67, 111, 110, 116, 114, 111, 108, 108, 101, 114, 1, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 1, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 79, 112, 101, 110, 88, 82, 70, 101, 97, 116, 117, 114, 101, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 55, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 124, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 0, 0, 0, 0, 69, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 65, 99, 116, 105, 111, 110, 66, 105, 110, 100, 105, 110, 103, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 65, 99, 116, 105, 111, 110, 67, 111, 110, 102, 105, 103, 0, 0, 0, 0, 68, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 68, 101, 118, 105, 99, 101, 67, 111, 110, 102, 105, 103, 0, 0, 0, 0, 71, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 65, 99, 116, 105, 111, 110, 77, 97, 112, 67, 111, 110, 102, 105, 103, 0, 0, 0, 0, 65, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 70, 101, 97, 116, 117, 114, 101, 115, 46, 79, 112, 101, 110, 88, 82, 73, 110, 116, 101, 114, 97, 99, 116, 105, 111, 110, 70, 101, 97, 116, 117, 114, 101, 124, 85, 115, 101, 114, 80, 97, 116, 104, 115, 0, 0, 0, 0, 34, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 72, 97, 112, 116, 105, 99, 0, 0, 0, 0, 41, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 72, 97, 112, 116, 105, 99, 67, 111, 110, 116, 114, 111, 108, 0, 0, 0, 0, 40, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 79, 112, 101, 110, 88, 82, 68, 101, 118, 105, 99, 101, 0, 0, 0, 0, 37, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 79, 112, 101, 110, 88, 82, 72, 109, 100, 0, 0, 0, 0, 39, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 0, 0, 0, 0, 54, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 46, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 124, 83, 101, 114, 105, 97, 108, 105, 122, 101, 100, 71, 117, 105, 100, 0, 0, 0, 0, 57, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 46, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 124, 83, 101, 114, 105, 97, 108, 105, 122, 101, 100, 66, 105, 110, 100, 105, 110, 103, 0, 0, 0, 0, 66, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 46, 79, 112, 101, 110, 88, 82, 73, 110, 112, 117, 116, 124, 71, 101, 116, 73, 110, 116, 101, 114, 110, 97, 108, 68, 101, 118, 105, 99, 101, 73, 100, 67, 111, 109, 109, 97, 110, 100, 0, 0, 0, 0, 32, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 80, 111, 115, 101, 0, 0, 0, 0, 39, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 73, 110, 112, 117, 116, 124, 80, 111, 115, 101, 67, 111, 110, 116, 114, 111, 108, 0, 0, 0, 0, 37, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 65, 110, 97, 108, 121, 116, 105, 99, 115, 0, 0, 0, 0, 53, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 79, 112, 101, 110, 88, 82, 65, 110, 97, 108, 121, 116, 105, 99, 115, 124, 73, 110, 105, 116, 105, 97, 108, 105, 122, 101, 69, 118, 101, 110, 116, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 60, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 124, 67, 111, 108, 111, 114, 83, 117, 98, 109, 105, 115, 115, 105, 111, 110, 77, 111, 100, 101, 76, 105, 115, 116, 0, 0, 0, 0, 31, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 67, 111, 110, 115, 116, 97, 110, 116, 115, 0, 0, 0, 0, 38, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 68, 105, 97, 103, 110, 111, 115, 116, 105, 99, 82, 101, 112, 111, 114, 116, 0, 0, 0, 0, 34, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 1, 0, 0, 0, 38, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 0, 0, 0, 0, 57, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 124, 70, 101, 97, 116, 117, 114, 101, 76, 111, 103, 103, 105, 110, 103, 73, 110, 102, 111, 1, 0, 0, 0, 38, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 66, 97, 115, 101, 0, 0, 0, 0, 43, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 76, 111, 97, 100, 101, 114, 78, 111, 80, 114, 101, 73, 110, 105, 116, 0, 0, 0, 0, 52, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 82, 101, 115, 117, 108, 116, 69, 120, 116, 101, 110, 115, 105, 111, 110, 115, 0, 0, 0, 0, 51, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 66, 97, 115, 101, 73, 110, 83, 116, 114, 117, 99, 116, 117, 114, 101, 0, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 86, 101, 99, 116, 111, 114, 50, 102, 0, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 86, 101, 99, 116, 111, 114, 51, 102, 0, 0, 0, 0, 47, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 81, 117, 97, 116, 101, 114, 110, 105, 111, 110, 102, 0, 0, 0, 0, 41, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 80, 111, 115, 101, 102, 0, 0, 0, 0, 55, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 78, 97, 116, 105, 118, 101, 84, 121, 112, 101, 115, 124, 88, 114, 83, 119, 97, 112, 99, 104, 97, 105, 110, 67, 114, 101, 97, 116, 101, 73, 110, 102, 111, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 37, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 82, 101, 115, 116, 97, 114, 116, 101, 114, 0, 0, 0, 0, 35, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 82, 117, 110, 116, 105, 109, 101, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 1, 0, 0, 0, 36, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 83, 101, 116, 116, 105, 110, 103, 115, 0, 0, 0, 0, 44, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 65, 80, 73, 124, 85, 110, 105, 116, 121, 88, 82, 84, 101, 120, 116, 117, 114, 101, 68, 97, 116, 97, 0, 0, 0, 0, 50, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 65, 80, 73, 124, 85, 110, 105, 116, 121, 88, 82, 82, 101, 110, 100, 101, 114, 84, 101, 120, 116, 117, 114, 101, 68, 101, 115, 99, 0, 0, 0, 0, 40, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 46, 65, 80, 73, 124, 85, 110, 105, 116, 121, 88, 82, 68, 105, 115, 112, 108, 97, 121, 0, 0, 0, 0, 35, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 79, 112, 101, 110, 88, 82, 85, 116, 105, 108, 105, 116, 121, 0, 0, 0, 0, 42, 85, 110, 105, 116, 121, 69, 110, 103, 105, 110, 101, 46, 88, 82, 46, 79, 112, 101, 110, 88, 82, 124, 87, 97, 105, 116, 70, 111, 114, 82, 101, 115, 116, 97, 114, 116, 70, 105, 110, 105, 115, 104 }, TotalFiles = 42, TotalTypes = 80, IsEditorOnly = false }; } } namespace UnityEngine.XR.OpenXR { [Serializable] public class OpenXRSettings : ScriptableObject { public enum ColorSubmissionModeGroup { [InspectorName("8 bits per channel (LDR, default)")] kRenderTextureFormatGroup8888, [InspectorName("10 bits floating-point per color channel, 2 bit alpha (HDR)")] kRenderTextureFormatGroup1010102_Float, [InspectorName("16 bits floating-point per channel (HDR)")] kRenderTextureFormatGroup16161616_Float, [InspectorName("5,6,5 bit packed (LDR, mobile)")] kRenderTextureFormatGroup565, [InspectorName("11,11,10 bit packed floating-point (HDR)")] kRenderTextureFormatGroup111110_Float } [Serializable] public class ColorSubmissionModeList { public ColorSubmissionModeGroup[] m_List = new ColorSubmissionModeGroup[1]; } public enum RenderMode { MultiPass, SinglePassInstanced } public enum DepthSubmissionMode { None, Depth16Bit, Depth24Bit } public enum BackendFovationApi : byte { Legacy, SRPFoveation } public enum SpaceWarpMotionVectorTextureFormat { RGBA16f, RG16f } [FormerlySerializedAs("extensions")] [HideInInspector] [SerializeField] internal OpenXRFeature[] features = new OpenXRFeature[0]; public static readonly ColorSubmissionModeGroup kDefaultColorMode; [SerializeField] private RenderMode m_renderMode = RenderMode.SinglePassInstanced; [SerializeField] private bool m_autoColorSubmissionMode = true; [SerializeField] private ColorSubmissionModeList m_colorSubmissionModes = new ColorSubmissionModeList(); [SerializeField] private DepthSubmissionMode m_depthSubmissionMode; [SerializeField] private SpaceWarpMotionVectorTextureFormat m_spacewarpMotionVectorTextureFormat; [SerializeField] private bool m_optimizeBufferDiscards; [SerializeField] private bool m_symmetricProjection; private const string LibraryName = "UnityOpenXR"; private static OpenXRSettings s_RuntimeInstance; public int featureCount => features.Length; public RenderMode renderMode { get { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { return Internal_GetRenderMode(); } return m_renderMode; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetRenderMode(value); } else { m_renderMode = value; } } } public bool autoColorSubmissionMode { get { return m_autoColorSubmissionMode; } set { m_autoColorSubmissionMode = value; } } public ColorSubmissionModeGroup[] colorSubmissionModes { get { if (m_autoColorSubmissionMode) { return new ColorSubmissionModeGroup[1] { kDefaultColorMode }; } if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { int num = Internal_GetColorSubmissionModes(null, 0); int[] array = new int[num]; Internal_GetColorSubmissionModes(array, num); return array.Select((int i) => (ColorSubmissionModeGroup)i).ToArray(); } return m_colorSubmissionModes.m_List; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetColorSubmissionModes(value.Select((ColorSubmissionModeGroup e) => (int)e).ToArray(), value.Length); } else { m_colorSubmissionModes.m_List = value; } } } public DepthSubmissionMode depthSubmissionMode { get { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { return Internal_GetDepthSubmissionMode(); } return m_depthSubmissionMode; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetDepthSubmissionMode(value); } else { m_depthSubmissionMode = value; } } } public SpaceWarpMotionVectorTextureFormat spacewarpMotionVectorTextureFormat { get { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { return Internal_GetSpaceWarpMotionVectorTextureFormat(); } return m_spacewarpMotionVectorTextureFormat; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetSpaceWarpMotionVectorTextureFormat(value); } else { m_spacewarpMotionVectorTextureFormat = value; } } } public bool optimizeBufferDiscards { get { return m_optimizeBufferDiscards; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetOptimizeBufferDiscards(value); } else { m_optimizeBufferDiscards = value; } } } public bool symmetricProjection { get { return m_symmetricProjection; } set { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Internal_SetSymmetricProjection(value); } else { m_symmetricProjection = value; } } } public BackendFovationApi foveatedRenderingApi => BackendFovationApi.Legacy; public static OpenXRSettings ActiveBuildTargetInstance => GetInstance(useActiveBuildTarget: true); public static OpenXRSettings Instance => GetInstance(useActiveBuildTarget: false); public static bool AllowRecentering => Internal_GetAllowRecentering(); public static float FloorOffset => Internal_GetFloorOffset(); public TFeature GetFeature() where TFeature : OpenXRFeature { return (TFeature)GetFeature(typeof(TFeature)); } public OpenXRFeature GetFeature(Type featureType) { OpenXRFeature[] array = features; foreach (OpenXRFeature openXRFeature in array) { if (featureType.IsInstanceOfType(openXRFeature)) { return openXRFeature; } } return null; } public OpenXRFeature[] GetFeatures() { return GetFeatures(typeof(TFeature)); } public OpenXRFeature[] GetFeatures(Type featureType) { List list = new List(); OpenXRFeature[] array = features; foreach (OpenXRFeature openXRFeature in array) { if (featureType.IsInstanceOfType(openXRFeature)) { list.Add(openXRFeature); } } return list.ToArray(); } public int GetFeatures(List featuresOut) where TFeature : OpenXRFeature { featuresOut.Clear(); OpenXRFeature[] array = features; for (int i = 0; i < array.Length; i++) { if (array[i] is TFeature item) { featuresOut.Add(item); } } return featuresOut.Count; } public int GetFeatures(Type featureType, List featuresOut) { featuresOut.Clear(); OpenXRFeature[] array = features; foreach (OpenXRFeature openXRFeature in array) { if (featureType.IsInstanceOfType(openXRFeature)) { featuresOut.Add(openXRFeature); } } return featuresOut.Count; } public OpenXRFeature[] GetFeatures() { return ((OpenXRFeature[])features?.Clone()) ?? new OpenXRFeature[0]; } public int GetFeatures(List featuresOut) { featuresOut.Clear(); featuresOut.AddRange(features); return featuresOut.Count; } private static void PermissionGrantedCallback(string permissionName) { } private void ApplyRenderSettings() { Internal_SetSymmetricProjection(m_symmetricProjection); Internal_SetRenderMode(m_renderMode); Internal_SetColorSubmissionModes(m_colorSubmissionModes.m_List.Select((ColorSubmissionModeGroup e) => (int)e).ToArray(), m_colorSubmissionModes.m_List.Length); Internal_SetDepthSubmissionMode(m_depthSubmissionMode); Internal_SetSpaceWarpMotionVectorTextureFormat(m_spacewarpMotionVectorTextureFormat); Internal_SetOptimizeBufferDiscards(m_optimizeBufferDiscards); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetRenderMode")] private static extern void Internal_SetRenderMode(RenderMode renderMode); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRenderMode")] private static extern RenderMode Internal_GetRenderMode(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetDepthSubmissionMode")] private static extern void Internal_SetDepthSubmissionMode(DepthSubmissionMode depthSubmissionMode); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetDepthSubmissionMode")] private static extern DepthSubmissionMode Internal_GetDepthSubmissionMode(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetSpaceWarpMotionVectorTextureFormat")] private static extern void Internal_SetSpaceWarpMotionVectorTextureFormat(SpaceWarpMotionVectorTextureFormat spaceWarpMotionVectorTextureFormat); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetSpaceWarpMotionVectorTextureFormat")] private static extern SpaceWarpMotionVectorTextureFormat Internal_GetSpaceWarpMotionVectorTextureFormat(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetSymmetricProjection")] private static extern void Internal_SetSymmetricProjection([MarshalAs(UnmanagedType.I1)] bool enabled); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetOptimizeMultiviewRenderRegions")] private static extern void Internal_SetOptimizeMultiviewRenderRegions([MarshalAs(UnmanagedType.I1)] bool enabled); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetOptimizeBufferDiscards")] private static extern void Internal_SetOptimizeBufferDiscards([MarshalAs(UnmanagedType.I1)] bool enabled); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_SetUsedApi")] private static extern void Internal_SetUsedFoveatedRenderingApi(BackendFovationApi api); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_GetUsedApi")] internal static extern BackendFovationApi Internal_GetUsedFoveatedRenderingApi(); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_HasRequestedEyeTrackingPermissions")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_HasRequestedEyeTrackingPermissions(); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_GetHasEyeTrackingPermissions")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_GetHasEyeTrackingPermissions(); [DllImport("UnityOpenXR", EntryPoint = "OculusFoveation_SetHasEyeTrackingPermissions")] internal static extern void Internal_SetHasEyeTrackingPermissions([MarshalAs(UnmanagedType.I1)] bool value); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetColorSubmissionMode")] private static extern void Internal_SetColorSubmissionMode(ColorSubmissionModeGroup[] colorSubmissionMode); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetColorSubmissionModes")] private static extern void Internal_SetColorSubmissionModes(int[] colorSubmissionMode, int arraySize); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetColorSubmissionModes")] private static extern int Internal_GetColorSubmissionModes([Out] int[] colorSubmissionMode, int arraySize); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetIsUsingLegacyXRDisplay")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetIsUsingLegacyXRDisplay(); private void Awake() { s_RuntimeInstance = this; } internal void ApplySettings() { ApplyRenderSettings(); } private static OpenXRSettings GetInstance(bool useActiveBuildTarget) { OpenXRSettings openXRSettings = null; openXRSettings = s_RuntimeInstance; if ((Object)(object)openXRSettings == (Object)null) { openXRSettings = ScriptableObject.CreateInstance(); } return openXRSettings; } public static void SetAllowRecentering(bool allowRecentering, float floorOffset = 1.5f) { Internal_SetAllowRecentering(allowRecentering, floorOffset); } public static void RefreshRecenterSpace() { Internal_RegenerateTrackingOrigin(); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetAllowRecentering")] private static extern void Internal_SetAllowRecentering([MarshalAs(UnmanagedType.U1)] bool active, float height); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_RegenerateTrackingOrigin")] private static extern void Internal_RegenerateTrackingOrigin(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetAllowRecentering")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetAllowRecentering(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetFloorOffsetHeight")] private static extern float Internal_GetFloorOffset(); } internal static class OpenXRAnalytics { [Serializable] private struct InitializeEvent { public bool success; public string runtime; public string runtime_version; public string plugin_version; public string api_version; public string[] available_extensions; public string[] enabled_extensions; public string[] enabled_features; public string[] failed_features; } private const int kMaxEventsPerHour = 1000; private const int kMaxNumberOfElements = 1000; private const string kVendorKey = "unity.openxr"; private const string kEventInitialize = "openxr_initialize"; private static bool s_Initialized; private static bool Initialize() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (s_Initialized) { return true; } if ((int)Analytics.RegisterEvent("openxr_initialize", 1000, 1000, "unity.openxr", "") != 0) { return false; } s_Initialized = true; return true; } public static void SendInitializeEvent(bool success) { if (s_Initialized || Initialize()) { SendPlayerAnalytics(CreateInitializeEvent(success)); } } private static InitializeEvent CreateInitializeEvent(bool success) { return new InitializeEvent { success = success, runtime = OpenXRRuntime.name, runtime_version = OpenXRRuntime.version, plugin_version = OpenXRRuntime.pluginVersion, api_version = OpenXRRuntime.apiVersion, enabled_extensions = (from ext in OpenXRRuntime.GetEnabledExtensions() select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray(), available_extensions = (from ext in OpenXRRuntime.GetAvailableExtensions() select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray(), enabled_features = (from f in OpenXRSettings.Instance.features where (Object)(object)f != (Object)null && f.enabled select ((object)f).GetType().FullName + "_" + f.version).ToArray(), failed_features = (from f in OpenXRSettings.Instance.features where (Object)(object)f != (Object)null && f.failedInitialization select ((object)f).GetType().FullName + "_" + f.version).ToArray() }; } private static void SendPlayerAnalytics(InitializeEvent data) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) Analytics.SendEvent("openxr_initialize", (object)data, 1, ""); } } public static class Constants { public const string k_SettingsKey = "com.unity.xr.openxr.settings4"; } internal class DiagnosticReport { private const string LibraryName = "UnityOpenXR"; public static readonly ulong k_NullSection; [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_StartReport")] public static extern void StartReport(); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_GetSection")] public static extern ulong GetSection(string sectionName); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddSectionEntry")] public static extern void AddSectionEntry(ulong sectionHandle, string sectionEntry, string sectionBody); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddSectionBreak")] public static extern void AddSectionBreak(ulong sectionHandle); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddEventEntry")] public static extern void AddEventEntry(string eventName, string eventData); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_DumpReport")] private static extern void Internal_DumpReport(); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_DumpReportWithReason")] private static extern void Internal_DumpReport(string reason); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_GenerateReport")] private static extern IntPtr Internal_GenerateReport(); [DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_ReleaseReport")] private static extern void Internal_ReleaseReport(IntPtr report); internal static string GenerateReport() { string result = ""; IntPtr intPtr = Internal_GenerateReport(); if (intPtr != IntPtr.Zero) { result = Marshal.PtrToStringAnsi(intPtr); Internal_ReleaseReport(intPtr); intPtr = IntPtr.Zero; } return result; } public static void DumpReport(string reason) { Internal_DumpReport(reason); } } public class OpenXRLoader : OpenXRLoaderBase { } public class OpenXRLoaderBase : XRLoaderHelper { private class FeatureLoggingInfo { public string m_nameUi; public string m_version; public string m_company; public string m_openxrExtensionStrings; public FeatureLoggingInfo(string nameUi, string version, string company, string extensionStrings) { m_nameUi = nameUi; m_version = version; m_company = company; m_openxrExtensionStrings = extensionStrings; } } internal enum LoaderState { Uninitialized, InitializeAttempted, Initialized, StartAttempted, Started, StopAttempted, Stopped, DeinitializeAttempted } internal delegate void ReceiveNativeEventDelegate(OpenXRFeature.NativeEvent e, ulong payload); private List featureLoggingInfo; private const double k_IdlePollingWaitTimeInSeconds = 0.1; private static List s_DisplaySubsystemDescriptors = new List(); private static List s_InputSubsystemDescriptors = new List(); private List validLoaderInitStates = new List { LoaderState.Uninitialized, LoaderState.InitializeAttempted }; private List validLoaderStartStates = new List { LoaderState.Initialized, LoaderState.StartAttempted, LoaderState.Stopped }; private List validLoaderStopStates = new List { LoaderState.StartAttempted, LoaderState.Started, LoaderState.StopAttempted }; private List validLoaderDeinitStates = new List { LoaderState.InitializeAttempted, LoaderState.Initialized, LoaderState.Stopped, LoaderState.DeinitializeAttempted }; private List runningStates = new List { LoaderState.Initialized, LoaderState.StartAttempted, LoaderState.Started }; private OpenXRFeature.NativeEvent currentOpenXRState; private bool actionSetsAttached; private UnhandledExceptionEventHandler unhandledExceptionHandler; internal bool DisableValidationChecksOnEnteringPlaymode; private double lastPollCheckTime; private const string LibraryName = "UnityOpenXR"; internal static OpenXRLoaderBase Instance { get; private set; } internal LoaderState currentLoaderState { get; private set; } internal XRDisplaySubsystem displaySubsystem => ((XRLoaderHelper)this).GetLoadedSubsystem(); internal XRInputSubsystem inputSubsystem { get { OpenXRLoaderBase instance = Instance; if (instance == null) { return null; } return ((XRLoaderHelper)instance).GetLoadedSubsystem(); } } private bool isInitialized { get { if (currentLoaderState != LoaderState.Uninitialized) { return currentLoaderState != LoaderState.DeinitializeAttempted; } return false; } } private bool isStarted => runningStates.Contains(currentLoaderState); private static void ExceptionHandler(object sender, UnhandledExceptionEventArgs args) { ulong section = DiagnosticReport.GetSection("Unhandled Exception Report"); DiagnosticReport.AddSectionEntry(section, "Is Terminating", $"{args.IsTerminating}"); Exception ex = (Exception)args.ExceptionObject; DiagnosticReport.AddSectionEntry(section, "Message", ex.Message ?? ""); DiagnosticReport.AddSectionEntry(section, "Source", ex.Source ?? ""); DiagnosticReport.AddSectionEntry(section, "Stack Trace", "\n" + ex.StackTrace); DiagnosticReport.DumpReport("Uncaught Exception"); } public override bool Initialize() { if (currentLoaderState == LoaderState.Initialized) { return true; } if (!validLoaderInitStates.Contains(currentLoaderState)) { return false; } if ((Object)(object)Instance != (Object)null) { Debug.LogError((object)"Only one OpenXRLoader can be initialized at any given time"); return false; } DiagnosticReport.StartReport(); try { if (InitializeInternal()) { return true; } } catch (Exception ex) { Debug.LogException(ex); } ((XRLoader)this).Deinitialize(); Instance = null; OpenXRAnalytics.SendInitializeEvent(success: false); return false; } private bool InitializeInternal() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown Instance = this; currentLoaderState = LoaderState.InitializeAttempted; Internal_SetSuccessfullyInitialized(value: false); OpenXRInput.RegisterLayouts(); OpenXRFeature.Initialize(); if (!LoadOpenXRSymbols()) { Debug.LogError((object)"Failed to load openxr runtime loader."); return false; } OpenXRSettings.Instance.features = (from f in OpenXRSettings.Instance.features where (Object)(object)f != (Object)null orderby f.priority descending, f.nameUi select f).ToArray(); OpenXRFeature.HookGetInstanceProcAddr(); if (!Internal_InitializeSession()) { return false; } RequestOpenXRFeatures(); RegisterOpenXRCallbacks(); if ((Object)null != (Object)(object)OpenXRSettings.Instance) { OpenXRSettings.Instance.ApplySettings(); } if (!CreateSubsystems()) { return false; } if (OpenXRFeature.requiredFeatureFailed) { return false; } SetApplicationInfo(); OpenXRAnalytics.SendInitializeEvent(success: true); OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemCreate); DebugLogEnabledSpecExtensions(); Application.onBeforeRender += new UnityAction(ProcessOpenXRMessageLoop); currentLoaderState = LoaderState.Initialized; return true; } private bool CreateSubsystems() { if (displaySubsystem == null) { this.CreateSubsystem(s_DisplaySubsystemDescriptors, "OpenXR Display"); if (displaySubsystem == null) { return false; } } if (inputSubsystem == null) { this.CreateSubsystem(s_InputSubsystemDescriptors, "OpenXR Input"); if (inputSubsystem == null) { return false; } } return true; } internal void ProcessOpenXRMessageLoop() { if (currentOpenXRState == OpenXRFeature.NativeEvent.XrIdle || currentOpenXRState == OpenXRFeature.NativeEvent.XrStopping || currentOpenXRState == OpenXRFeature.NativeEvent.XrExiting || currentOpenXRState == OpenXRFeature.NativeEvent.XrLossPending || currentOpenXRState == OpenXRFeature.NativeEvent.XrInstanceLossPending) { float realtimeSinceStartup = Time.realtimeSinceStartup; if ((double)realtimeSinceStartup - lastPollCheckTime < 0.1) { return; } lastPollCheckTime = realtimeSinceStartup; } Internal_PumpMessageLoop(); } public override bool Start() { if (currentLoaderState == LoaderState.Started) { return true; } if (!validLoaderStartStates.Contains(currentLoaderState)) { return false; } currentLoaderState = LoaderState.StartAttempted; if (!StartInternal()) { ((XRLoader)this).Stop(); return false; } currentLoaderState = LoaderState.Started; return true; } private bool StartInternal() { if (!Internal_CreateSessionIfNeeded()) { return false; } if (currentOpenXRState != OpenXRFeature.NativeEvent.XrReady || (currentLoaderState != LoaderState.StartAttempted && currentLoaderState != LoaderState.Started)) { return true; } this.StartSubsystem(); XRDisplaySubsystem obj = displaySubsystem; if (obj != null && !((IntegratedSubsystem)obj).running) { return false; } Internal_BeginSession(); if (!actionSetsAttached) { OpenXRInput.AttachActionSets(); actionSetsAttached = true; } XRDisplaySubsystem obj2 = displaySubsystem; if (obj2 != null && !((IntegratedSubsystem)obj2).running) { this.StartSubsystem(); } XRInputSubsystem obj3 = inputSubsystem; if (obj3 != null && !((IntegratedSubsystem)obj3).running) { this.StartSubsystem(); } XRInputSubsystem obj4 = inputSubsystem; bool num = obj4 != null && ((IntegratedSubsystem)obj4).running; XRDisplaySubsystem obj5 = displaySubsystem; bool flag = obj5 != null && ((IntegratedSubsystem)obj5).running; if (num && flag) { OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemStart); return true; } return false; } public override bool Stop() { if (currentLoaderState == LoaderState.Stopped) { return true; } if (!validLoaderStopStates.Contains(currentLoaderState)) { return false; } currentLoaderState = LoaderState.StopAttempted; XRInputSubsystem obj = inputSubsystem; bool num = obj != null && ((IntegratedSubsystem)obj).running; XRDisplaySubsystem obj2 = displaySubsystem; bool flag = obj2 != null && ((IntegratedSubsystem)obj2).running; if (num || flag) { OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemStop); } if (num) { this.StopSubsystem(); } if (flag) { this.StopSubsystem(); } StopInternal(); currentLoaderState = LoaderState.Stopped; return true; } private void StopInternal() { Internal_EndSession(); ProcessOpenXRMessageLoop(); } public override bool Deinitialize() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown if (currentLoaderState == LoaderState.Uninitialized) { return true; } if (!validLoaderDeinitStates.Contains(currentLoaderState)) { return false; } currentLoaderState = LoaderState.DeinitializeAttempted; try { Internal_RequestExitSession(); Application.onBeforeRender -= new UnityAction(ProcessOpenXRMessageLoop); ProcessOpenXRMessageLoop(); OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemDestroy); this.DestroySubsystem(); this.DestroySubsystem(); DiagnosticReport.DumpReport("System Shutdown"); Internal_DestroySession(); ProcessOpenXRMessageLoop(); Internal_UnloadOpenXRLibrary(); currentLoaderState = LoaderState.Uninitialized; actionSetsAttached = false; if (unhandledExceptionHandler != null) { AppDomain.CurrentDomain.UnhandledException -= unhandledExceptionHandler; unhandledExceptionHandler = null; } return ((XRLoaderHelper)this).Deinitialize(); } finally { Instance = null; } } internal void CreateSubsystem(List descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem { ((XRLoaderHelper)this).CreateSubsystem(descriptors, id); } internal void StartSubsystem() where T : class, ISubsystem { ((XRLoaderHelper)this).StartSubsystem(); } internal void StopSubsystem() where T : class, ISubsystem { ((XRLoaderHelper)this).StopSubsystem(); } internal void DestroySubsystem() where T : class, ISubsystem { ((XRLoaderHelper)this).DestroySubsystem(); } private void SetApplicationInfo() { byte[] array = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(Application.version)); if (BitConverter.IsLittleEndian) { Array.Reverse(array); } uint applicationVersionHash = BitConverter.ToUInt32(array, 0); Internal_SetApplicationInfo(Application.productName, Application.version, applicationVersionHash, Application.unityVersion); } internal static byte[] StringToWCHAR_T(string s) { return ((Environment.OSVersion.Platform == PlatformID.Unix) ? Encoding.UTF32 : Encoding.Unicode).GetBytes(s + "\0"); } private bool LoadOpenXRSymbols() { if (!Internal_LoadOpenXRLibrary(StringToWCHAR_T("openxr_loader"))) { return false; } return true; } private void RequestOpenXRFeatures() { OpenXRSettings instance = OpenXRSettings.Instance; if ((Object)(object)instance == (Object)null || instance.features == null) { return; } featureLoggingInfo = new List(instance.featureCount); OpenXRFeature[] features = instance.features; foreach (OpenXRFeature openXRFeature in features) { if ((Object)(object)openXRFeature == (Object)null || !openXRFeature.enabled) { continue; } featureLoggingInfo.Add(new FeatureLoggingInfo(openXRFeature.nameUi, openXRFeature.version, openXRFeature.company, openXRFeature.openxrExtensionStrings)); if (string.IsNullOrEmpty(openXRFeature.openxrExtensionStrings)) { continue; } string[] array = openXRFeature.openxrExtensionStrings.Split(' '); foreach (string text in array) { if (!string.IsNullOrWhiteSpace(text)) { Internal_RequestEnableExtensionString(text); } } } } private void LogRequestedOpenXRFeatures() { OpenXRSettings instance = OpenXRSettings.Instance; if ((Object)(object)instance == (Object)null || instance.features == null) { return; } StringBuilder stringBuilder = new StringBuilder(""); StringBuilder stringBuilder2 = new StringBuilder(""); uint num = 0u; uint num2 = 0u; foreach (FeatureLoggingInfo item in featureLoggingInfo) { stringBuilder.Append(" " + item.m_nameUi + ": Version=" + item.m_version + ", Company=\"" + item.m_company + "\""); if (!string.IsNullOrEmpty(item.m_openxrExtensionStrings)) { stringBuilder.Append(", Extensions=\"" + item.m_openxrExtensionStrings + "\""); string[] array = item.m_openxrExtensionStrings.Split(' '); foreach (string text in array) { if (!string.IsNullOrWhiteSpace(text) && !Internal_IsExtensionEnabled(text)) { num2++; stringBuilder2.Append(" " + text + ": Feature=\"" + item.m_nameUi + "\": Version=" + item.m_version + ", Company=\"" + item.m_company + "\"\n"); } } } stringBuilder.Append("\n"); } ulong section = DiagnosticReport.GetSection("OpenXR Runtime Info"); DiagnosticReport.AddSectionBreak(section); DiagnosticReport.AddSectionEntry(section, "Features requested to be enabled", $"({num})\n{stringBuilder.ToString()}"); DiagnosticReport.AddSectionBreak(section); DiagnosticReport.AddSectionEntry(section, "Requested feature extensions not supported by runtime", $"({num2})\n{stringBuilder2.ToString()}"); } private static void DebugLogEnabledSpecExtensions() { ulong section = DiagnosticReport.GetSection("OpenXR Runtime Info"); DiagnosticReport.AddSectionBreak(section); string[] enabledExtensions = OpenXRRuntime.GetEnabledExtensions(); StringBuilder stringBuilder = new StringBuilder($"({enabledExtensions.Length})\n"); string[] array = enabledExtensions; foreach (string text in array) { stringBuilder.Append($" {text}: Version={OpenXRRuntime.GetExtensionVersion(text)}\n"); } DiagnosticReport.AddSectionEntry(section, "Runtime extensions enabled", stringBuilder.ToString()); } [MonoPInvokeCallback(typeof(ReceiveNativeEventDelegate))] private static void ReceiveNativeEvent(OpenXRFeature.NativeEvent e, ulong payload) { OpenXRLoaderBase instance = Instance; if ((Object)(object)instance != (Object)null) { instance.currentOpenXRState = e; } switch (e) { case OpenXRFeature.NativeEvent.XrRestartRequested: OpenXRRestarter.Instance.ShutdownAndRestart(); break; case OpenXRFeature.NativeEvent.XrReady: instance.StartInternal(); break; case OpenXRFeature.NativeEvent.XrBeginSession: instance.LogRequestedOpenXRFeatures(); break; case OpenXRFeature.NativeEvent.XrFocused: DiagnosticReport.DumpReport("System Startup Completed"); break; case OpenXRFeature.NativeEvent.XrRequestRestartLoop: Debug.Log((object)"XR Initialization failed, will try to restart xr periodically."); OpenXRRestarter.Instance.PauseAndShutdownAndRestart(); break; case OpenXRFeature.NativeEvent.XrRequestGetSystemLoop: OpenXRRestarter.Instance.PauseAndRetryInitialization(); break; case OpenXRFeature.NativeEvent.XrStopping: instance.StopInternal(); break; } OpenXRFeature.ReceiveNativeEvent(e, payload); if ((!((Object)(object)instance == (Object)null) && instance.isStarted) || e == OpenXRFeature.NativeEvent.XrInstanceChanged) { switch (e) { case OpenXRFeature.NativeEvent.XrExiting: OpenXRRestarter.Instance.Shutdown(); break; case OpenXRFeature.NativeEvent.XrLossPending: OpenXRRestarter.Instance.ShutdownAndRestart(); break; case OpenXRFeature.NativeEvent.XrInstanceLossPending: OpenXRRestarter.Instance.Shutdown(); break; } } } internal static void RegisterOpenXRCallbacks() { Internal_SetCallbacks(ReceiveNativeEvent); } [DllImport("UnityOpenXR", EntryPoint = "main_LoadOpenXRLibrary")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_LoadOpenXRLibrary(byte[] loaderPath); [DllImport("UnityOpenXR", EntryPoint = "main_UnloadOpenXRLibrary")] internal static extern void Internal_UnloadOpenXRLibrary(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetCallbacks")] private static extern void Internal_SetCallbacks(ReceiveNativeEventDelegate callback); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "NativeConfig_SetApplicationInfo")] private static extern void Internal_SetApplicationInfo(string applicationName, string applicationVersion, uint applicationVersionHash, string engineVersion); [DllImport("UnityOpenXR", EntryPoint = "session_RequestExitSession")] internal static extern void Internal_RequestExitSession(); [DllImport("UnityOpenXR", EntryPoint = "session_InitializeSession")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_InitializeSession(); [DllImport("UnityOpenXR", EntryPoint = "session_CreateSessionIfNeeded")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_CreateSessionIfNeeded(); [DllImport("UnityOpenXR", EntryPoint = "session_BeginSession")] internal static extern void Internal_BeginSession(); [DllImport("UnityOpenXR", EntryPoint = "session_EndSession")] internal static extern void Internal_EndSession(); [DllImport("UnityOpenXR", EntryPoint = "session_DestroySession")] internal static extern void Internal_DestroySession(); [DllImport("UnityOpenXR", EntryPoint = "messagepump_PumpMessageLoop")] private static extern void Internal_PumpMessageLoop(); [DllImport("UnityOpenXR", EntryPoint = "session_SetSuccessfullyInitialized")] internal static extern void Internal_SetSuccessfullyInitialized([MarshalAs(UnmanagedType.I1)] bool value); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_RequestEnableExtensionString")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_RequestEnableExtensionString(string extensionString); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_IsExtensionEnabled")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_IsExtensionEnabled(string extensionName); } public class OpenXRLoaderNoPreInit : OpenXRLoaderBase { } internal class OpenXRRestarter : MonoBehaviour { internal Action onAfterRestart; internal Action onAfterShutdown; internal Action onQuit; internal Action onAfterCoroutine; internal Action onAfterSuccessfulRestart; private static OpenXRRestarter s_Instance; private Coroutine m_Coroutine; private static int m_pauseAndRestartCoroutineCount; private Object m_PauseAndRestartCoroutineCountLock = new Object(); private static int m_pauseAndRestartAttempts; public bool isRunning => m_Coroutine != null; public static float TimeBetweenRestartAttempts { get; set; } public static int PauseAndRestartAttempts => m_pauseAndRestartAttempts; internal static int PauseAndRestartCoroutineCount => m_pauseAndRestartCoroutineCount; public static OpenXRRestarter Instance { get { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if ((Object)(object)s_Instance == (Object)null) { GameObject val = GameObject.Find("~oxrestarter"); if ((Object)(object)val == (Object)null) { val = new GameObject("~oxrestarter"); ((Object)val).hideFlags = (HideFlags)61; val.AddComponent(); } s_Instance = val.GetComponent(); } return s_Instance; } } internal static bool DisableApplicationQuit { get; set; } static OpenXRRestarter() { TimeBetweenRestartAttempts = 5f; DisableApplicationQuit = false; } public void ResetCallbacks() { onAfterRestart = null; onAfterSuccessfulRestart = null; onAfterShutdown = null; onAfterCoroutine = null; onQuit = null; m_pauseAndRestartAttempts = 0; } public void Shutdown() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { if (m_Coroutine != null) { Debug.LogError((object)"Only one shutdown or restart can be executed at a time"); } else { m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: false, shouldShutdown: true)); } } } public void ShutdownAndRestart() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { if (m_Coroutine != null) { Debug.LogError((object)"Only one shutdown or restart can be executed at a time"); } else { m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: true)); } } } public void PauseAndShutdownAndRestart() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { ((MonoBehaviour)this).StartCoroutine(PauseAndShutdownAndRestartCoroutine(TimeBetweenRestartAttempts)); } } public void PauseAndRetryInitialization() { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { ((MonoBehaviour)this).StartCoroutine(PauseAndRetryInitializationCoroutine(TimeBetweenRestartAttempts)); } } private void IncrementPauseAndRestartCoroutineCount() { lock (m_PauseAndRestartCoroutineCountLock) { m_pauseAndRestartCoroutineCount++; } } private void DecrementPauseAndRestartCoroutineCount() { lock (m_PauseAndRestartCoroutineCountLock) { m_pauseAndRestartCoroutineCount--; } } private IEnumerator PauseAndShutdownAndRestartCoroutine(float pauseTimeInSeconds) { IncrementPauseAndRestartCoroutineCount(); try { yield return (object)new WaitForSeconds(pauseTimeInSeconds); yield return new WaitForRestartFinish(); m_pauseAndRestartAttempts++; m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: true)); } finally { onAfterCoroutine?.Invoke(); } DecrementPauseAndRestartCoroutineCount(); } private IEnumerator PauseAndRetryInitializationCoroutine(float pauseTimeInSeconds) { IncrementPauseAndRestartCoroutineCount(); try { yield return (object)new WaitForSeconds(pauseTimeInSeconds); yield return new WaitForRestartFinish(); if (!((Object)(object)XRGeneralSettings.Instance.Manager.activeLoader != (Object)null)) { m_pauseAndRestartAttempts++; m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: false)); } } finally { onAfterCoroutine?.Invoke(); } DecrementPauseAndRestartCoroutineCount(); } private IEnumerator RestartCoroutine(bool shouldRestart, bool shouldShutdown) { try { if (shouldShutdown) { Debug.Log((object)"Shutting down OpenXR."); yield return null; XRGeneralSettings.Instance.Manager.DeinitializeLoader(); yield return null; onAfterShutdown?.Invoke(); } if (shouldRestart && OpenXRRuntime.ShouldRestart()) { Debug.Log((object)"Initializing OpenXR."); yield return XRGeneralSettings.Instance.Manager.InitializeLoader(); XRGeneralSettings.Instance.Manager.StartSubsystems(); if ((Object)(object)XRGeneralSettings.Instance.Manager.activeLoader != (Object)null) { m_pauseAndRestartAttempts = 0; onAfterSuccessfulRestart?.Invoke(); } onAfterRestart?.Invoke(); } else if (OpenXRRuntime.ShouldQuit()) { onQuit?.Invoke(); if (!DisableApplicationQuit) { Application.Quit(); } } } finally { OpenXRRestarter openXRRestarter = this; openXRRestarter.m_Coroutine = null; openXRRestarter.onAfterCoroutine?.Invoke(); } } } public static class OpenXRRuntime { private const string LibraryName = "UnityOpenXR"; public static string name { get { if (!Internal_GetRuntimeName(out var runtimeNamePtr)) { return ""; } return Marshal.PtrToStringAnsi(runtimeNamePtr); } } public static string version { get { if (!Internal_GetRuntimeVersion(out var major, out var minor, out var patch)) { return ""; } return $"{major}.{minor}.{patch}"; } } public static string apiVersion { get { if (!Internal_GetAPIVersion(out var major, out var minor, out var patch)) { return ""; } return $"{major}.{minor}.{patch}"; } } public static string pluginVersion { get { if (!Internal_GetPluginVersion(out var pluginVersionPtr)) { return ""; } return Marshal.PtrToStringAnsi(pluginVersionPtr); } } public static bool retryInitializationOnFormFactorErrors { get { return Internal_GetSoftRestartLoopAtInitialization(); } set { Internal_SetSoftRestartLoopAtInitialization(value); } } public static event Func wantsToQuit; public static event Func wantsToRestart; internal static bool isRuntimeAPIVersionGreaterThan1_1() { if (Internal_GetAPIVersion(out var major, out var minor, out var _) && major >= 1 && minor >= 1) { return true; } return false; } public static bool IsExtensionEnabled(string extensionName) { return Internal_IsExtensionEnabled(extensionName); } public static uint GetExtensionVersion(string extensionName) { return Internal_GetExtensionVersion(extensionName); } public static string[] GetEnabledExtensions() { string[] array = new string[Internal_GetEnabledExtensionCount()]; for (int i = 0; i < array.Length; i++) { Internal_GetEnabledExtensionName((uint)i, out var extensionName); array[i] = extensionName ?? ""; } return array; } public static string[] GetAvailableExtensions() { string[] array = new string[Internal_GetAvailableExtensionCount()]; for (int i = 0; i < array.Length; i++) { Internal_GetAvailableExtensionName((uint)i, out var extensionName); array[i] = extensionName ?? ""; } return array; } private static bool InvokeEvent(Func func) { if (func == null) { return true; } Delegate[] invocationList = func.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { Func func2 = (Func)invocationList[i]; try { if (!func2()) { return false; } } catch (Exception ex) { Debug.LogException(ex); } } return true; } internal static bool ShouldQuit() { return InvokeEvent(OpenXRRuntime.wantsToQuit); } internal static bool ShouldRestart() { return InvokeEvent(OpenXRRuntime.wantsToRestart); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeName")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetRuntimeName(out IntPtr runtimeNamePtr); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeVersion")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetRuntimeVersion(out ushort major, out ushort minor, out uint patch); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetAPIVersion")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetAPIVersion(out ushort major, out ushort minor, out uint patch); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetPluginVersion")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetPluginVersion(out IntPtr pluginVersionPtr); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_IsExtensionEnabled")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_IsExtensionEnabled(string extensionName); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetExtensionVersion")] private static extern uint Internal_GetExtensionVersion(string extensionName); [DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetEnabledExtensionCount")] private static extern uint Internal_GetEnabledExtensionCount(); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_GetEnabledExtensionName")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetEnabledExtensionNamePtr(uint index, out IntPtr outName); [DllImport("UnityOpenXR", EntryPoint = "session_SetSoftRestartLoopAtInitialization")] private static extern void Internal_SetSoftRestartLoopAtInitialization([MarshalAs(UnmanagedType.I1)] bool value); [DllImport("UnityOpenXR", EntryPoint = "session_GetSoftRestartLoopAtInitialization")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetSoftRestartLoopAtInitialization(); private static bool Internal_GetEnabledExtensionName(uint index, out string extensionName) { if (!Internal_GetEnabledExtensionNamePtr(index, out var outName)) { extensionName = ""; return false; } extensionName = Marshal.PtrToStringAnsi(outName); return true; } [DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetAvailableExtensionCount")] private static extern uint Internal_GetAvailableExtensionCount(); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_GetAvailableExtensionName")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetAvailableExtensionNamePtr(uint index, out IntPtr extensionName); private static bool Internal_GetAvailableExtensionName(uint index, out string extensionName) { if (!Internal_GetAvailableExtensionNamePtr(index, out var extensionName2)) { extensionName = ""; return false; } extensionName = Marshal.PtrToStringAnsi(extensionName2); return true; } [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "session_GetLastError")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetLastError(out IntPtr error); internal static bool GetLastError(out string error) { if (!Internal_GetLastError(out var error2)) { error = ""; return false; } error = Marshal.PtrToStringAnsi(error2); return true; } internal static void LogLastError() { if (GetLastError(out var error)) { Debug.LogError((object)error); } } } public static class OpenXRUtility { private const string LibraryName = "UnityOpenXR"; public static bool IsSessionFocused => Internal_IsSessionFocused(); public static bool IsUserPresent => Internal_GetUserPresence(); private static Pose Inverse(Pose p) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Pose val = default(Pose); val.rotation = Quaternion.Inverse(p.rotation); val.position = val.rotation * -p.position; return val; } public static Pose ComputePoseToWorldSpace(Transform t, Camera camera) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)camera == (Object)null) { return default(Pose); } Transform transform = ((Component)camera).transform; Pose val = default(Pose); ((Pose)(ref val))..ctor(transform.localPosition, transform.localRotation); Pose p = default(Pose); ((Pose)(ref p))..ctor(transform.position, transform.rotation); Pose val2 = default(Pose); ((Pose)(ref val2))..ctor(t.position, t.rotation); Pose transformedBy = ((Pose)(ref val2)).GetTransformedBy(Inverse(p)); return ((Pose)(ref transformedBy)).GetTransformedBy(val); } [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_IsSessionFocused")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_IsSessionFocused(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetUserPresence")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetUserPresence(); } internal sealed class WaitForRestartFinish : CustomYieldInstruction { private float m_Timeout; public override bool keepWaiting { get { if (!OpenXRRestarter.Instance.isRunning) { return false; } if (Time.realtimeSinceStartup > m_Timeout) { Debug.LogError((object)"WaitForRestartFinish: Timeout"); return false; } return true; } } public WaitForRestartFinish(float timeout = 5f) { m_Timeout = Time.realtimeSinceStartup + timeout; } } } namespace UnityEngine.XR.OpenXR.API { public enum UnityXRRenderTextureFormat { kUnityXRRenderTextureFormatRGBA32 = 0, kUnityXRRenderTextureFormatBGRA32 = 1, kUnityXRRenderTextureFormatRGB565 = 2, kUnityXRRenderTextureFormatR16G16B16A16_SFloat = 3, kUnityXRRenderTextureFormatRGBA1010102 = 4, kUnityXRRenderTextureFormatBGRA1010102 = 5, kUnityXRRenderTextureFormatR11G11B10_UFloat = 6, kUnityXRRenderTextureFormatReference = 64, kUnityXRRenderTextureFormatSoftReferenceMSAA = 65, kUnityXRRenderTextureFormatNone = 66 } public struct UnityXRTextureData { public IntPtr nativePtr; public uint referenceTextureId; } public enum UnityXRDepthTextureFormat { kUnityXRDepthTextureFormat24bitOrGreater, kUnityXRDepthTextureFormat16bit, kUnityXRDepthTextureFormatReference, kUnityXRDepthTextureFormatNone } public enum UnityXRShadingRateFormat { kUnityXRShadingRateFormatNone, kUnityXRShadingRateR8G8 } public enum UnityXRRenderTextureFlags { kUnityXRRenderTextureFlagsUVDirectionTopToBottom = 1, kUnityXRRenderTextureFlagsMultisampleAutoResolve = 2, kUnityXRRenderTextureFlagsLockedWidthHeight = 4, kUnityXRRenderTextureFlagsWriteOnly = 8, kUnityXRRenderTextureFlagsSRGB = 0x10, kUnityXRRenderTextureFlagsOptimizeBufferDiscards = 0x20, kUnityXRRenderTextureFlagsMotionVectorTexture = 0x40, kUnityXRRenderTextureFlagsFoveationOffset = 0x80, kUnityXRRenderTextureFlagsViewportAsRenderArea = 0x100, kUnityXRRenderTextureFlagsHDR = 0x200 } public struct UnityXRRenderTextureDesc { public UnityXRRenderTextureFormat colorFormat; public UnityXRTextureData color; public UnityXRDepthTextureFormat depthFormat; public UnityXRTextureData depth; public UnityXRShadingRateFormat shadingRateFormat; public UnityXRTextureData shadingRate; public uint width; public uint height; public uint textureArrayLength; public uint flags; } public static class UnityXRDisplay { public const uint kUnityXRRenderTextureIdDontCare = 0u; private const string k_UnityOpenXRLib = "UnityOpenXR"; [DllImport("UnityOpenXR", EntryPoint = "Display_CreateTexture")] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CreateTexture(UnityXRRenderTextureDesc desc, out uint id); } } namespace UnityEngine.XR.OpenXR.NativeTypes { public enum XrEnvironmentBlendMode { Opaque = 1, Additive, AlphaBlend } public enum XrResult { Success = 0, [Obsolete("This value is misspelled and therefore deprecated in OpenXR Plug-in version 1.14.0. Use TimeoutExpired instead.", false)] TimeoutExpored = 1, TimeoutExpired = 1, LossPending = 3, EventUnavailable = 4, SpaceBoundsUnavailable = 7, SessionNotFocused = 8, FrameDiscarded = 9, ValidationFailure = -1, RuntimeFailure = -2, OutOfMemory = -3, ApiVersionUnsupported = -4, InitializationFailed = -6, FunctionUnsupported = -7, FeatureUnsupported = -8, ExtensionNotPresent = -9, LimitReached = -10, SizeInsufficient = -11, HandleInvalid = -12, InstanceLost = -13, SessionRunning = -14, SessionNotRunning = -16, SessionLost = -17, SystemInvalid = -18, PathInvalid = -19, PathCountExceeded = -20, PathFormatInvalid = -21, PathUnsupported = -22, LayerInvalid = -23, LayerLimitExceeded = -24, SwapchainRectInvalid = -25, SwapchainFormatUnsupported = -26, ActionTypeMismatch = -27, SessionNotReady = -28, SessionNotStopping = -29, TimeInvalid = -30, ReferenceSpaceUnsupported = -31, FileAccessError = -32, FileContentsInvalid = -33, FormFactorUnsupported = -34, FormFactorUnavailable = -35, ApiLayerNotPresent = -36, CallOrderInvalid = -37, GraphicsDeviceInvalid = -38, PoseInvalid = -39, IndexOutOfRange = -40, ViewConfigurationTypeUnsupported = -41, EnvironmentBlendModeUnsupported = -42, NameDuplicated = -44, NameInvalid = -45, ActionsetNotAttached = -46, ActionsetsAlreadyAttached = -47, LocalizedNameDuplicated = -48, LocalizedNameInvalid = -49, GraphicsRequirementsCallMissing = -50, RuntimeUnavailable = -51, ExtensionDependencyNotEnabled = -1000710001, PermissionInsufficient = -1000710000, AndroidThreadSettingsIdInvalidKHR = -1000003000, [Obsolete("This enum value is misspelled and therefore deprecated in OpenXR Plug-in version 1.14.0. Use AndroidThreadSettingsFailureKHR instead.", false)] AndroidThreadSettingsdFailureKHR = -1000003001, AndroidThreadSettingsFailureKHR = -1000003001, CreateSpatialAnchorFailedMSFT = -1000039001, SecondaryViewConfigurationTypeNotEnabledMSFT = -1000053000, ControllerModelKeyInvalidMSFT = -1000055000, ReprojectionModeUnsupportedMSFT = -1000066000, ComputeNewSceneNotCompletedMSFT = -1000097000, SceneComponentIdInvalidMSFT = -1000097001, SceneComponentTypeMismatchMSFT = -1000097002, SceneMeshBufferIdInvalidMSFT = -1000097003, SceneComputeFeatureIncompatibleMSFT = -1000097004, SceneComputeConsistencyMismatchMSFT = -1000097005, DisplayRefreshRateUnsupportedFB = -1000101000, ColorSpaceUnsupportedFB = -1000108000, SpaceComponentNotSupportedFB = -1000113000, SpaceComponentNotEnabledFB = -1000113001, SpaceComponentStatusPendingFB = -1000113002, SpaceComponentStatusAlreadySetFB = -1000113003, UnexpectedStatePassthroughFB = -1000118000, FeatureAlreadyCreatedPassthroughFB = -1000118001, FeatureRequiredPassthroughFB = -1000118002, NotPermittedPassthroughFB = -1000118003, InsufficientResourcesPassthroughFB = -1000118004, UnknownPassthroughFB = -1000118050, RenderModelKeyInvalidFB = -1000119000, RenderModelUnavailableFB = 1000119020, MarkerNotTrackedVARJO = -1000124000, MarkerIdInvalidVARJO = -1000124001, MarkerDetectorPermissionDeniedML = -1000138000, MarkerDetectorLocateFailedML = -1000138001, MarkerDetectorInvalidDataQueryML = -1000138002, MarkerDetectorInvalidCreateInfoML = -1000138003, MarkerInvalidML = -1000138004, LocalizationMapIncompatibleML = -1000139000, LocalizationMapUnavailableML = -1000139001, LocalizationMapFailML = -1000139002, LocalizationMapImportExportPermissionDeniedML = -1000139003, LocalizationMapPermissionDeniedML = -1000139004, LocalizationMapAlreadyExistsML = -1000139005, LocalizationMapCannotExportCloudMapML = -1000139006, SpatialAnchorNameNotFoundMSFT = -1000142001, SpatialAnchorNameInvalidMSFT = -1000142002, SceneMarkerDataNotStringMSFT = 1000147000, SpaceMappingInsufficientFB = -1000169000, SpaceLocalizationFailedFB = -1000169001, SpaceNetworkTimeoutFB = -1000169002, SpaceNetworkRequestFailedFB = -1000169003, SpaceCloudStorageDisabledFB = -1000169004, PassthroughColorLutBufferSizeMismatchMETA = -1000266000, EnvironmentDepthNotAvailableMETA = 1000291000, HintAlreadySetQCOM = -1000306000, NotAnAnchorHTC = -1000319000, SpaceNotLocatableEXT = -1000429000, PlaneDetectionPermissionDeniedEXT = -1000429001, FuturePendingEXT = -1000469001, FutureInvalidEXT = -1000469002, ExtensionDependencyNotEnabledKHR = -1000710001, PermissionInsufficientKHR = -1000710000, MaxResult = int.MaxValue } public static class XrResultExtensions { public static bool IsSuccess(this XrResult xrResult) { return xrResult >= XrResult.Success; } public static bool IsUnqualifiedSuccess(this XrResult xrResult) { return xrResult == XrResult.Success; } public static bool IsError(this XrResult xrResult) { return xrResult < XrResult.Success; } } public enum XrViewConfigurationType { PrimaryMono = 1, PrimaryStereo = 2, PrimaryQuadVarjo = 1000037000, SecondaryMonoFirstPersonObserver = 1000054000, SecondaryMonoThirdPersonObserver = 1000145000 } [Flags] public enum XrSpaceLocationFlags { None = 0, OrientationValid = 1, PositionValid = 2, OrientationTracked = 4, PositionTracked = 8 } [Flags] public enum XrViewStateFlags { None = 0, OrientationValid = 1, PositionValid = 2, OrientationTracked = 4, PositionTracked = 8 } [Flags] public enum XrReferenceSpaceType { View = 1, Local = 2, Stage = 3, UnboundedMsft = 0x3B9B5E70, CombinedEyeVarjo = 0x3B9CA2A8 } public enum XrSessionState { Unknown, Idle, Ready, Synchronized, Visible, Focused, Stopping, LossPending, Exiting } public enum XrStructureType : uint { XR_TYPE_UNKNOWN = 0u, XR_TYPE_SWAPCHAIN_CREATE_INFO = 9u, XR_TYPE_COMPOSITION_LAYER_PROJECTION = 35u, XR_TYPE_COMPOSITION_LAYER_QUAD = 36u, XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW = 48u, XR_TYPE_COMPOSITION_LAYER_CUBE_KHR = 1000006000u, XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR = 1000017000u, XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR = 1000018000u, XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR = 1000091000u } [Flags] public enum XrSwapchainUsageFlags : ulong { XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT = 1uL, XR_SWAPCHAIN_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 2uL, XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT = 4uL, XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT = 8uL, XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT = 0x10uL, XR_SWAPCHAIN_USAGE_SAMPLED_BIT = 0x20uL, XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT = 0x40uL, XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND = 0x80uL, XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_KHR = 0x80uL } internal struct XrBaseInStructure { public uint Type; public unsafe void* Next; } public struct XrVector2f { public float X; public float Y; public XrVector2f(float x, float y) { X = x; Y = y; } public XrVector2f(Vector2 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) X = value.x; Y = value.y; } } public struct XrVector3f { public float X; public float Y; public float Z; public XrVector3f(float x, float y, float z) { X = x; Y = y; Z = 0f - z; } public XrVector3f(Vector3 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) X = value.x; Y = value.y; Z = 0f - value.z; } } public struct XrQuaternionf { public float X; public float Y; public float Z; public float W; public XrQuaternionf(float x, float y, float z, float w) { X = 0f - x; Y = 0f - y; Z = z; W = w; } public XrQuaternionf(Quaternion quaternion) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) X = 0f - quaternion.x; Y = 0f - quaternion.y; Z = quaternion.z; W = quaternion.w; } } public struct XrPosef { public XrQuaternionf Orientation; public XrVector3f Position; public XrPosef(Vector3 vec3, Quaternion quaternion) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Position = new XrVector3f(vec3); Orientation = new XrQuaternionf(quaternion); } } public struct XrSwapchainCreateInfo { public uint Type; public unsafe void* Next; public ulong CreateFlags; public ulong UsageFlags; public long Format; public uint SampleCount; public uint Width; public uint Height; public uint FaceCount; public uint ArraySize; public uint MipCount; } } namespace UnityEngine.XR.OpenXR.Input { [StructLayout(LayoutKind.Sequential, Size = 1)] public struct Haptic { } [Preserve] public class HapticControl : InputControl { public HapticControl() { ((InputStateBlock)(ref ((InputControl)this).m_StateBlock)).sizeInBits = 1u; ((InputStateBlock)(ref ((InputControl)this).m_StateBlock)).bitOffset = 0u; ((InputStateBlock)(ref ((InputControl)this).m_StateBlock)).byteOffset = 0u; } public unsafe override Haptic ReadUnprocessedValueFromState(void* statePtr) { return default(Haptic); } } [Preserve] [InputControlLayout(displayName = "OpenXR Action Map")] public abstract class OpenXRDevice : InputDevice { protected override void FinishSetup() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) ((InputControl)this).FinishSetup(); InputDeviceDescription description = ((InputDevice)this).description; XRDeviceDescriptor val = XRDeviceDescriptor.FromJson(((InputDeviceDescription)(ref description)).capabilities); if (val != null) { if ((val.characteristics & 0x100) != 0) { InputSystem.SetDeviceUsage((InputDevice)(object)this, CommonUsages.LeftHand); } else if ((val.characteristics & 0x200) != 0) { InputSystem.SetDeviceUsage((InputDevice)(object)this, CommonUsages.RightHand); } } } } [Preserve] [InputControlLayout(displayName = "OpenXR HMD")] internal class OpenXRHmd : XRHMD { [Preserve] [InputControl] private ButtonControl userPresence { get; set; } protected override void FinishSetup() { ((XRHMD)this).FinishSetup(); userPresence = ((InputControl)this).GetChildControl("UserPresence"); } } public static class OpenXRInput { [StructLayout(LayoutKind.Explicit)] private struct SerializedGuid { [FieldOffset(0)] public Guid guid; [FieldOffset(0)] public ulong ulong1; [FieldOffset(8)] public ulong ulong2; } internal struct SerializedBinding { public ulong actionId; public string path; } [Flags] public enum InputSourceNameFlags { UserPath = 1, InteractionProfile = 2, Component = 4, All = 7 } [StructLayout(LayoutKind.Explicit, Size = 12)] private struct GetInternalDeviceIdCommand : IInputDeviceCommandInfo { private const int k_BaseCommandSizeSize = 8; private const int k_Size = 12; [FieldOffset(0)] private InputDeviceCommand baseCommand; [FieldOffset(8)] public readonly uint deviceId; private static FourCC Type => new FourCC('X', 'R', 'D', 'I'); public FourCC typeStatic => Type; public static GetInternalDeviceIdCommand Create() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) return new GetInternalDeviceIdCommand { baseCommand = new InputDeviceCommand(Type, 12) }; } } private static readonly Dictionary ExpectedControlTypeToActionType = new Dictionary { ["Digital"] = OpenXRInteractionFeature.ActionType.Binary, ["Button"] = OpenXRInteractionFeature.ActionType.Binary, ["Axis"] = OpenXRInteractionFeature.ActionType.Axis1D, ["Integer"] = OpenXRInteractionFeature.ActionType.Axis1D, ["Analog"] = OpenXRInteractionFeature.ActionType.Axis1D, ["Vector2"] = OpenXRInteractionFeature.ActionType.Axis2D, ["Dpad"] = OpenXRInteractionFeature.ActionType.Axis2D, ["Stick"] = OpenXRInteractionFeature.ActionType.Axis2D, ["Pose"] = OpenXRInteractionFeature.ActionType.Pose, ["Vector3"] = OpenXRInteractionFeature.ActionType.Pose, ["Quaternion"] = OpenXRInteractionFeature.ActionType.Pose, ["Haptic"] = OpenXRInteractionFeature.ActionType.Vibrate }; private const string s_devicePoseActionName = "devicepose"; private const string s_pointerActionName = "pointer"; private static readonly Dictionary kVirtualControlMap = new Dictionary { ["deviceposition"] = "devicepose", ["devicerotation"] = "devicepose", ["trackingstate"] = "devicepose", ["istracked"] = "devicepose", ["pointerposition"] = "pointer", ["pointerrotation"] = "pointer" }; private const string Library = "UnityOpenXR"; internal static void RegisterLayouts() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) InputSystem.RegisterLayout("Haptic", (InputDeviceMatcher?)null); InputSystem.RegisterLayout("Pose", (InputDeviceMatcher?)null); InputSystem.RegisterLayout((string)null, (InputDeviceMatcher?)null); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); val = ((InputDeviceMatcher)(ref val)).WithProduct("Head Tracking - OpenXR", true); InputSystem.RegisterLayout((string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithManufacturer("OpenXR", true)); OpenXRInteractionFeature.RegisterLayouts(); } private static bool ValidateActionMapConfig(OpenXRInteractionFeature interactionFeature, OpenXRInteractionFeature.ActionMapConfig actionMapConfig) { bool result = true; if (actionMapConfig.deviceInfos == null || actionMapConfig.deviceInfos.Count == 0) { Debug.LogError((object)$"ActionMapConfig contains no `deviceInfos` in InteractionFeature '{((object)interactionFeature).GetType()}'"); result = false; } if (actionMapConfig.actions == null || actionMapConfig.actions.Count == 0) { Debug.LogError((object)$"ActionMapConfig contains no `actions` in InteractionFeature '{((object)interactionFeature).GetType()}'"); result = false; } return result; } internal static void AttachActionSets() { List list = new List(); List list2 = new List(); foreach (OpenXRInteractionFeature item in from f in OpenXRSettings.Instance.features.OfType() where f.enabled && !f.IsAdditive select f) { int count = list.Count; item.CreateActionMaps(list); for (int num = list.Count - 1; num >= count; num--) { if (!ValidateActionMapConfig(item, list[num])) { list.RemoveAt(num); } } } if (!RegisterDevices(list, isAdditive: false)) { return; } foreach (OpenXRInteractionFeature item2 in from f in OpenXRSettings.Instance.features.OfType() where f.enabled && f.IsAdditive select f) { item2.CreateActionMaps(list2); item2.AddAdditiveActions(list, list2[list2.Count - 1]); } Dictionary> dictionary = new Dictionary>(); if (!CreateActions(list, dictionary)) { return; } if (list2.Count > 0) { RegisterDevices(list2, isAdditive: true); CreateActions(list2, dictionary); } SetDpadBindingCustomValues(); foreach (KeyValuePair> item3 in dictionary) { if (!Internal_SuggestBindings(item3.Key, item3.Value.ToArray(), (uint)item3.Value.Count)) { OpenXRRuntime.LogLastError(); } } if (!Internal_AttachActionSets()) { OpenXRRuntime.LogLastError(); } } private static bool RegisterDevices(List actionMaps, bool isAdditive) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected I4, but got Unknown foreach (OpenXRInteractionFeature.ActionMapConfig actionMap in actionMaps) { foreach (OpenXRInteractionFeature.DeviceConfig deviceInfo in actionMap.deviceInfos) { string name = ((actionMap.desiredInteractionProfile == null) ? UserPathToDeviceName(deviceInfo.userPath) : actionMap.localizedName); if (Internal_RegisterDeviceDefinition(deviceInfo.userPath, actionMap.desiredInteractionProfile, isAdditive, (uint)(int)deviceInfo.characteristics, name, actionMap.manufacturer, actionMap.serialNumber) == 0L) { OpenXRRuntime.LogLastError(); return false; } } } return true; } private static bool CreateActions(List actionMaps, Dictionary> interactionProfiles) { foreach (OpenXRInteractionFeature.ActionMapConfig actionMap in actionMaps) { string localizedName = SanitizeStringForOpenXRPath(actionMap.localizedName); ulong num = Internal_CreateActionSet(SanitizeStringForOpenXRPath(actionMap.name), localizedName, default(SerializedGuid)); if (num == 0L) { OpenXRRuntime.LogLastError(); return false; } List list = actionMap.deviceInfos.Select((OpenXRInteractionFeature.DeviceConfig d) => d.userPath).ToList(); foreach (OpenXRInteractionFeature.ActionConfig action in actionMap.actions) { string[] array = action.bindings.Where((OpenXRInteractionFeature.ActionBinding b) => b.userPaths != null).SelectMany((OpenXRInteractionFeature.ActionBinding b) => b.userPaths).Distinct() .ToList() .Union(list) .ToArray(); ulong num2 = Internal_CreateAction(num, SanitizeStringForOpenXRPath(action.name), action.localizedName, (uint)action.type, default(SerializedGuid), array, (uint)array.Length, action.isAdditive, action.usages?.ToArray(), (uint)(action.usages?.Count ?? 0)); if (num2 == 0L) { OpenXRRuntime.LogLastError(); return false; } foreach (OpenXRInteractionFeature.ActionBinding binding in action.bindings) { foreach (string item in binding.userPaths ?? list) { string key = (action.isAdditive ? actionMap.desiredInteractionProfile : (binding.interactionProfileName ?? actionMap.desiredInteractionProfile)); if (!interactionProfiles.TryGetValue(key, out var value)) { value = (interactionProfiles[key] = new List()); } value.Add(new SerializedBinding { actionId = num2, path = item + binding.interactionPath }); } } } } return true; } private static void SetDpadBindingCustomValues() { DPadInteraction feature = OpenXRSettings.Instance.GetFeature(); if ((Object)(object)feature != (Object)null && feature.enabled) { Internal_SetDpadBindingCustomValues(isLeft: true, feature.forceThresholdLeft, feature.forceThresholdReleaseLeft, feature.centerRegionLeft, feature.wedgeAngleLeft, feature.isStickyLeft); Internal_SetDpadBindingCustomValues(isLeft: false, feature.forceThresholdRight, feature.forceThresholdReleaseRight, feature.centerRegionRight, feature.wedgeAngleRight, feature.isStickyRight); } } private static char SanitizeCharForOpenXRPath(char c) { if (char.IsLower(c) || char.IsDigit(c)) { return c; } if (char.IsUpper(c)) { return char.ToLower(c); } if (c == '-' || c == '.' || c == '_' || c == '/') { return c; } return '\0'; } private static string SanitizeStringForOpenXRPath(string input) { if (string.IsNullOrEmpty(input)) { return ""; } int i; for (i = 0; i < input.Length && SanitizeCharForOpenXRPath(input[i]) == input[i]; i++) { } if (i == input.Length) { return input; } StringBuilder stringBuilder = new StringBuilder(input, 0, i, input.Length); for (; i < input.Length; i++) { char c = SanitizeCharForOpenXRPath(input[i]); if (c != 0) { stringBuilder.Append(c); } } return stringBuilder.ToString(); } private static string GetActionHandleName(InputControl control) { InputControl val = control; while (val.parent != null && val.parent.parent != null) { val = val.parent; } string text = SanitizeStringForOpenXRPath(val.name); if (kVirtualControlMap.TryGetValue(text, out var value)) { return value; } return text; } public static void SendHapticImpulse(InputActionReference actionRef, float amplitude, float duration, InputDevice inputDevice = null) { SendHapticImpulse(actionRef, amplitude, 0f, duration, inputDevice); } public static void SendHapticImpulse(InputActionReference actionRef, float amplitude, float frequency, float duration, InputDevice inputDevice = null) { SendHapticImpulse(actionRef.action, amplitude, frequency, duration, inputDevice); } public static void SendHapticImpulse(InputAction action, float amplitude, float duration, InputDevice inputDevice = null) { SendHapticImpulse(action, amplitude, 0f, duration, inputDevice); } public static void SendHapticImpulse(InputAction action, float amplitude, float frequency, float duration, InputDevice inputDevice = null) { if (action != null) { ulong actionHandle = GetActionHandle(action, inputDevice); if (actionHandle != 0L) { amplitude = Mathf.Clamp(amplitude, 0f, 1f); duration = Mathf.Max(duration, 0f); Internal_SendHapticImpulse(GetDeviceId(inputDevice), actionHandle, amplitude, frequency, duration); } } } public static void StopHaptics(InputActionReference actionRef, InputDevice inputDevice = null) { if (!((Object)(object)actionRef == (Object)null)) { StopHaptics(actionRef.action, inputDevice); } } public static void SendHapticImpulse(InputDevice device, float amplitude, float frequency, float duration) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (((InputDevice)(ref device)).isValid) { Internal_SendHapticImpulseNoISX(GetDeviceId(device), amplitude, frequency, duration); } } public static void StopHapticImpulse(InputDevice device) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (((InputDevice)(ref device)).isValid) { Internal_StopHapticsNoISX(GetDeviceId(device)); } } public static void StopHaptics(InputAction inputAction, InputDevice inputDevice = null) { if (inputAction != null) { ulong actionHandle = GetActionHandle(inputAction, inputDevice); if (actionHandle != 0L) { Internal_StopHaptics(GetDeviceId(inputDevice), actionHandle); } } } public static bool TryGetInputSourceName(InputAction inputAction, int index, out string name, InputSourceNameFlags flags = InputSourceNameFlags.All, InputDevice inputDevice = null) { name = ""; if (index < 0) { return false; } ulong actionHandle = GetActionHandle(inputAction, inputDevice); if (actionHandle == 0L) { return false; } return Internal_TryGetInputSourceName(GetDeviceId(inputDevice), actionHandle, (uint)index, (uint)flags, out name); } public static bool GetActionIsActive(InputAction inputAction) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (inputAction != null && inputAction.controls.Count > 0 && inputAction.controls[0].device != null) { for (int i = 0; i < inputAction.controls.Count; i++) { uint deviceId = GetDeviceId(inputAction.controls[i].device); if (deviceId != 0) { string actionHandleName = GetActionHandleName(inputAction.controls[i]); if (Internal_GetActionIsActive(deviceId, actionHandleName)) { return true; } } } } return false; } public static bool GetActionIsActive(InputDevice device, InputFeatureUsage usage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return GetActionIsActive(device, ((InputFeatureUsage)(ref usage)).name); } public static bool GetActionIsActive(InputDevice device, string usageName) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) uint deviceId = GetDeviceId(device); if (deviceId == 0) { return false; } return Internal_GetActionIsActiveNoISX(deviceId, usageName); } public static bool TrySetControllerLateLatchAction(InputAction inputAction) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (inputAction == null || inputAction.controls.Count != 1) { return false; } if (inputAction.controls[0].device == null) { return false; } uint deviceId = GetDeviceId(inputAction.controls[0].device); if (deviceId == 0) { return false; } ulong actionHandle = GetActionHandle(inputAction); if (actionHandle == 0L) { return false; } return Internal_TrySetControllerLateLatchAction(deviceId, actionHandle); } public static bool TrySetControllerLateLatchAction(InputDevice device, InputFeatureUsage usage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return TrySetControllerLateLatchAction(device, ((InputFeatureUsage)(ref usage)).name); } public static bool TrySetControllerLateLatchAction(InputDevice device, string usageName) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) uint deviceId = GetDeviceId(device); if (deviceId == 0) { return false; } ulong actionHandle = GetActionHandle(device, usageName); if (actionHandle == 0L) { return false; } return Internal_TrySetControllerLateLatchAction(deviceId, actionHandle); } public static ulong GetActionHandle(InputDevice device, InputFeatureUsage usage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return GetActionHandle(device, ((InputFeatureUsage)(ref usage)).name); } public static ulong GetActionHandle(InputDevice device, string usageName) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) uint deviceId = GetDeviceId(device); if (deviceId == 0) { return 0uL; } return Internal_GetActionIdNoISX(deviceId, usageName); } public static ulong GetActionHandle(InputAction inputAction, InputDevice inputDevice = null) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (inputAction == null || inputAction.controls.Count == 0) { return 0uL; } Enumerator enumerator = inputAction.controls.GetEnumerator(); try { while (enumerator.MoveNext()) { InputControl current = enumerator.Current; if ((inputDevice != null && current.device != inputDevice) || current.device == null) { continue; } uint deviceId = GetDeviceId(current.device); if (deviceId != 0) { string actionHandleName = GetActionHandleName(current); ulong num = Internal_GetActionId(deviceId, actionHandleName); if (num != 0L) { return num; } } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } return 0uL; } private static uint GetDeviceId(InputDevice inputDevice) { if (inputDevice == null) { return 0u; } GetInternalDeviceIdCommand getInternalDeviceIdCommand = GetInternalDeviceIdCommand.Create(); if (inputDevice.ExecuteCommand(ref getInternalDeviceIdCommand) != 0L) { return getInternalDeviceIdCommand.deviceId; } return 0u; } private static uint GetDeviceId(InputDevice inputDevice) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Internal_GetDeviceId(((InputDevice)(ref inputDevice)).characteristics, ((InputDevice)(ref inputDevice)).name); } private static string UserPathToDeviceName(string userPath) { string[] array = userPath.Split('/', '_'); StringBuilder stringBuilder = new StringBuilder("OXR"); string[] array2 = array; foreach (string text in array2) { if (text.Length != 0) { string text2 = SanitizeStringForOpenXRPath(text); stringBuilder.Append(char.ToUpper(text2[0])); stringBuilder.Append(text2.Substring(1)); } } return stringBuilder.ToString(); } [DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_SetDpadBindingCustomValues")] private static extern void Internal_SetDpadBindingCustomValues([MarshalAs(UnmanagedType.I1)] bool isLeft, float forceThreshold, float forceThresholdReleased, float centerRegion, float wedgeAngle, [MarshalAs(UnmanagedType.I1)] bool isSticky); [DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_SendHapticImpulse")] private static extern void Internal_SendHapticImpulse(uint deviceId, ulong actionId, float amplitude, float frequency, float duration); [DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_SendHapticImpulseNoISX")] private static extern void Internal_SendHapticImpulseNoISX(uint deviceId, float amplitude, float frequency, float duration); [DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_StopHaptics")] private static extern void Internal_StopHaptics(uint deviceId, ulong actionId); [DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_StopHapticsNoISX")] private static extern void Internal_StopHapticsNoISX(uint deviceId); [DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetActionIdByControl")] private static extern ulong Internal_GetActionId(uint deviceId, string name); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_GetActionIdByUsageName")] private static extern ulong Internal_GetActionIdNoISX(uint deviceId, string usageName); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_TryGetInputSourceName")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_TryGetInputSourceNamePtr(uint deviceId, ulong actionId, uint index, uint flags, out IntPtr outName); internal static bool Internal_TryGetInputSourceName(uint deviceId, ulong actionId, uint index, uint flags, out string outName) { if (!Internal_TryGetInputSourceNamePtr(deviceId, actionId, index, flags, out var outName2)) { outName = ""; return false; } outName = Marshal.PtrToStringAnsi(outName2); return true; } [DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_TrySetControllerLateLatchAction")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_TrySetControllerLateLatchAction(uint deviceId, ulong actionId); [DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetActionIsActive")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetActionIsActive(uint deviceId, string name); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_GetActionIsActiveNoISX")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetActionIsActiveNoISX(uint deviceId, string name); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_RegisterDeviceDefinition")] private static extern ulong Internal_RegisterDeviceDefinition(string userPath, string interactionProfile, [MarshalAs(UnmanagedType.I1)] bool isAdditive, uint characteristics, string name, string manufacturer, string serialNumber); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_CreateActionSet")] private static extern ulong Internal_CreateActionSet(string name, string localizedName, SerializedGuid guid); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_CreateAction")] private static extern ulong Internal_CreateAction(ulong actionSetId, string name, string localizedName, uint actionType, SerializedGuid guid, string[] userPaths, uint userPathCount, [MarshalAs(UnmanagedType.I1)] bool isAdditive, string[] usages, uint usageCount); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_SuggestBindings")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_SuggestBindings(string interactionProfile, SerializedBinding[] serializedBindings, uint serializedBindingCount); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_AttachActionSets")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_AttachActionSets(); [DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_GetDeviceId")] private static extern uint Internal_GetDeviceId(InputDeviceCharacteristics characteristics, string name); } public struct Pose { public bool isTracked { get; set; } public InputTrackingState trackingState { get; set; } public Vector3 position { get; set; } public Quaternion rotation { get; set; } public Vector3 velocity { get; set; } public Vector3 angularVelocity { get; set; } } public class PoseControl : InputControl { [Preserve] [InputControl(offset = 0u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 4u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 8u, noisy = true)] public Vector3Control position { get; private set; } [Preserve] [InputControl(offset = 20u, noisy = true)] public QuaternionControl rotation { get; private set; } [Preserve] [InputControl(offset = 36u, noisy = true)] public Vector3Control velocity { get; private set; } [Preserve] [InputControl(offset = 48u, noisy = true)] public Vector3Control angularVelocity { get; private set; } protected override void FinishSetup() { isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); position = ((InputControl)this).GetChildControl("position"); rotation = ((InputControl)this).GetChildControl("rotation"); velocity = ((InputControl)this).GetChildControl("velocity"); angularVelocity = ((InputControl)this).GetChildControl("angularVelocity"); base.FinishSetup(); } public unsafe override Pose ReadUnprocessedValueFromState(void* statePtr) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) return new Pose { isTracked = (((InputControl)(object)isTracked).ReadUnprocessedValueFromState(statePtr) > 0.5f), trackingState = (InputTrackingState)((InputControl)(object)trackingState).ReadUnprocessedValueFromState(statePtr), position = ((InputControl)(object)position).ReadUnprocessedValueFromState(statePtr), rotation = ((InputControl)(object)rotation).ReadUnprocessedValueFromState(statePtr), velocity = ((InputControl)(object)velocity).ReadUnprocessedValueFromState(statePtr), angularVelocity = ((InputControl)(object)angularVelocity).ReadUnprocessedValueFromState(statePtr) }; } public unsafe override void WriteValueIntoState(Pose value, void* statePtr) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected I4, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) InputControlExtensions.WriteValueIntoState((InputControl)(object)isTracked, value.isTracked, statePtr); InputControlExtensions.WriteValueIntoState((InputControl)(object)trackingState, (uint)(int)value.trackingState, statePtr); ((InputControl)(object)position).WriteValueIntoState(value.position, statePtr); ((InputControl)(object)rotation).WriteValueIntoState(value.rotation, statePtr); ((InputControl)(object)velocity).WriteValueIntoState(value.velocity, statePtr); ((InputControl)(object)angularVelocity).WriteValueIntoState(value.angularVelocity, statePtr); } } } namespace UnityEngine.XR.OpenXR.Features { public class FoveatedRenderingFeature : OpenXRFeature { public const string featureId = "com.unity.openxr.feature.foveatedrendering"; private const string Library = "UnityOpenXR"; protected internal override bool OnInstanceCreate(ulong instance) { Internal_Unity_SetUseFoveatedRenderingLegacyMode((Object)(object)GraphicsSettings.defaultRenderPipeline == (Object)null); return base.OnInstanceCreate(instance); } protected internal override IntPtr HookGetInstanceProcAddr(IntPtr func) { return Internal_Unity_intercept_xrGetInstanceProcAddr(func); } [DllImport("UnityOpenXR", EntryPoint = "UnityFoveation_intercept_xrGetInstanceProcAddr")] private static extern IntPtr Internal_Unity_intercept_xrGetInstanceProcAddr(IntPtr func); [DllImport("UnityOpenXR", EntryPoint = "UnityFoveation_SetUseFoveatedRenderingLegacyMode")] private static extern void Internal_Unity_SetUseFoveatedRenderingLegacyMode([MarshalAs(UnmanagedType.I1)] bool value); [DllImport("UnityOpenXR", EntryPoint = "UnityFoveation_GetUseFoveatedRenderingLegacyMode")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_Unity_GetUseFoveatedRenderingLegacyMode(); } [Serializable] public abstract class OpenXRFeature : ScriptableObject { internal enum LoaderEvent { SubsystemCreate, SubsystemDestroy, SubsystemStart, SubsystemStop } internal enum NativeEvent { XrSetupConfigValues, XrSystemIdChanged, XrInstanceChanged, XrSessionChanged, XrBeginSession, XrSessionStateChanged, XrChangedSpaceApp, XrEndSession, XrDestroySession, XrDestroyInstance, XrIdle, XrReady, XrSynchronized, XrVisible, XrFocused, XrStopping, XrExiting, XrLossPending, XrInstanceLossPending, XrRestartRequested, XrRequestRestartLoop, XrRequestGetSystemLoop } [Flags] protected internal enum StatFlags { StatOptionNone = 0, ClearOnUpdate = 1, All = 1 } [FormerlySerializedAs("enabled")] [HideInInspector] [SerializeField] private bool m_enabled; [HideInInspector] [SerializeField] internal string nameUi; [HideInInspector] [SerializeField] internal string version; [HideInInspector] [SerializeField] internal string featureIdInternal; [HideInInspector] [SerializeField] internal string openxrExtensionStrings; [HideInInspector] [SerializeField] internal string company; [HideInInspector] [SerializeField] internal int priority; [HideInInspector] [SerializeField] internal bool required; [NonSerialized] internal bool internalFieldsUpdated; private const string Library = "UnityOpenXR"; internal bool failedInitialization { get; private set; } internal static bool requiredFeatureFailed { get; private set; } public bool enabled { get { if (m_enabled) { if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null)) { return !failedInitialization; } return true; } return false; } set { if (enabled != value) { if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null) { Debug.LogError((object)"OpenXRFeature.enabled cannot be changed while OpenXR is running"); return; } m_enabled = value; OnEnabledChange(); } } } protected static IntPtr xrGetInstanceProcAddr => Internal_GetProcAddressPtr(loaderDefault: false); protected internal virtual IntPtr HookGetInstanceProcAddr(IntPtr func) { return func; } protected internal virtual void OnSubsystemCreate() { } protected internal virtual void OnSubsystemStart() { } protected internal virtual void OnSubsystemStop() { } protected internal virtual void OnSubsystemDestroy() { } protected internal virtual bool OnInstanceCreate(ulong xrInstance) { return true; } protected internal virtual void OnSystemChange(ulong xrSystem) { } protected internal virtual void OnSessionCreate(ulong xrSession) { } protected internal virtual void OnAppSpaceChange(ulong xrSpace) { } protected internal virtual void OnSessionStateChange(int oldState, int newState) { } protected internal virtual void OnSessionBegin(ulong xrSession) { } protected internal virtual void OnSessionEnd(ulong xrSession) { } protected internal virtual void OnSessionExiting(ulong xrSession) { } protected internal virtual void OnSessionDestroy(ulong xrSession) { } protected internal virtual void OnInstanceDestroy(ulong xrInstance) { } protected internal virtual void OnSessionLossPending(ulong xrSession) { } protected internal virtual void OnInstanceLossPending(ulong xrInstance) { } protected internal virtual void OnFormFactorChange(int xrFormFactor) { } protected internal virtual void OnViewConfigurationTypeChange(int xrViewConfigurationType) { } protected internal virtual void OnEnvironmentBlendModeChange(XrEnvironmentBlendMode xrEnvironmentBlendMode) { } protected internal virtual void OnEnabledChange() { } protected static string PathToString(ulong path) { if (!Internal_PathToStringPtr(path, out var path2)) { return null; } return Marshal.PtrToStringAnsi(path2); } protected static ulong StringToPath(string str) { if (!Internal_StringToPath(str, out var pathId)) { return 0uL; } return pathId; } protected static ulong GetCurrentInteractionProfile(ulong userPath) { if (!Internal_GetCurrentInteractionProfile(userPath, out var interactionProfile)) { return 0uL; } return interactionProfile; } protected static ulong GetCurrentInteractionProfile(string userPath) { return GetCurrentInteractionProfile(StringToPath(userPath)); } protected static ulong GetCurrentAppSpace() { if (!Internal_GetAppSpace(out var appSpace)) { return 0uL; } return appSpace; } protected static int GetViewConfigurationTypeForRenderPass(int renderPassIndex) { return Internal_GetViewTypeFromRenderIndex(renderPassIndex); } protected static void SetEnvironmentBlendMode(XrEnvironmentBlendMode xrEnvironmentBlendMode) { Internal_SetEnvironmentBlendMode(xrEnvironmentBlendMode); } protected static XrEnvironmentBlendMode GetEnvironmentBlendMode() { return Internal_GetEnvironmentBlendMode(); } protected void CreateSubsystem(List descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem { if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null) { Debug.LogError((object)"CreateSubsystem called before loader was initialized"); } else { OpenXRLoaderBase.Instance.CreateSubsystem(descriptors, id); } } protected void StartSubsystem() where T : class, ISubsystem { if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null) { Debug.LogError((object)"StartSubsystem called before loader was initialized"); } else { OpenXRLoaderBase.Instance.StartSubsystem(); } } protected void StopSubsystem() where T : class, ISubsystem { if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null) { Debug.LogError((object)"StopSubsystem called before loader was initialized"); } else { OpenXRLoaderBase.Instance.StopSubsystem(); } } protected void DestroySubsystem() where T : class, ISubsystem { if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null) { Debug.LogError((object)"DestroySubsystem called before loader was initialized"); } else { OpenXRLoaderBase.Instance.DestroySubsystem(); } } protected virtual void OnEnable() { } protected virtual void OnDisable() { } protected virtual void Awake() { } internal static bool ReceiveLoaderEvent(OpenXRLoaderBase loader, LoaderEvent e) { OpenXRSettings instance = OpenXRSettings.Instance; if ((Object)(object)instance == (Object)null) { return true; } OpenXRFeature[] features = instance.features; foreach (OpenXRFeature openXRFeature in features) { if (!((Object)(object)openXRFeature == (Object)null) && openXRFeature.enabled) { switch (e) { case LoaderEvent.SubsystemCreate: openXRFeature.OnSubsystemCreate(); break; case LoaderEvent.SubsystemDestroy: openXRFeature.OnSubsystemDestroy(); break; case LoaderEvent.SubsystemStart: openXRFeature.OnSubsystemStart(); break; case LoaderEvent.SubsystemStop: openXRFeature.OnSubsystemStop(); break; default: throw new ArgumentOutOfRangeException("e", e, null); } } } return true; } internal static void ReceiveNativeEvent(NativeEvent e, ulong payload) { if ((Object)null == (Object)(object)OpenXRSettings.Instance) { return; } OpenXRFeature[] features = OpenXRSettings.Instance.features; foreach (OpenXRFeature openXRFeature in features) { if (!((Object)(object)openXRFeature == (Object)null) && openXRFeature.enabled) { switch (e) { case NativeEvent.XrSetupConfigValues: openXRFeature.OnFormFactorChange(Internal_GetFormFactor()); openXRFeature.OnEnvironmentBlendModeChange(Internal_GetEnvironmentBlendMode()); openXRFeature.OnViewConfigurationTypeChange(Internal_GetViewConfigurationType()); break; case NativeEvent.XrSystemIdChanged: openXRFeature.OnSystemChange(payload); break; case NativeEvent.XrInstanceChanged: openXRFeature.failedInitialization = !openXRFeature.OnInstanceCreate(payload); requiredFeatureFailed |= openXRFeature.required && openXRFeature.failedInitialization; break; case NativeEvent.XrSessionChanged: openXRFeature.OnSessionCreate(payload); break; case NativeEvent.XrBeginSession: openXRFeature.OnSessionBegin(payload); break; case NativeEvent.XrChangedSpaceApp: openXRFeature.OnAppSpaceChange(payload); break; case NativeEvent.XrSessionStateChanged: { Internal_GetSessionState(out var oldState, out var newState); openXRFeature.OnSessionStateChange(oldState, newState); break; } case NativeEvent.XrEndSession: openXRFeature.OnSessionEnd(payload); break; case NativeEvent.XrExiting: openXRFeature.OnSessionExiting(payload); break; case NativeEvent.XrDestroySession: openXRFeature.OnSessionDestroy(payload); break; case NativeEvent.XrDestroyInstance: openXRFeature.OnInstanceDestroy(payload); break; case NativeEvent.XrLossPending: openXRFeature.OnSessionLossPending(payload); break; case NativeEvent.XrInstanceLossPending: openXRFeature.OnInstanceLossPending(payload); break; } } } } internal static void Initialize() { requiredFeatureFailed = false; OpenXRSettings instance = OpenXRSettings.Instance; if ((Object)(object)instance == (Object)null || instance.features == null) { return; } OpenXRFeature[] features = instance.features; foreach (OpenXRFeature openXRFeature in features) { if ((Object)(object)openXRFeature != (Object)null) { openXRFeature.failedInitialization = false; } } } internal static void HookGetInstanceProcAddr() { IntPtr func = Internal_GetProcAddressPtr(loaderDefault: true); OpenXRSettings instance = OpenXRSettings.Instance; if ((Object)(object)instance != (Object)null && instance.features != null) { for (int num = instance.features.Length - 1; num >= 0; num--) { OpenXRFeature openXRFeature = instance.features[num]; if (!((Object)(object)openXRFeature == (Object)null) && openXRFeature.enabled) { func = openXRFeature.HookGetInstanceProcAddr(func); } } } Internal_SetProcAddressPtrAndLoadStage1(func); } protected ulong GetAction(InputAction inputAction) { return OpenXRInput.GetActionHandle(inputAction); } protected ulong GetAction(InputDevice device, InputFeatureUsage usage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return OpenXRInput.GetActionHandle(device, usage); } protected ulong GetAction(InputDevice device, string usageName) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return OpenXRInput.GetActionHandle(device, usageName); } protected internal static ulong RegisterStatsDescriptor(string statName, StatFlags statFlags) { return runtime_RegisterStatsDescriptor(statName, statFlags); } protected internal static void SetStatAsFloat(ulong statId, float value) { runtime_SetStatAsFloat(statId, value); } protected internal static void SetStatAsUInt(ulong statId, uint value) { runtime_SetStatAsUInt(statId, value); } [DllImport("UnityOpenXR", EntryPoint = "Internal_PathToString")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_PathToStringPtr(ulong pathId, out IntPtr path); [DllImport("UnityOpenXR")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_StringToPath([MarshalAs(UnmanagedType.LPStr)] string str, out ulong pathId); [DllImport("UnityOpenXR")] [return: MarshalAs(UnmanagedType.U1)] private static extern bool Internal_GetCurrentInteractionProfile(ulong pathId, out ulong interactionProfile); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetFormFactor")] private static extern int Internal_GetFormFactor(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetViewConfigurationType")] private static extern int Internal_GetViewConfigurationType(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetViewTypeFromRenderIndex")] private static extern int Internal_GetViewTypeFromRenderIndex(int renderPassIndex); [DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetXRSession")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_GetXRSession(out ulong xrSession); [DllImport("UnityOpenXR", EntryPoint = "session_GetSessionState")] private static extern void Internal_GetSessionState(out int oldState, out int newState); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetEnvironmentBlendMode")] private static extern XrEnvironmentBlendMode Internal_GetEnvironmentBlendMode(); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetEnvironmentBlendMode")] private static extern void Internal_SetEnvironmentBlendMode(XrEnvironmentBlendMode xrEnvironmentBlendMode); [DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetAppSpace")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool Internal_GetAppSpace(out ulong appSpace); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetProcAddressPtr")] internal static extern IntPtr Internal_GetProcAddressPtr([MarshalAs(UnmanagedType.I1)] bool loaderDefault); [DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetProcAddressPtrAndLoadStage1")] internal static extern void Internal_SetProcAddressPtrAndLoadStage1(IntPtr func); [DllImport("UnityOpenXR")] internal static extern ulong runtime_RegisterStatsDescriptor(string statName, StatFlags statFlags); [DllImport("UnityOpenXR")] internal static extern void runtime_SetStatAsFloat(ulong statId, float value); [DllImport("UnityOpenXR")] internal static extern void runtime_SetStatAsUInt(ulong statId, uint value); } [Serializable] public abstract class OpenXRInteractionFeature : OpenXRFeature { [Serializable] protected internal enum ActionType { Binary, Axis1D, Axis2D, Pose, Vibrate, Count } [Serializable] protected internal class ActionBinding { public string interactionProfileName; public string interactionPath; public List userPaths; } [Serializable] protected internal class ActionConfig { public string name; public ActionType type; public string localizedName; public List bindings; public List usages; public bool isAdditive; } protected internal class DeviceConfig { public InputDeviceCharacteristics characteristics; public string userPath; } [Serializable] protected internal class ActionMapConfig { public string name; public string localizedName; public List deviceInfos; public List actions; public string desiredInteractionProfile; public string manufacturer; public string serialNumber; } public static class UserPaths { public const string leftHand = "/user/hand/left"; public const string rightHand = "/user/hand/right"; public const string head = "/user/head"; public const string gamepad = "/user/gamepad"; public const string treadmill = "/user/treadmill"; } public enum InteractionProfileType { Device, XRController } private static List m_CreatedActionMaps = null; private static Dictionary> m_InteractionProfileEnabledMaps = new Dictionary>(); internal virtual bool IsAdditive => false; protected virtual void RegisterDeviceLayout() { } protected virtual void UnregisterDeviceLayout() { } protected virtual void RegisterActionMapsWithRuntime() { } protected internal override bool OnInstanceCreate(ulong xrSession) { RegisterDeviceLayout(); return true; } protected virtual InteractionProfileType GetInteractionProfileType() { return InteractionProfileType.XRController; } protected virtual string GetDeviceLayoutName() { return ""; } internal void CreateActionMaps(List configs) { m_CreatedActionMaps = configs; RegisterActionMapsWithRuntime(); m_CreatedActionMaps = null; } protected void AddActionMap(ActionMapConfig map) { if (map == null) { throw new ArgumentNullException("map"); } if (m_CreatedActionMaps == null) { throw new InvalidOperationException("ActionMap must be added from within the RegisterActionMapsWithRuntime method"); } m_CreatedActionMaps.Add(map); } internal virtual void AddAdditiveActions(List actionMaps, ActionMapConfig additiveMap) { } protected internal override void OnEnabledChange() { base.OnEnabledChange(); } internal static void RegisterLayouts() { OpenXRFeature[] features = OpenXRSettings.Instance.GetFeatures(); foreach (OpenXRFeature openXRFeature in features) { if (openXRFeature.enabled) { ((OpenXRInteractionFeature)openXRFeature).RegisterDeviceLayout(); } } } } } namespace UnityEngine.XR.OpenXR.Features.Interactions { public class DPadInteraction : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "D-Pad Binding (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class DPad : XRController { [Preserve] [InputControl] public ButtonControl thumbstickDpadUp { get; private set; } [Preserve] [InputControl] public ButtonControl thumbstickDpadDown { get; private set; } [Preserve] [InputControl] public ButtonControl thumbstickDpadLeft { get; private set; } [Preserve] [InputControl] public ButtonControl thumbstickDpadRight { get; private set; } [Preserve] [InputControl] public ButtonControl trackpadDpadUp { get; private set; } [Preserve] [InputControl] public ButtonControl trackpadDpadDown { get; private set; } [Preserve] [InputControl] public ButtonControl trackpadDpadLeft { get; private set; } [Preserve] [InputControl] public ButtonControl trackpadDpadRight { get; private set; } [Preserve] [InputControl] public ButtonControl trackpadDpadCenter { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); thumbstickDpadUp = ((InputControl)this).GetChildControl("thumbstickDpadUp"); thumbstickDpadDown = ((InputControl)this).GetChildControl("thumbstickDpadDown"); thumbstickDpadLeft = ((InputControl)this).GetChildControl("thumbstickDpadLeft"); thumbstickDpadRight = ((InputControl)this).GetChildControl("thumbstickDpadRight"); trackpadDpadUp = ((InputControl)this).GetChildControl("trackpadDpadUp"); trackpadDpadDown = ((InputControl)this).GetChildControl("trackpadDpadDown"); trackpadDpadLeft = ((InputControl)this).GetChildControl("trackpadDpadLeft"); trackpadDpadRight = ((InputControl)this).GetChildControl("trackpadDpadRight"); trackpadDpadCenter = ((InputControl)this).GetChildControl("trackpadDpadCenter"); } } public const string featureId = "com.unity.openxr.feature.input.dpadinteraction"; public float forceThresholdLeft = 0.5f; public float forceThresholdReleaseLeft = 0.4f; public float centerRegionLeft = 0.5f; public float wedgeAngleLeft = MathF.PI / 2f; public bool isStickyLeft; public float forceThresholdRight = 0.5f; public float forceThresholdReleaseRight = 0.4f; public float centerRegionRight = 0.5f; public float wedgeAngleRight = MathF.PI / 2f; public bool isStickyRight; public const string thumbstickDpadUp = "/input/thumbstick/dpad_up"; public const string thumbstickDpadDown = "/input/thumbstick/dpad_down"; public const string thumbstickDpadLeft = "/input/thumbstick/dpad_left"; public const string thumbstickDpadRight = "/input/thumbstick/dpad_right"; public const string trackpadDpadUp = "/input/trackpad/dpad_up"; public const string trackpadDpadDown = "/input/trackpad/dpad_down"; public const string trackpadDpadLeft = "/input/trackpad/dpad_left"; public const string trackpadDpadRight = "/input/trackpad/dpad_right"; public const string trackpadDpadCenter = "/input/trackpad/dpad_center"; public const string profile = "/interaction_profiles/unity/dpad"; private const string kDeviceLocalizedName = "DPad Interaction OpenXR"; public string[] extensionStrings = new string[2] { "XR_KHR_binding_modification", "XR_EXT_dpad_binding" }; internal override bool IsAdditive => true; protected internal override bool OnInstanceCreate(ulong instance) { string[] array = extensionStrings; for (int i = 0; i < array.Length; i++) { if (!OpenXRRuntime.IsExtensionEnabled(array[i])) { return false; } } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(DPad); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("DPad Interaction OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("DPad"); } protected override string GetDeviceLayoutName() { return "DPad"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "dpadinteraction", localizedName = "DPad Interaction OpenXR", desiredInteractionProfile = "/interaction_profiles/unity/dpad", manufacturer = "", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "thumbstickDpadUp", localizedName = " Thumbstick Dpad Up", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/dpad_up", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "thumbstickDpadDown", localizedName = "Thumbstick Dpad Down", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/dpad_down", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "thumbstickDpadLeft", localizedName = "Thumbstick Dpad Left", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/dpad_left", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "thumbstickDpadRight", localizedName = "Thumbstick Dpad Right", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/dpad_right", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "trackpadDpadUp", localizedName = "Trackpad Dpad Up", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/dpad_up", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "trackpadDpadDown", localizedName = "Trackpad Dpad Down", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/dpad_down", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "trackpadDpadLeft", localizedName = "Trackpad Dpad Left", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/dpad_left", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "trackpadDpadRight", localizedName = "Trackpad Dpad Right", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/dpad_right", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true }, new ActionConfig { name = "trackpadDpadCenter", localizedName = "Trackpad Dpad Center", type = ActionType.Binary, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/dpad_center", interactionProfileName = "/interaction_profiles/unity/dpad" } }, isAdditive = true } } }; AddActionMap(map); } internal override void AddAdditiveActions(List actionMaps, ActionMapConfig additiveMap) { foreach (ActionMapConfig actionMap in actionMaps) { if (!actionMap.deviceInfos.Where((DeviceConfig d) => d.userPath != null && (string.CompareOrdinal(d.userPath, "/user/hand/left") == 0 || string.CompareOrdinal(d.userPath, "/user/hand/right") == 0)).Any()) { continue; } bool flag = false; bool flag2 = false; foreach (ActionConfig action in actionMap.actions) { if (!flag && action.bindings.FirstOrDefault((ActionBinding b) => b.interactionPath.Contains("trackpad")) != null) { flag = true; } if (!flag2 && action.bindings.FirstOrDefault((ActionBinding b) => b.interactionPath.Contains("thumbstick")) != null) { flag2 = true; } } foreach (ActionConfig item in additiveMap.actions.Where((ActionConfig a) => a.isAdditive)) { if ((flag && item.name.StartsWith("trackpad")) || (flag2 && item.name.StartsWith("thumbstick"))) { actionMap.actions.Add(item); } } } } } public class EyeGazeInteraction : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Eye Gaze (OpenXR)", isGenericTypeOfDevice = true)] public class EyeGazeDevice : OpenXRDevice { [Preserve] [InputControl(offset = 0u, usages = new string[] { "Device", "gaze" })] public PoseControl pose { get; private set; } protected override void FinishSetup() { base.FinishSetup(); pose = ((InputControl)this).GetChildControl("pose"); } } public const string featureId = "com.unity.openxr.feature.input.eyetracking"; private const string userPath = "/user/eyes_ext"; private const string profile = "/interaction_profiles/ext/eye_gaze_interaction"; private const string pose = "/input/gaze_ext/pose"; private const string kDeviceLocalizedName = "Eye Tracking OpenXR"; public const string extensionString = "XR_EXT_eye_gaze_interaction"; private const string layoutName = "EyeGaze"; protected internal override bool OnInstanceCreate(ulong instance) { if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_eye_gaze_interaction")) { return false; } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(EyeGazeDevice); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, "EyeGaze", (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Eye Tracking OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("EyeGaze"); } protected override InteractionProfileType GetInteractionProfileType() { if (!typeof(EyeGazeDevice).IsSubclassOf(typeof(XRController))) { return InteractionProfileType.Device; } return InteractionProfileType.XRController; } protected override string GetDeviceLayoutName() { return "EyeGaze"; } protected override void RegisterActionMapsWithRuntime() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "eyegaze", localizedName = "Eye Tracking OpenXR", desiredInteractionProfile = "/interaction_profiles/ext/eye_gaze_interaction", manufacturer = "", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)49, userPath = "/user/eyes_ext" } }, actions = new List { new ActionConfig { name = "pose", localizedName = "Pose", type = ActionType.Pose, usages = new List { "Device", "gaze" }, bindings = new List { new ActionBinding { interactionPath = "/input/gaze_ext/pose", interactionProfileName = "/interaction_profiles/ext/eye_gaze_interaction" } } } } }; AddActionMap(map); } } public static class EyeTrackingUsages { public static InputFeatureUsage gazePosition = new InputFeatureUsage("gazePosition"); public static InputFeatureUsage gazeRotation = new InputFeatureUsage("gazeRotation"); } public class HandCommonPosesInteraction : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Hand Interaction Poses (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" }, isGenericTypeOfDevice = true)] public class HandInteractionPoses : OpenXRDevice { [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 0u)] public PoseControl pokePose { get; private set; } [Preserve] [InputControl(offset = 0u)] public PoseControl pinchPose { get; private set; } protected override void FinishSetup() { base.FinishSetup(); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); pokePose = ((InputControl)this).GetChildControl("pokePose"); pinchPose = ((InputControl)this).GetChildControl("pinchPose"); } } public const string featureId = "com.unity.openxr.feature.input.handinteractionposes"; public const string profile = "/interaction_profiles/unity/hand_interaction_poses"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string poke = "/input/poke_ext/pose"; public const string pinch = "/input/pinch_ext/pose"; private const string kDeviceLocalizedName = "Hand Interaction Poses OpenXR"; public const string extensionString = "XR_EXT_hand_interaction"; internal override bool IsAdditive => true; protected internal override bool OnInstanceCreate(ulong instance) { if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_hand_interaction")) { return false; } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(HandInteractionPoses); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Hand Interaction Poses OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("HandInteractionPoses"); } protected override InteractionProfileType GetInteractionProfileType() { if (!typeof(HandInteractionPoses).IsSubclassOf(typeof(XRController))) { return InteractionProfileType.Device; } return InteractionProfileType.XRController; } protected override string GetDeviceLayoutName() { return "HandInteractionPoses"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "handinteractionposes", localizedName = "Hand Interaction Poses OpenXR", desiredInteractionProfile = "/interaction_profiles/unity/hand_interaction_poses", manufacturer = "", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)364, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)620, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/unity/hand_interaction_poses" } }, isAdditive = true }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/unity/hand_interaction_poses" } }, isAdditive = true }, new ActionConfig { name = "PokePose", localizedName = "Poke Pose", type = ActionType.Pose, bindings = new List { new ActionBinding { interactionPath = "/input/poke_ext/pose", interactionProfileName = "/interaction_profiles/unity/hand_interaction_poses" } }, isAdditive = true }, new ActionConfig { name = "PinchPose", localizedName = "Pinch Pose", type = ActionType.Pose, bindings = new List { new ActionBinding { interactionPath = "/input/pinch_ext/pose", interactionProfileName = "/interaction_profiles/unity/hand_interaction_poses" } }, isAdditive = true } } }; AddActionMap(map); } internal override void AddAdditiveActions(List actionMaps, ActionMapConfig additiveMap) { foreach (ActionMapConfig actionMap in actionMaps) { if (!actionMap.deviceInfos.Where((DeviceConfig d) => d.userPath != null && (string.CompareOrdinal(d.userPath, "/user/hand/left") == 0 || string.CompareOrdinal(d.userPath, "/user/hand/right") == 0)).Any()) { continue; } foreach (ActionConfig additiveAction in additiveMap.actions.Where((ActionConfig a) => a.isAdditive)) { bool flag = false; foreach (ActionConfig item in actionMap.actions.Where((ActionConfig m) => m.type == ActionType.Pose).Distinct().ToList()) { if (item.bindings.Where((ActionBinding b) => b.interactionPath != null && string.CompareOrdinal(b.interactionPath, additiveAction.bindings[0].interactionPath) == 0).Any()) { item.isAdditive = true; flag = true; } } if (!flag) { actionMap.actions.Add(additiveAction); } } } } } public class HandInteractionProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Hand Interaction (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class HandInteraction : XRController { [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 0u, usage = "Poke")] public PoseControl pokePose { get; private set; } [Preserve] [InputControl(offset = 0u, usage = "Pinch")] public PoseControl pinchPose { get; private set; } [Preserve] [InputControl(usage = "PinchValue")] public AxisControl pinchValue { get; private set; } [Preserve] [InputControl(usage = "PinchTouched")] public ButtonControl pinchTouched { get; private set; } [Preserve] [InputControl(usage = "PinchReady")] public ButtonControl pinchReady { get; private set; } [Preserve] [InputControl(usage = "PointerActivateValue")] public AxisControl pointerActivateValue { get; private set; } [Preserve] [InputControl(usage = "PointerActivated")] public ButtonControl pointerActivated { get; private set; } [Preserve] [InputControl(usage = "PointerActivateReady")] public ButtonControl pointerActivateReady { get; private set; } [Preserve] [InputControl(usage = "GraspValue")] public AxisControl graspValue { get; private set; } [Preserve] [InputControl(usage = "GraspFirm")] public ButtonControl graspFirm { get; private set; } [Preserve] [InputControl(usage = "GraspReady")] public ButtonControl graspReady { get; private set; } [Preserve] [InputControl(offset = 2u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 4u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 8u, noisy = true, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 20u, noisy = true, alias = "gripRotation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 68u, noisy = true)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 80u, noisy = true)] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(offset = 128u, noisy = true)] public Vector3Control pokePosition { get; private set; } [Preserve] [InputControl(offset = 140u, noisy = true)] public QuaternionControl pokeRotation { get; private set; } [Preserve] [InputControl(offset = 188u, noisy = true)] public Vector3Control pinchPosition { get; private set; } [Preserve] [InputControl(offset = 200u, noisy = true)] public QuaternionControl pinchRotation { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); pokePose = ((InputControl)this).GetChildControl("pokePose"); pinchPose = ((InputControl)this).GetChildControl("pinchPose"); pinchValue = ((InputControl)this).GetChildControl("pinchValue"); pinchTouched = ((InputControl)this).GetChildControl("pinchTouched"); pinchReady = ((InputControl)this).GetChildControl("pinchReady"); pointerActivateValue = ((InputControl)this).GetChildControl("pointerActivateValue"); pointerActivated = ((InputControl)this).GetChildControl("pointerActivated"); pointerActivateReady = ((InputControl)this).GetChildControl("pointerActivateReady"); graspValue = ((InputControl)this).GetChildControl("graspValue"); graspFirm = ((InputControl)this).GetChildControl("graspFirm"); graspReady = ((InputControl)this).GetChildControl("graspReady"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); pokePosition = ((InputControl)this).GetChildControl("pokePosition"); pokeRotation = ((InputControl)this).GetChildControl("pokeRotation"); pinchPosition = ((InputControl)this).GetChildControl("pinchPosition"); pinchRotation = ((InputControl)this).GetChildControl("pinchRotation"); } } public const string featureId = "com.unity.openxr.feature.input.handinteraction"; public const string profile = "/interaction_profiles/ext/hand_interaction_ext"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string poke = "/input/poke_ext/pose"; public const string pinch = "/input/pinch_ext/pose"; public const string pinchValue = "/input/pinch_ext/value"; public const string pinchReady = "/input/pinch_ext/ready_ext"; public const string pointerActivateValue = "/input/aim_activate_ext/value"; public const string pointerActivateReady = "/input/aim_activate_ext/ready_ext"; public const string graspValue = "/input/grasp_ext/value"; public const string graspReady = "/input/grasp_ext/ready_ext"; private const string kDeviceLocalizedName = "Hand Interaction OpenXR"; public const string extensionString = "XR_EXT_hand_interaction"; protected internal override bool OnInstanceCreate(ulong instance) { if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_hand_interaction")) { return false; } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(HandInteraction); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Hand Interaction OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("HandInteraction"); } protected override string GetDeviceLayoutName() { return "HandInteraction"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "handinteraction", localizedName = "Hand Interaction OpenXR", desiredInteractionProfile = "/interaction_profiles/ext/hand_interaction_ext", manufacturer = "", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)300, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)556, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "devicePose", localizedName = "Grip Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PokePose", localizedName = "Poke Pose", type = ActionType.Pose, usages = new List { "Poke" }, bindings = new List { new ActionBinding { interactionPath = "/input/poke_ext/pose", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PinchPose", localizedName = "Pinch Pose", type = ActionType.Pose, usages = new List { "Pinch" }, bindings = new List { new ActionBinding { interactionPath = "/input/pinch_ext/pose", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PinchValue", localizedName = "Pinch Value", type = ActionType.Axis1D, usages = new List { "PinchValue" }, bindings = new List { new ActionBinding { interactionPath = "/input/pinch_ext/value", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PinchTouched", localizedName = "Pinch Touched", type = ActionType.Binary, usages = new List { "PinchTouched" }, bindings = new List { new ActionBinding { interactionPath = "/input/pinch_ext/value", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PinchReady", localizedName = "Pinch Ready", type = ActionType.Binary, usages = new List { "PinchReady" }, bindings = new List { new ActionBinding { interactionPath = "/input/pinch_ext/ready_ext", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PointerActivateValue", localizedName = "Pointer Activate Value", type = ActionType.Axis1D, usages = new List { "PointerActivateValue" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim_activate_ext/value", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PointerActivated", localizedName = "Pointer Activated", type = ActionType.Binary, usages = new List { "PointerActivated" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim_activate_ext/value", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "PointerActivateReady", localizedName = "Pointer Activate Ready", type = ActionType.Binary, usages = new List { "PointerActivateReady" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim_activate_ext/ready_ext", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "GraspValue", localizedName = "Grasp Value", type = ActionType.Axis1D, usages = new List { "GraspValue" }, bindings = new List { new ActionBinding { interactionPath = "/input/grasp_ext/value", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "GraspFirm", localizedName = "Grasp Firm", type = ActionType.Binary, usages = new List { "GraspFirm" }, bindings = new List { new ActionBinding { interactionPath = "/input/grasp_ext/value", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } }, new ActionConfig { name = "GraspReady", localizedName = "Grasp Ready", type = ActionType.Binary, usages = new List { "GraspReady" }, bindings = new List { new ActionBinding { interactionPath = "/input/grasp_ext/ready_ext", interactionProfileName = "/interaction_profiles/ext/hand_interaction_ext" } } } } }; AddActionMap(map); } } public class HPReverbG2ControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "HP Reverb G2 Controller (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class ReverbG2Controller : XRControllerWithRumble { [Preserve] [InputControl(aliases = new string[] { "A", "X", "buttonA", "buttonX" }, usage = "PrimaryButton")] public ButtonControl primaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "B", "Y", "buttonB", "buttonY" }, usage = "SecondaryButton")] public ButtonControl secondaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "menubutton" }, usage = "MenuButton")] public ButtonControl menu { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripAxis", "squeeze" }, usage = "Grip")] public AxisControl grip { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usage = "GripButton")] public ButtonControl gripPressed { get; private set; } [Preserve] [InputControl(usage = "Trigger")] public AxisControl trigger { get; private set; } [Preserve] [InputControl(aliases = new string[] { "indexButton", "indexTouched", "triggerbutton" }, usage = "TriggerButton")] public ButtonControl triggerPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary2DAxis", "Joystick" }, usage = "Primary2DAxis")] public Vector2Control thumbstick { get; private set; } [Preserve] [InputControl(aliases = new string[] { "JoystickOrPadPressed", "thumbstickClick", "joystickClicked" }, usage = "Primary2DAxisClick")] public ButtonControl thumbstickClicked { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 29u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 32u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 36u, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 48u, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 96u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 108u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); primaryButton = ((InputControl)this).GetChildControl("primaryButton"); secondaryButton = ((InputControl)this).GetChildControl("secondaryButton"); menu = ((InputControl)this).GetChildControl("menu"); grip = ((InputControl)this).GetChildControl("grip"); gripPressed = ((InputControl)this).GetChildControl("gripPressed"); trigger = ((InputControl)this).GetChildControl("trigger"); triggerPressed = ((InputControl)this).GetChildControl("triggerPressed"); thumbstick = (Vector2Control)(object)((InputControl)this).GetChildControl("thumbstick"); thumbstickClicked = ((InputControl)this).GetChildControl("thumbstickClicked"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); } } public const string featureId = "com.unity.openxr.feature.input.hpreverb"; public const string profile = "/interaction_profiles/hp/mixed_reality_controller"; public const string buttonX = "/input/x/click"; public const string buttonY = "/input/y/click"; public const string buttonA = "/input/a/click"; public const string buttonB = "/input/b/click"; public const string menu = "/input/menu/click"; public const string squeeze = "/input/squeeze/value"; public const string trigger = "/input/trigger/value"; public const string thumbstick = "/input/thumbstick"; public const string thumbstickClick = "/input/thumbstick/click"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; private const string kDeviceLocalizedName = "HP Reverb G2 Controller OpenXR"; protected internal override bool OnInstanceCreate(ulong instance) { if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_hp_mixed_reality_controller")) { return false; } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(ReverbG2Controller); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("HP Reverb G2 Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("ReverbG2Controller"); } protected override string GetDeviceLayoutName() { return "ReverbG2Controller"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "hpreverbg2controller", localizedName = "HP Reverb G2 Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/hp/mixed_reality_controller", manufacturer = "HP", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "primaryButton", localizedName = "Primary Button", type = ActionType.Binary, usages = new List { "PrimaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/x/click", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/a/click", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "secondaryButton", localizedName = "Secondary Button", type = ActionType.Binary, usages = new List { "SecondaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/y/click", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/b/click", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "menu", localizedName = "Menu", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/menu/click", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "grip", localizedName = "Grip", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "gripPressed", localizedName = "Grip Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "trigger", localizedName = "Trigger", type = ActionType.Axis1D, usages = new List { "Trigger" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "triggerPressed", localizedName = "Trigger Pressed", type = ActionType.Binary, usages = new List { "TriggerButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "thumbstick", localizedName = "Thumbstick", type = ActionType.Axis2D, usages = new List { "Primary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "thumbstickClicked", localizedName = "Thumbstick Clicked", type = ActionType.Binary, usages = new List { "Primary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/click", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/hp/mixed_reality_controller" } } } } }; AddActionMap(map); } } public class HTCViveControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "HTC Vive Controller (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class ViveController : XRControllerWithRumble { [Preserve] [InputControl(aliases = new string[] { "Secondary", "selectbutton" }, usage = "SystemButton")] public ButtonControl select { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripAxis", "squeeze" }, usage = "Grip")] public AxisControl grip { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usage = "GripButton")] public ButtonControl gripPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "menubutton" }, usage = "MenuButton")] public ButtonControl menu { get; private set; } [Preserve] [InputControl(alias = "triggeraxis", usage = "Trigger")] public AxisControl trigger { get; private set; } [Preserve] [InputControl(alias = "triggerbutton", usage = "TriggerButton")] public ButtonControl triggerPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary2DAxis", "touchpadaxes", "touchpad" }, usage = "Primary2DAxis")] public Vector2Control trackpad { get; private set; } [Preserve] [InputControl(aliases = new string[] { "joystickorpadpressed", "touchpadpressed" }, usage = "Primary2DAxisClick")] public ButtonControl trackpadClicked { get; private set; } [Preserve] [InputControl(aliases = new string[] { "joystickorpadtouched", "touchpadtouched" }, usage = "Primary2DAxisTouch")] public ButtonControl trackpadTouched { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 26u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 28u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 32u, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 44u, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 92u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 104u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); select = ((InputControl)this).GetChildControl("select"); grip = ((InputControl)this).GetChildControl("grip"); gripPressed = ((InputControl)this).GetChildControl("gripPressed"); menu = ((InputControl)this).GetChildControl("menu"); trigger = ((InputControl)this).GetChildControl("trigger"); triggerPressed = ((InputControl)this).GetChildControl("triggerPressed"); trackpad = (Vector2Control)(object)((InputControl)this).GetChildControl("trackpad"); trackpadClicked = ((InputControl)this).GetChildControl("trackpadClicked"); trackpadTouched = ((InputControl)this).GetChildControl("trackpadTouched"); pointer = ((InputControl)this).GetChildControl("pointer"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); devicePose = ((InputControl)this).GetChildControl("devicePose"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); } } public const string featureId = "com.unity.openxr.feature.input.htcvive"; public const string profile = "/interaction_profiles/htc/vive_controller"; public const string system = "/input/system/click"; public const string squeeze = "/input/squeeze/click"; public const string menu = "/input/menu/click"; public const string trigger = "/input/trigger/value"; public const string triggerClick = "/input/trigger/click"; public const string trackpad = "/input/trackpad"; public const string trackpadClick = "/input/trackpad/click"; public const string trackpadTouch = "/input/trackpad/touch"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; private const string kDeviceLocalizedName = "HTC Vive Controller OpenXR"; protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(ViveController); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("HTC Vive Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("ViveController"); } protected override string GetDeviceLayoutName() { return "ViveController"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "htcvivecontroller", localizedName = "HTC Vive Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/htc/vive_controller", manufacturer = "HTC", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "grip", localizedName = "Grip", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/click", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "gripPressed", localizedName = "Grip Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/click", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "menu", localizedName = "Menu", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/menu/click", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "select", localizedName = "Select", type = ActionType.Binary, usages = new List { "SystemButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/system/click", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "trigger", localizedName = "Trigger", type = ActionType.Axis1D, usages = new List { "Trigger" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "triggerPressed", localizedName = "Trigger Pressed", type = ActionType.Binary, usages = new List { "TriggerButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/click", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "trackpad", localizedName = "Trackpad", type = ActionType.Axis2D, usages = new List { "Primary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "trackpadTouched", localizedName = "Trackpad Touched", type = ActionType.Binary, usages = new List { "Primary2DAxisTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/touch", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "trackpadClicked", localizedName = "Trackpad Clicked", type = ActionType.Binary, usages = new List { "Primary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/click", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/htc/vive_controller" } } } } }; AddActionMap(map); } } public class KHRSimpleControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Khronos Simple Controller (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class KHRSimpleController : XRControllerWithRumble { [Preserve] [InputControl(aliases = new string[] { "Secondary", "selectbutton" }, usage = "PrimaryButton")] public ButtonControl select { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "menubutton" }, usage = "MenuButton")] public ButtonControl menu { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 2u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 4u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 8u, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 20u, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 68u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 80u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); menu = ((InputControl)this).GetChildControl("menu"); select = ((InputControl)this).GetChildControl("select"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); } } public const string featureId = "com.unity.openxr.feature.input.khrsimpleprofile"; public const string profile = "/interaction_profiles/khr/simple_controller"; public const string select = "/input/select/click"; public const string menu = "/input/menu/click"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; private const string kDeviceLocalizedName = "KHR Simple Controller OpenXR"; protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(KHRSimpleController); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("KHR Simple Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout(typeof(KHRSimpleController).Name); } protected override string GetDeviceLayoutName() { return "KHRSimpleController"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "khrsimplecontroller", localizedName = "KHR Simple Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/khr/simple_controller", manufacturer = "Khronos", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "select", localizedName = "Select", type = ActionType.Binary, usages = new List { "PrimaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/select/click", interactionProfileName = "/interaction_profiles/khr/simple_controller" } } }, new ActionConfig { name = "menu", localizedName = "Menu", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/menu/click", interactionProfileName = "/interaction_profiles/khr/simple_controller" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/khr/simple_controller" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/khr/simple_controller" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/khr/simple_controller" } } } } }; AddActionMap(map); } } public class MetaQuestTouchPlusControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Meta Quest Touch Plus Controller(OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class QuestTouchPlusController : XRControllerWithRumble { [Preserve] [InputControl(aliases = new string[] { "Primary2DAxis", "Joystick" }, usage = "Primary2DAxis")] public Vector2Control thumbstick { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripAxis", "squeeze" }, usage = "Grip")] public AxisControl grip { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usage = "GripButton")] public ButtonControl gripPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "menuButton", "systemButton" }, usage = "MenuButton")] public ButtonControl menu { get; private set; } [Preserve] [InputControl(aliases = new string[] { "A", "X", "buttonA", "buttonX" }, usage = "PrimaryButton")] public ButtonControl primaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "ATouched", "XTouched", "ATouch", "XTouch", "buttonATouched", "buttonXTouched" }, usage = "PrimaryTouch")] public ButtonControl primaryTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "B", "Y", "buttonB", "buttonY" }, usage = "SecondaryButton")] public ButtonControl secondaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "BTouched", "YTouched", "BTouch", "YTouch", "buttonBTouched", "buttonYTouched" }, usage = "SecondaryTouch")] public ButtonControl secondaryTouched { get; private set; } [Preserve] [InputControl(usage = "Trigger")] public AxisControl trigger { get; private set; } [Preserve] [InputControl(aliases = new string[] { "indexButton", "indexTouched", "triggerbutton" }, usage = "TriggerButton")] public ButtonControl triggerPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "indexTouch", "indexNearTouched" }, usage = "TriggerTouch")] public ButtonControl triggerTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "JoystickOrPadPressed", "thumbstickClick", "joystickClicked" }, usage = "Primary2DAxisClick")] public ButtonControl thumbstickClicked { get; private set; } [Preserve] [InputControl(aliases = new string[] { "JoystickOrPadTouched", "thumbstickTouch", "joystickTouched" }, usage = "Primary2DAxisTouch")] public ButtonControl thumbstickTouched { get; private set; } [Preserve] [InputControl(usage = "ThumbrestTouch")] public ButtonControl thumbrestTouched { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 28u, usage = "IsTracked")] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 32u, usage = "TrackingState")] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 36u, noisy = true, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 48u, noisy = true, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 96u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 108u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } [Preserve] [InputControl(usage = "TriggerForce")] public AxisControl triggerForce { get; private set; } [Preserve] [InputControl(usage = "TriggerCurl")] public AxisControl triggerCurl { get; private set; } [Preserve] [InputControl(usage = "TriggerSlide")] public AxisControl triggerSlide { get; private set; } [Preserve] [InputControl(usage = "TriggerProximity")] public ButtonControl triggerProximity { get; private set; } [Preserve] [InputControl(usage = "ThumbProximity")] public ButtonControl thumbProximity { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); thumbstick = (Vector2Control)(object)((InputControl)this).GetChildControl("thumbstick"); trigger = ((InputControl)this).GetChildControl("trigger"); triggerPressed = ((InputControl)this).GetChildControl("triggerPressed"); triggerTouched = ((InputControl)this).GetChildControl("triggerTouched"); grip = ((InputControl)this).GetChildControl("grip"); gripPressed = ((InputControl)this).GetChildControl("gripPressed"); menu = ((InputControl)this).GetChildControl("menu"); primaryButton = ((InputControl)this).GetChildControl("primaryButton"); primaryTouched = ((InputControl)this).GetChildControl("primaryTouched"); secondaryButton = ((InputControl)this).GetChildControl("secondaryButton"); secondaryTouched = ((InputControl)this).GetChildControl("secondaryTouched"); thumbstickClicked = ((InputControl)this).GetChildControl("thumbstickClicked"); thumbstickTouched = ((InputControl)this).GetChildControl("thumbstickTouched"); thumbrestTouched = ((InputControl)this).GetChildControl("thumbrestTouched"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); triggerForce = ((InputControl)this).GetChildControl("triggerForce"); triggerCurl = ((InputControl)this).GetChildControl("triggerCurl"); triggerSlide = ((InputControl)this).GetChildControl("triggerSlide"); triggerProximity = ((InputControl)this).GetChildControl("triggerProximity"); thumbProximity = ((InputControl)this).GetChildControl("thumbProximity"); } } public const string featureId = "com.unity.openxr.feature.input.metaquestplus"; public const string profile = "/interaction_profiles/meta/touch_controller_plus"; public const string buttonX = "/input/x/click"; public const string buttonXTouch = "/input/x/touch"; public const string buttonY = "/input/y/click"; public const string buttonYTouch = "/input/y/touch"; public const string menu = "/input/menu/click"; public const string buttonA = "/input/a/click"; public const string buttonATouch = "/input/a/touch"; public const string buttonB = "/input/b/click"; public const string buttonBTouch = "/input/b/touch"; public const string system = "/input/system/click"; public const string squeeze = "/input/squeeze/value"; public const string trigger = "/input/trigger/value"; public const string triggerTouch = "/input/trigger/touch"; public const string thumbstick = "/input/thumbstick"; public const string thumbstickClick = "/input/thumbstick/click"; public const string thumbstickTouch = "/input/thumbstick/touch"; public const string thumbrest = "/input/thumbrest/touch"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; public const string triggerForce = "/input/trigger/force"; public const string triggerCurl = "/input/trigger/curl_meta"; public const string triggerSlide = "/input/trigger/slide_meta"; public const string triggerProximity = "/input/trigger/proximity_meta"; public const string thumbProximity = "/input/thumb_meta/proximity_meta"; private const string kDeviceLocalizedName = "Meta Quest Touch Plus Controller OpenXR"; protected internal override bool OnInstanceCreate(ulong instance) { if (!OpenXRRuntime.IsExtensionEnabled("XR_META_touch_controller_plus")) { return false; } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(QuestTouchPlusController); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Meta Quest Touch Plus Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("QuestTouchPlusController"); } protected override string GetDeviceLayoutName() { return "QuestTouchPlusController"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "questtouchpluscontroller", localizedName = "Meta Quest Touch Plus Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/meta/touch_controller_plus", manufacturer = "Oculus", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "thumbstick", localizedName = "Thumbstick", type = ActionType.Axis2D, usages = new List { "Primary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "grip", localizedName = "Grip", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "gripPressed", localizedName = "Grip Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "menu", localizedName = "Menu", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/menu/click", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/system/click", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "primaryButton", localizedName = "Primary Button", type = ActionType.Binary, usages = new List { "PrimaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/x/click", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/a/click", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "primaryTouched", localizedName = "Primary Touched", type = ActionType.Binary, usages = new List { "PrimaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/x/touch", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/a/touch", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "secondaryButton", localizedName = "Secondary Button", type = ActionType.Binary, usages = new List { "SecondaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/y/click", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/b/click", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "secondaryTouched", localizedName = "Secondary Touched", type = ActionType.Binary, usages = new List { "SecondaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/y/touch", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/b/touch", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "trigger", localizedName = "Trigger", type = ActionType.Axis1D, usages = new List { "Trigger" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "triggerPressed", localizedName = "Trigger Pressed", type = ActionType.Binary, usages = new List { "TriggerButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "triggerTouched", localizedName = "Trigger Touched", type = ActionType.Binary, usages = new List { "TriggerTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/touch", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "thumbstickClicked", localizedName = "Thumbstick Clicked", type = ActionType.Binary, usages = new List { "Primary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/click", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "thumbstickTouched", localizedName = "Thumbstick Touched", type = ActionType.Binary, usages = new List { "Primary2DAxisTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/touch", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "thumbrestTouched", localizedName = "Thumbrest Touched", type = ActionType.Binary, usages = new List { "ThumbrestTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbrest/touch", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "triggerForce", localizedName = "Trigger Force", type = ActionType.Axis1D, usages = new List { "TriggerForce" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/force", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "triggerCurl", localizedName = "Trigger Curl", type = ActionType.Axis1D, usages = new List { "TriggerCurl" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/curl_meta", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "triggerSlide", localizedName = "Trigger Slide", type = ActionType.Axis1D, usages = new List { "TriggerSlide" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/slide_meta", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "triggerProximity", localizedName = "Trigger Proximity", type = ActionType.Binary, usages = new List { "TriggerProximity" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/proximity_meta", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } }, new ActionConfig { name = "thumbProximity", localizedName = "Thumb Proximity", type = ActionType.Binary, usages = new List { "ThumbProximity" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumb_meta/proximity_meta", interactionProfileName = "/interaction_profiles/meta/touch_controller_plus" } } } } }; AddActionMap(map); } } public class MetaQuestTouchProControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Meta Quest Pro Touch Controller(OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class QuestProTouchController : XRControllerWithRumble { [Preserve] [InputControl(aliases = new string[] { "Primary2DAxis", "Joystick" }, usage = "Primary2DAxis")] public Vector2Control thumbstick { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripAxis", "squeeze" }, usage = "Grip")] public AxisControl grip { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usage = "GripButton")] public ButtonControl gripPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "menuButton", "systemButton" }, usage = "MenuButton")] public ButtonControl menu { get; private set; } [Preserve] [InputControl(aliases = new string[] { "A", "X", "buttonA", "buttonX" }, usage = "PrimaryButton")] public ButtonControl primaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "ATouched", "XTouched", "ATouch", "XTouch", "buttonATouched", "buttonXTouched" }, usage = "PrimaryTouch")] public ButtonControl primaryTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "B", "Y", "buttonB", "buttonY" }, usage = "SecondaryButton")] public ButtonControl secondaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "BTouched", "YTouched", "BTouch", "YTouch", "buttonBTouched", "buttonYTouched" }, usage = "SecondaryTouch")] public ButtonControl secondaryTouched { get; private set; } [Preserve] [InputControl(usage = "Trigger")] public AxisControl trigger { get; private set; } [Preserve] [InputControl(aliases = new string[] { "indexButton", "indexTouched", "triggerbutton" }, usage = "TriggerButton")] public ButtonControl triggerPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "indexTouch", "indexNearTouched" }, usage = "TriggerTouch")] public ButtonControl triggerTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "JoystickOrPadPressed", "thumbstickClick", "joystickClicked" }, usage = "Primary2DAxisClick")] public ButtonControl thumbstickClicked { get; private set; } [Preserve] [InputControl(aliases = new string[] { "JoystickOrPadTouched", "thumbstickTouch", "joystickTouched" }, usage = "Primary2DAxisTouch")] public ButtonControl thumbstickTouched { get; private set; } [Preserve] [InputControl(usage = "ThumbrestTouch")] public ButtonControl thumbrestTouched { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 28u, usage = "IsTracked")] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 32u, usage = "TrackingState")] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 36u, noisy = true, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 48u, noisy = true, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 96u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 108u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } [Preserve] [InputControl(usage = "ThumbrestForce")] public AxisControl thumbrestForce { get; private set; } [Preserve] [InputControl(usage = "StylusForce")] public AxisControl stylusForce { get; private set; } [Preserve] [InputControl(usage = "TriggerCurl")] public AxisControl triggerCurl { get; private set; } [Preserve] [InputControl(usage = "TriggerSlide")] public AxisControl triggerSlide { get; private set; } [Preserve] [InputControl(usage = "TriggerProximity")] public ButtonControl triggerProximity { get; private set; } [Preserve] [InputControl(usage = "ThumbProximity")] public ButtonControl thumbProximity { get; private set; } [Preserve] [InputControl(usage = "HapticTrigger")] public HapticControl hapticTrigger { get; private set; } [Preserve] [InputControl(usage = "HapticThumb")] public HapticControl hapticThumb { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); thumbstick = (Vector2Control)(object)((InputControl)this).GetChildControl("thumbstick"); trigger = ((InputControl)this).GetChildControl("trigger"); triggerPressed = ((InputControl)this).GetChildControl("triggerPressed"); triggerTouched = ((InputControl)this).GetChildControl("triggerTouched"); grip = ((InputControl)this).GetChildControl("grip"); gripPressed = ((InputControl)this).GetChildControl("gripPressed"); menu = ((InputControl)this).GetChildControl("menu"); primaryButton = ((InputControl)this).GetChildControl("primaryButton"); primaryTouched = ((InputControl)this).GetChildControl("primaryTouched"); secondaryButton = ((InputControl)this).GetChildControl("secondaryButton"); secondaryTouched = ((InputControl)this).GetChildControl("secondaryTouched"); thumbstickClicked = ((InputControl)this).GetChildControl("thumbstickClicked"); thumbstickTouched = ((InputControl)this).GetChildControl("thumbstickTouched"); thumbrestTouched = ((InputControl)this).GetChildControl("thumbrestTouched"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); thumbrestForce = ((InputControl)this).GetChildControl("thumbrestForce"); stylusForce = ((InputControl)this).GetChildControl("stylusForce"); triggerCurl = ((InputControl)this).GetChildControl("triggerCurl"); triggerSlide = ((InputControl)this).GetChildControl("triggerSlide"); triggerProximity = ((InputControl)this).GetChildControl("triggerProximity"); thumbProximity = ((InputControl)this).GetChildControl("thumbProximity"); hapticTrigger = ((InputControl)this).GetChildControl("hapticTrigger"); hapticThumb = ((InputControl)this).GetChildControl("hapticThumb"); } } public const string featureId = "com.unity.openxr.feature.input.metaquestpro"; public const string profile = "/interaction_profiles/facebook/touch_controller_pro"; public const string buttonX = "/input/x/click"; public const string buttonXTouch = "/input/x/touch"; public const string buttonY = "/input/y/click"; public const string buttonYTouch = "/input/y/touch"; public const string menu = "/input/menu/click"; public const string buttonA = "/input/a/click"; public const string buttonATouch = "/input/a/touch"; public const string buttonB = "/input/b/click"; public const string buttonBTouch = "/input/b/touch"; public const string system = "/input/system/click"; public const string squeeze = "/input/squeeze/value"; public const string trigger = "/input/trigger/value"; public const string triggerTouch = "/input/trigger/touch"; public const string thumbstick = "/input/thumbstick"; public const string thumbstickClick = "/input/thumbstick/click"; public const string thumbstickTouch = "/input/thumbstick/touch"; public const string thumbrest = "/input/thumbrest/touch"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; public const string thumbrestForce = "/input/thumbrest/force"; public const string stylusForce = "/input/stylus_fb/force"; public const string triggerCurl = "/input/trigger/curl_fb"; public const string triggerSlide = "/input/trigger/slide_fb"; public const string triggerProximity = "/input/trigger/proximity_fb"; public const string thumbProximity = "/input/thumb_fb/proximity_fb"; public const string hapticTrigger = "/output/trigger_haptic_fb"; public const string hapticThumb = "/output/thumb_haptic_fb"; private const string kDeviceLocalizedName = "Meta Quest Pro Touch Controller OpenXR"; protected internal override bool OnInstanceCreate(ulong instance) { if (!OpenXRRuntime.IsExtensionEnabled("XR_FB_touch_controller_pro")) { return false; } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(QuestProTouchController); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Meta Quest Pro Touch Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("QuestProTouchController"); } protected override string GetDeviceLayoutName() { return "QuestProTouchController"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "questprotouchcontroller", localizedName = "Meta Quest Pro Touch Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/facebook/touch_controller_pro", manufacturer = "Oculus", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "thumbstick", localizedName = "Thumbstick", type = ActionType.Axis2D, usages = new List { "Primary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "grip", localizedName = "Grip", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "gripPressed", localizedName = "Grip Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "menu", localizedName = "Menu", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/menu/click", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/system/click", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "primaryButton", localizedName = "Primary Button", type = ActionType.Binary, usages = new List { "PrimaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/x/click", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/a/click", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "primaryTouched", localizedName = "Primary Touched", type = ActionType.Binary, usages = new List { "PrimaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/x/touch", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/a/touch", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "secondaryButton", localizedName = "Secondary Button", type = ActionType.Binary, usages = new List { "SecondaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/y/click", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/b/click", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "secondaryTouched", localizedName = "Secondary Touched", type = ActionType.Binary, usages = new List { "SecondaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/y/touch", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/b/touch", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "trigger", localizedName = "Trigger", type = ActionType.Axis1D, usages = new List { "Trigger" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "triggerPressed", localizedName = "Trigger Pressed", type = ActionType.Binary, usages = new List { "TriggerButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "triggerTouched", localizedName = "Trigger Touched", type = ActionType.Binary, usages = new List { "TriggerTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/touch", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "thumbstickClicked", localizedName = "Thumbstick Clicked", type = ActionType.Binary, usages = new List { "Primary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/click", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "thumbstickTouched", localizedName = "Thumbstick Touched", type = ActionType.Binary, usages = new List { "Primary2DAxisTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/touch", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "thumbrestTouched", localizedName = "Thumbrest Touched", type = ActionType.Binary, usages = new List { "ThumbrestTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbrest/touch", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "thumbrestForce", localizedName = "Thumbrest Force", type = ActionType.Axis1D, usages = new List { "ThumbrestForce" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbrest/force", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "stylusForce", localizedName = "Stylus Force", type = ActionType.Axis1D, usages = new List { "StylusForce" }, bindings = new List { new ActionBinding { interactionPath = "/input/stylus_fb/force", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "triggerCurl", localizedName = "Trigger Curl", type = ActionType.Axis1D, usages = new List { "TriggerCurl" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/curl_fb", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "triggerSlide", localizedName = "Trigger Slide", type = ActionType.Axis1D, usages = new List { "TriggerSlide" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/slide_fb", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "triggerProximity", localizedName = "Trigger Proximity", type = ActionType.Binary, usages = new List { "TriggerProximity" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/proximity_fb", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "thumbProximity", localizedName = "Thumb Proximity", type = ActionType.Binary, usages = new List { "ThumbProximity" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumb_fb/proximity_fb", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "hapticTrigger", localizedName = "Haptic Trigger Output", type = ActionType.Vibrate, usages = new List { "HapticTrigger" }, bindings = new List { new ActionBinding { interactionPath = "/output/trigger_haptic_fb", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } }, new ActionConfig { name = "hapticThumb", localizedName = "Haptic Thumb Output", type = ActionType.Vibrate, usages = new List { "HapticThumb" }, bindings = new List { new ActionBinding { interactionPath = "/output/thumb_haptic_fb", interactionProfileName = "/interaction_profiles/facebook/touch_controller_pro" } } } } }; AddActionMap(map); } } public class MicrosoftHandInteraction : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Hololens Hand (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class HoloLensHand : XRController { [Preserve] [InputControl(usage = "PrimaryAxis")] public AxisControl select { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "selectbutton" }, usages = new string[] { "PrimaryButton" })] public ButtonControl selectPressed { get; private set; } [Preserve] [InputControl(alias = "Secondary", usage = "Grip")] public AxisControl squeeze { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usages = new string[] { "GripButton" })] public ButtonControl squeezePressed { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "device", usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 132u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 136u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 20u, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 32u, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 80u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 92u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); select = ((InputControl)this).GetChildControl("select"); selectPressed = ((InputControl)this).GetChildControl("selectPressed"); squeeze = ((InputControl)this).GetChildControl("squeeze"); squeezePressed = ((InputControl)this).GetChildControl("squeezePressed"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); } } public const string featureId = "com.unity.openxr.feature.input.handtracking"; public const string extensionString = "XR_MSFT_hand_interaction"; public const string profile = "/interaction_profiles/microsoft/hand_interaction"; public const string select = "/input/select/value"; public const string squeeze = "/input/squeeze/value"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; private const string kDeviceLocalizedName = "HoloLens Hand OpenXR"; protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(HoloLensHand); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("HoloLens Hand OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("HoloLensHand"); } protected override string GetDeviceLayoutName() { return "HoloLensHand"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "microsofthandinteraction", localizedName = "HoloLens Hand OpenXR", desiredInteractionProfile = "/interaction_profiles/microsoft/hand_interaction", manufacturer = "Microsoft", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)364, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)620, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "select", localizedName = "Select", type = ActionType.Axis1D, usages = new List { "PrimaryAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/select/value", interactionProfileName = "/interaction_profiles/microsoft/hand_interaction" } } }, new ActionConfig { name = "selectPressed", localizedName = "Select Pressed", type = ActionType.Binary, usages = new List { "PrimaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/select/value", interactionProfileName = "/interaction_profiles/microsoft/hand_interaction" } } }, new ActionConfig { name = "squeeze", localizedName = "Squeeze", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/microsoft/hand_interaction" } } }, new ActionConfig { name = "squeezePressed", localizedName = "Squeeze Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/microsoft/hand_interaction" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/microsoft/hand_interaction" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/microsoft/hand_interaction" } } } } }; AddActionMap(map); } } public class MicrosoftMotionControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Windows MR Controller (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class WMRSpatialController : XRControllerWithRumble { [Preserve] [InputControl(aliases = new string[] { "Primary2DAxis", "thumbstickaxes", "thumbstick" }, usage = "Primary2DAxis")] public Vector2Control joystick { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Secondary2DAxis", "touchpadaxes", "trackpad" }, usage = "Secondary2DAxis")] public Vector2Control touchpad { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripAxis", "squeeze" }, usage = "Grip")] public AxisControl grip { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usage = "GripButton")] public ButtonControl gripPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "menubutton" }, usage = "MenuButton")] public ButtonControl menu { get; private set; } [Preserve] [InputControl(aliases = new string[] { "triggeraxis" }, usage = "Trigger")] public AxisControl trigger { get; private set; } [Preserve] [InputControl(alias = "triggerbutton", usage = "TriggerButton")] public ButtonControl triggerPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "joystickClicked", "thumbstickpressed" }, usage = "Primary2DAxisClick")] public ButtonControl joystickClicked { get; private set; } [Preserve] [InputControl(aliases = new string[] { "joystickorpadpressed", "touchpadpressed", "trackpadClicked" }, usage = "Secondary2DAxisClick")] public ButtonControl touchpadClicked { get; private set; } [Preserve] [InputControl(aliases = new string[] { "joystickorpadtouched", "touchpadtouched", "trackpadTouched" }, usage = "Secondary2DAxisTouch")] public ButtonControl touchpadTouched { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "aimPose" }, usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 32u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 36u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 40u, aliases = new string[] { "gripPosition" })] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 52u, aliases = new string[] { "gripOrientation" })] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 100u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 112u, aliases = new string[] { "pointerOrientation" })] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); joystick = (Vector2Control)(object)((InputControl)this).GetChildControl("joystick"); trigger = ((InputControl)this).GetChildControl("trigger"); touchpad = (Vector2Control)(object)((InputControl)this).GetChildControl("touchpad"); grip = ((InputControl)this).GetChildControl("grip"); gripPressed = ((InputControl)this).GetChildControl("gripPressed"); menu = ((InputControl)this).GetChildControl("menu"); joystickClicked = ((InputControl)this).GetChildControl("joystickClicked"); triggerPressed = ((InputControl)this).GetChildControl("triggerPressed"); touchpadClicked = ((InputControl)this).GetChildControl("touchpadClicked"); touchpadTouched = ((InputControl)this).GetChildControl("touchPadTouched"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); } } public const string featureId = "com.unity.openxr.feature.input.microsoftmotioncontroller"; public const string profile = "/interaction_profiles/microsoft/motion_controller"; public const string menu = "/input/menu/click"; public const string squeeze = "/input/squeeze/click"; public const string trigger = "/input/trigger/value"; public const string thumbstick = "/input/thumbstick"; public const string thumbstickClick = "/input/thumbstick/click"; public const string trackpad = "/input/trackpad"; public const string trackpadClick = "/input/trackpad/click"; public const string trackpadTouch = "/input/trackpad/touch"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; private const string kDeviceLocalizedName = "Windows MR Controller OpenXR"; protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(WMRSpatialController); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Windows MR Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("WMRSpatialController"); } protected override string GetDeviceLayoutName() { return "WMRSpatialController"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "microsoftmotioncontroller", localizedName = "Windows MR Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/microsoft/motion_controller", manufacturer = "Microsoft", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "joystick", localizedName = "Joystick", type = ActionType.Axis2D, usages = new List { "Primary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "touchpad", localizedName = "Touchpad", type = ActionType.Axis2D, usages = new List { "Secondary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "grip", localizedName = "Grip", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/click", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "gripPressed", localizedName = "Grip Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/click", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "menu", localizedName = "Menu", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/menu/click", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "trigger", localizedName = "Trigger", type = ActionType.Axis1D, usages = new List { "Trigger" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "triggerPressed", localizedName = "Trigger Pressed", type = ActionType.Binary, usages = new List { "TriggerButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "joystickClicked", localizedName = "JoystickClicked", type = ActionType.Binary, usages = new List { "Primary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/click", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "touchpadClicked", localizedName = "Touchpad Clicked", type = ActionType.Binary, usages = new List { "Secondary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/click", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "touchpadTouched", localizedName = "Touchpad Touched", type = ActionType.Binary, usages = new List { "Secondary2DAxisTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/touch", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/microsoft/motion_controller" } } } } }; AddActionMap(map); } } public class OculusTouchControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Oculus Touch Controller (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class OculusTouchController : XRControllerWithRumble { [Preserve] [InputControl(aliases = new string[] { "Primary2DAxis", "Joystick" }, usage = "Primary2DAxis")] public Vector2Control thumbstick { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripAxis", "squeeze" }, usage = "Grip")] public AxisControl grip { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usage = "GripButton")] public ButtonControl gripPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "Primary", "menuButton", "systemButton" }, usage = "MenuButton")] public ButtonControl menu { get; private set; } [Preserve] [InputControl(aliases = new string[] { "A", "X", "buttonA", "buttonX" }, usage = "PrimaryButton")] public ButtonControl primaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "ATouched", "XTouched", "ATouch", "XTouch", "buttonATouched", "buttonXTouched" }, usage = "PrimaryTouch")] public ButtonControl primaryTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "B", "Y", "buttonB", "buttonY" }, usage = "SecondaryButton")] public ButtonControl secondaryButton { get; private set; } [Preserve] [InputControl(aliases = new string[] { "BTouched", "YTouched", "BTouch", "YTouch", "buttonBTouched", "buttonYTouched" }, usage = "SecondaryTouch")] public ButtonControl secondaryTouched { get; private set; } [Preserve] [InputControl(usage = "Trigger")] public AxisControl trigger { get; private set; } [Preserve] [InputControl(aliases = new string[] { "indexButton", "indexTouched", "triggerbutton" }, usage = "TriggerButton")] public ButtonControl triggerPressed { get; private set; } [Preserve] [InputControl(aliases = new string[] { "indexTouch", "indexNearTouched" }, usage = "TriggerTouch")] public ButtonControl triggerTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "JoystickOrPadPressed", "thumbstickClick", "joystickClicked" }, usage = "Primary2DAxisClick")] public ButtonControl thumbstickClicked { get; private set; } [Preserve] [InputControl(aliases = new string[] { "JoystickOrPadTouched", "thumbstickTouch", "joystickTouched" }, usage = "Primary2DAxisTouch")] public ButtonControl thumbstickTouched { get; private set; } [Preserve] [InputControl(usage = "ThumbrestTouch")] public ButtonControl thumbrestTouched { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 28u, usage = "IsTracked")] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 32u, usage = "TrackingState")] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 36u, noisy = true, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 48u, noisy = true, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 96u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 108u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); thumbstick = (Vector2Control)(object)((InputControl)this).GetChildControl("thumbstick"); trigger = ((InputControl)this).GetChildControl("trigger"); triggerPressed = ((InputControl)this).GetChildControl("triggerPressed"); triggerTouched = ((InputControl)this).GetChildControl("triggerTouched"); grip = ((InputControl)this).GetChildControl("grip"); gripPressed = ((InputControl)this).GetChildControl("gripPressed"); menu = ((InputControl)this).GetChildControl("menu"); primaryButton = ((InputControl)this).GetChildControl("primaryButton"); primaryTouched = ((InputControl)this).GetChildControl("primaryTouched"); secondaryButton = ((InputControl)this).GetChildControl("secondaryButton"); secondaryTouched = ((InputControl)this).GetChildControl("secondaryTouched"); thumbstickClicked = ((InputControl)this).GetChildControl("thumbstickClicked"); thumbstickTouched = ((InputControl)this).GetChildControl("thumbstickTouched"); thumbrestTouched = ((InputControl)this).GetChildControl("thumbrestTouched"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); } } public const string featureId = "com.unity.openxr.feature.input.oculustouch"; public const string profile = "/interaction_profiles/oculus/touch_controller"; public const string buttonX = "/input/x/click"; public const string buttonXTouch = "/input/x/touch"; public const string buttonY = "/input/y/click"; public const string buttonYTouch = "/input/y/touch"; public const string menu = "/input/menu/click"; public const string buttonA = "/input/a/click"; public const string buttonATouch = "/input/a/touch"; public const string buttonB = "/input/b/click"; public const string buttonBTouch = "/input/b/touch"; public const string system = "/input/system/click"; public const string squeeze = "/input/squeeze/value"; public const string trigger = "/input/trigger/value"; public const string triggerTouch = "/input/trigger/touch"; public const string thumbstick = "/input/thumbstick"; public const string thumbstickClick = "/input/thumbstick/click"; public const string thumbstickTouch = "/input/thumbstick/touch"; public const string thumbrest = "/input/thumbrest/touch"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; private const string kDeviceLocalizedName = "Oculus Touch Controller OpenXR"; protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(OculusTouchController); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Oculus Touch Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("OculusTouchController"); } protected override string GetDeviceLayoutName() { return "OculusTouchController"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "oculustouchcontroller", localizedName = "Oculus Touch Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/oculus/touch_controller", manufacturer = "Oculus", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "thumbstick", localizedName = "Thumbstick", type = ActionType.Axis2D, usages = new List { "Primary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "grip", localizedName = "Grip", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "gripPressed", localizedName = "Grip Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "menu", localizedName = "Menu", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/menu/click", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/system/click", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "primaryButton", localizedName = "Primary Button", type = ActionType.Binary, usages = new List { "PrimaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/x/click", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/a/click", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "primaryTouched", localizedName = "Primary Touched", type = ActionType.Binary, usages = new List { "PrimaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/x/touch", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/a/touch", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "secondaryButton", localizedName = "Secondary Button", type = ActionType.Binary, usages = new List { "SecondaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/y/click", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/b/click", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "secondaryTouched", localizedName = "Secondary Touched", type = ActionType.Binary, usages = new List { "SecondaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/y/touch", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/left" } }, new ActionBinding { interactionPath = "/input/b/touch", interactionProfileName = "/interaction_profiles/oculus/touch_controller", userPaths = new List { "/user/hand/right" } } } }, new ActionConfig { name = "trigger", localizedName = "Trigger", type = ActionType.Axis1D, usages = new List { "Trigger" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "triggerPressed", localizedName = "Trigger Pressed", type = ActionType.Binary, usages = new List { "TriggerButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "triggerTouched", localizedName = "Trigger Touched", type = ActionType.Binary, usages = new List { "TriggerTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/touch", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "thumbstickClicked", localizedName = "Thumbstick Clicked", type = ActionType.Binary, usages = new List { "Primary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/click", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "thumbstickTouched", localizedName = "Thumbstick Touched", type = ActionType.Binary, usages = new List { "Primary2DAxisTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/touch", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "thumbrestTouched", localizedName = "Thumbrest Touched", type = ActionType.Binary, usages = new List { "ThumbrestTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbrest/touch", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/oculus/touch_controller" } } } } }; AddActionMap(map); } } public class PalmPoseInteraction : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Palm Pose (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class PalmPose : XRController { [Preserve] [InputControl(offset = 0u)] public PoseControl palmPose { get; private set; } [Preserve] [InputControl(offset = 0u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 4u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 8u, noisy = true, alias = "palmPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 20u, noisy = true, alias = "palmRotation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 8u, noisy = true)] public Vector3Control palmPosition { get; private set; } [Preserve] [InputControl(offset = 20u, noisy = true)] public QuaternionControl palmRotation { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); palmPose = ((InputControl)this).GetChildControl("palmPose"); } } public const string featureId = "com.unity.openxr.feature.input.palmpose"; public const string palmPose = "/input/palm_ext/pose"; public const string gripSurfacePose = "/input/grip_surface/pose"; public const string profile = "/interaction_profiles/ext/palmpose"; private const string kDeviceLocalizedName = "Palm Pose Interaction OpenXR"; public const string extensionString = "XR_EXT_palm_pose"; internal override bool IsAdditive => true; protected internal override bool OnInstanceCreate(ulong instance) { if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_palm_pose")) { return false; } return base.OnInstanceCreate(instance); } protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(PalmPose); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Palm Pose Interaction OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("PalmPose"); } protected override string GetDeviceLayoutName() { return "PalmPose"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "palmposeinteraction", localizedName = "Palm Pose Interaction OpenXR", desiredInteractionProfile = "/interaction_profiles/ext/palmpose", manufacturer = "", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)364, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)620, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "palmpose", localizedName = "Palm Pose", type = ActionType.Pose, bindings = AddBindingBasedOnRuntimeAPIVersion(), isAdditive = true } } }; AddActionMap(map); } internal List AddBindingBasedOnRuntimeAPIVersion() { if (OpenXRRuntime.isRuntimeAPIVersionGreaterThan1_1()) { return new List { new ActionBinding { interactionPath = "/input/grip_surface/pose", interactionProfileName = "/interaction_profiles/ext/palmpose" } }; } return new List { new ActionBinding { interactionPath = "/input/palm_ext/pose", interactionProfileName = "/interaction_profiles/ext/palmpose" } }; } internal override void AddAdditiveActions(List actionMaps, ActionMapConfig additiveMap) { foreach (ActionMapConfig actionMap in actionMaps) { if (!actionMap.deviceInfos.Where((DeviceConfig d) => d.userPath != null && (string.CompareOrdinal(d.userPath, "/user/hand/left") == 0 || string.CompareOrdinal(d.userPath, "/user/hand/right") == 0)).Any()) { continue; } foreach (ActionConfig item in additiveMap.actions.Where((ActionConfig a) => a.isAdditive)) { actionMap.actions.Add(item); } } } } public class ValveIndexControllerProfile : OpenXRInteractionFeature { [Preserve] [InputControlLayout(displayName = "Index Controller (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })] public class ValveIndexController : XRControllerWithRumble { [Preserve] [InputControl(alias = "systemButton", usage = "MenuButton")] public ButtonControl system { get; private set; } [Preserve] [InputControl(usage = "MenuTouch")] public ButtonControl systemTouched { get; private set; } [Preserve] [InputControl(usage = "PrimaryButton")] public ButtonControl primaryButton { get; private set; } [Preserve] [InputControl(usage = "PrimaryTouch")] public ButtonControl primaryTouched { get; private set; } [Preserve] [InputControl(usage = "SecondaryButton")] public ButtonControl secondaryButton { get; private set; } [Preserve] [InputControl(usage = "SecondaryTouch")] public ButtonControl secondaryTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripAxis", "squeeze" }, usage = "Grip")] public AxisControl grip { get; private set; } [Preserve] [InputControl(aliases = new string[] { "GripButton", "squeezeClicked" }, usage = "GripButton")] public ButtonControl gripPressed { get; private set; } [Preserve] [InputControl(alias = "squeezeForce", usage = "GripForce")] public AxisControl gripForce { get; private set; } [Preserve] [InputControl(usage = "Trigger")] public AxisControl trigger { get; private set; } [Preserve] [InputControl(usage = "TriggerButton")] public ButtonControl triggerPressed { get; private set; } [Preserve] [InputControl(usage = "TriggerTouch")] public ButtonControl triggerTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "joystick", "Primary2DAxis" }, usage = "Primary2DAxis")] public Vector2Control thumbstick { get; private set; } [Preserve] [InputControl(alias = "joystickClicked", usage = "Primary2DAxisClick")] public ButtonControl thumbstickClicked { get; private set; } [Preserve] [InputControl(alias = "joystickTouched", usage = "Primary2DAxisTouch")] public ButtonControl thumbstickTouched { get; private set; } [Preserve] [InputControl(aliases = new string[] { "touchpad", "Secondary2DAxis" }, usage = "Secondary2DAxis")] public Vector2Control trackpad { get; private set; } [Preserve] [InputControl(alias = "touchpadTouched", usage = "Secondary2DAxisTouch")] public ButtonControl trackpadTouched { get; private set; } [Preserve] [InputControl(alias = "touchpadForce", usage = "Secondary2DAxisForce")] public AxisControl trackpadForce { get; private set; } [Preserve] [InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")] public PoseControl devicePose { get; private set; } [Preserve] [InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")] public PoseControl pointer { get; private set; } [Preserve] [InputControl(offset = 53u)] public ButtonControl isTracked { get; private set; } [Preserve] [InputControl(offset = 56u)] public IntegerControl trackingState { get; private set; } [Preserve] [InputControl(offset = 60u, alias = "gripPosition")] public Vector3Control devicePosition { get; private set; } [Preserve] [InputControl(offset = 72u, alias = "gripOrientation")] public QuaternionControl deviceRotation { get; private set; } [Preserve] [InputControl(offset = 120u)] public Vector3Control pointerPosition { get; private set; } [Preserve] [InputControl(offset = 132u, alias = "pointerOrientation")] public QuaternionControl pointerRotation { get; private set; } [Preserve] [InputControl(usage = "Haptic")] public HapticControl haptic { get; private set; } protected override void FinishSetup() { ((XRController)this).FinishSetup(); system = ((InputControl)this).GetChildControl("system"); systemTouched = ((InputControl)this).GetChildControl("systemTouched"); primaryButton = ((InputControl)this).GetChildControl("primaryButton"); primaryTouched = ((InputControl)this).GetChildControl("primaryTouched"); secondaryButton = ((InputControl)this).GetChildControl("secondaryButton"); secondaryTouched = ((InputControl)this).GetChildControl("secondaryTouched"); grip = ((InputControl)this).GetChildControl("grip"); gripPressed = ((InputControl)this).GetChildControl("gripPressed"); gripForce = ((InputControl)this).GetChildControl("gripForce"); trigger = ((InputControl)this).GetChildControl("trigger"); triggerPressed = ((InputControl)this).GetChildControl("triggerPressed"); triggerTouched = ((InputControl)this).GetChildControl("triggerTouched"); thumbstick = (Vector2Control)(object)((InputControl)this).GetChildControl("thumbstick"); thumbstickClicked = ((InputControl)this).GetChildControl("thumbstickClicked"); thumbstickTouched = ((InputControl)this).GetChildControl("thumbstickTouched"); trackpad = (Vector2Control)(object)((InputControl)this).GetChildControl("trackpad"); trackpadTouched = ((InputControl)this).GetChildControl("trackpadTouched"); trackpadForce = ((InputControl)this).GetChildControl("trackpadForce"); devicePose = ((InputControl)this).GetChildControl("devicePose"); pointer = ((InputControl)this).GetChildControl("pointer"); isTracked = ((InputControl)this).GetChildControl("isTracked"); trackingState = ((InputControl)this).GetChildControl("trackingState"); devicePosition = ((InputControl)this).GetChildControl("devicePosition"); deviceRotation = ((InputControl)this).GetChildControl("deviceRotation"); pointerPosition = ((InputControl)this).GetChildControl("pointerPosition"); pointerRotation = ((InputControl)this).GetChildControl("pointerRotation"); haptic = ((InputControl)this).GetChildControl("haptic"); } } public const string featureId = "com.unity.openxr.feature.input.valveindex"; public const string profile = "/interaction_profiles/valve/index_controller"; public const string system = "/input/system/click"; public const string systemTouch = "/input/system/touch"; public const string buttonA = "/input/a/click"; public const string buttonATouch = "/input/a/touch"; public const string buttonB = "/input/b/click"; public const string buttonBTouch = "/input/b/touch"; public const string squeeze = "/input/squeeze/value"; public const string squeezeForce = "/input/squeeze/force"; public const string triggerClick = "/input/trigger/click"; public const string trigger = "/input/trigger/value"; public const string triggerTouch = "/input/trigger/touch"; public const string thumbstick = "/input/thumbstick"; public const string thumbstickClick = "/input/thumbstick/click"; public const string thumbstickTouch = "/input/thumbstick/touch"; public const string trackpad = "/input/trackpad"; public const string trackpadForce = "/input/trackpad/force"; public const string trackpadTouch = "/input/trackpad/touch"; public const string grip = "/input/grip/pose"; public const string aim = "/input/aim/pose"; public const string haptic = "/output/haptic"; private const string kDeviceLocalizedName = "Index Controller OpenXR"; protected override void RegisterDeviceLayout() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Type? typeFromHandle = typeof(ValveIndexController); InputDeviceMatcher val = default(InputDeviceMatcher); val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true); InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Index Controller OpenXR", true)); } protected override void UnregisterDeviceLayout() { InputSystem.RemoveLayout("ValveIndexController"); } protected override string GetDeviceLayoutName() { return "ValveIndexController"; } protected override void RegisterActionMapsWithRuntime() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) ActionMapConfig map = new ActionMapConfig { name = "valveindexcontroller", localizedName = "Index Controller OpenXR", desiredInteractionProfile = "/interaction_profiles/valve/index_controller", manufacturer = "Valve", serialNumber = "", deviceInfos = new List { new DeviceConfig { characteristics = (InputDeviceCharacteristics)356, userPath = "/user/hand/left" }, new DeviceConfig { characteristics = (InputDeviceCharacteristics)612, userPath = "/user/hand/right" } }, actions = new List { new ActionConfig { name = "system", localizedName = "System", type = ActionType.Binary, usages = new List { "MenuButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/system/click", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "systemTouched", localizedName = "System Touched", type = ActionType.Binary, usages = new List { "MenuTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/system/touch", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "primaryButton", localizedName = "Primary Button", type = ActionType.Binary, usages = new List { "PrimaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/a/click", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "primaryTouched", localizedName = "Primary Touched", type = ActionType.Binary, usages = new List { "PrimaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/a/touch", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "secondaryButton", localizedName = "Secondary Button", type = ActionType.Binary, usages = new List { "SecondaryButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/b/click", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "secondaryTouched", localizedName = "Secondary Touched", type = ActionType.Binary, usages = new List { "SecondaryTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/b/touch", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "grip", localizedName = "Grip", type = ActionType.Axis1D, usages = new List { "Grip" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "gripPressed", localizedName = "Grip Pressed", type = ActionType.Binary, usages = new List { "GripButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/value", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "gripForce", localizedName = "Grip Force", type = ActionType.Axis1D, usages = new List { "GripForce" }, bindings = new List { new ActionBinding { interactionPath = "/input/squeeze/force", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "trigger", localizedName = "Trigger", type = ActionType.Axis1D, usages = new List { "Trigger" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/value", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "triggerPressed", localizedName = "Triggger Pressed", type = ActionType.Binary, usages = new List { "TriggerButton" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/click", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "triggerTouched", localizedName = "Trigger Touched", type = ActionType.Binary, usages = new List { "TriggerTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/trigger/touch", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "thumbstick", localizedName = "Thumbstick", type = ActionType.Axis2D, usages = new List { "Primary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "thumbstickClicked", localizedName = "Thumbstick Clicked", type = ActionType.Binary, usages = new List { "Primary2DAxisClick" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/click", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "thumbstickTouched", localizedName = "Thumbstick Touched", type = ActionType.Binary, usages = new List { "Primary2DAxisTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/thumbstick/touch", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "trackpad", localizedName = "Trackpad", type = ActionType.Axis2D, usages = new List { "Secondary2DAxis" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "trackpadForce", localizedName = "Trackpad Force", type = ActionType.Axis1D, usages = new List { "Secondary2DAxisForce" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/force", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "trackpadTouched", localizedName = "Trackpad Touched", type = ActionType.Binary, usages = new List { "Secondary2DAxisTouch" }, bindings = new List { new ActionBinding { interactionPath = "/input/trackpad/touch", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "devicePose", localizedName = "Device Pose", type = ActionType.Pose, usages = new List { "Device" }, bindings = new List { new ActionBinding { interactionPath = "/input/grip/pose", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "pointer", localizedName = "Pointer Pose", type = ActionType.Pose, usages = new List { "Pointer" }, bindings = new List { new ActionBinding { interactionPath = "/input/aim/pose", interactionProfileName = "/interaction_profiles/valve/index_controller" } } }, new ActionConfig { name = "haptic", localizedName = "Haptic Output", type = ActionType.Vibrate, usages = new List { "Haptic" }, bindings = new List { new ActionBinding { interactionPath = "/output/haptic", interactionProfileName = "/interaction_profiles/valve/index_controller" } } } } }; AddActionMap(map); } } } namespace UnityEngine.XR.OpenXR.Features.Extensions.PerformanceSettings { public class XrPerformanceSettingsFeature : OpenXRFeature { internal static class NativeApi { internal delegate void XrPerformanceNotificationDelegate(PerformanceChangeNotification notification); [DllImport("UnityOpenXR")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool xr_performance_settings_setEventCallback(XrPerformanceNotificationDelegate callback); [DllImport("UnityOpenXR")] [return: MarshalAs(UnmanagedType.U1)] internal static extern bool xr_performance_settings_setPerformanceLevel(PerformanceDomain domain, PerformanceLevelHint level); } public const string featureId = "com.unity.openxr.feature.extension.performance_settings"; public const string extensionString = "XR_EXT_performance_settings"; [CompilerGenerated] private static UnityAction m_OnXrPerformanceChangeNotification; public static event UnityAction OnXrPerformanceChangeNotification { [CompilerGenerated] add { UnityAction val = XrPerformanceSettingsFeature.m_OnXrPerformanceChangeNotification; UnityAction val2; do { val2 = val; UnityAction value2 = (UnityAction)(object)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value); val = Interlocked.CompareExchange(ref XrPerformanceSettingsFeature.m_OnXrPerformanceChangeNotification, value2, val2); } while (val != val2); } [CompilerGenerated] remove { UnityAction val = XrPerformanceSettingsFeature.m_OnXrPerformanceChangeNotification; UnityAction val2; do { val2 = val; UnityAction value2 = (UnityAction)(object)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value); val = Interlocked.CompareExchange(ref XrPerformanceSettingsFeature.m_OnXrPerformanceChangeNotification, value2, val2); } while (val != val2); } } public static bool SetPerformanceLevelHint(PerformanceDomain domain, PerformanceLevelHint level) { if (OpenXRRuntime.IsExtensionEnabled("XR_EXT_performance_settings")) { return NativeApi.xr_performance_settings_setPerformanceLevel(domain, level); } return false; } protected internal override bool OnInstanceCreate(ulong xrInstance) { if (base.OnInstanceCreate(xrInstance) && OpenXRRuntime.IsExtensionEnabled("XR_EXT_performance_settings")) { return NativeApi.xr_performance_settings_setEventCallback(OnXrPerformanceNotificationCallback); } return false; } [MonoPInvokeCallback(typeof(NativeApi.XrPerformanceNotificationDelegate))] private static void OnXrPerformanceNotificationCallback(PerformanceChangeNotification notification) { XrPerformanceSettingsFeature.OnXrPerformanceChangeNotification?.Invoke(notification); } } public enum PerformanceDomain { Cpu = 1, Gpu } public enum PerformanceSubDomain { Compositing = 1, Rendering, Thermal } public enum PerformanceLevelHint { PowerSavings = 0, SustainedLow = 25, SustainedHigh = 50, Boost = 75 } public enum PerformanceNotificationLevel { Normal = 0, Warning = 25, Impaired = 75 } public struct PerformanceChangeNotification { public PerformanceDomain domain; public PerformanceSubDomain subDomain; public PerformanceNotificationLevel fromLevel; public PerformanceNotificationLevel toLevel; } }