Decompiled source of BombRushCyberfunk VR v1.0.2

BepInEx/patchers/MoveToGame/Managed/SteamVR.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using Unity.XR.OpenVR;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.SpatialTracking;
using UnityEngine.UI;
using UnityEngine.XR;
using Valve.Newtonsoft.Json;
using Valve.VR;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
[ExecuteInEditMode]
public class URPMaterialSwitcher : MonoBehaviour
{
	public bool children;
}
public static class SteamVR_Utils
{
	public class Event
	{
		public delegate void Handler(params object[] args);

		private static Hashtable listeners = new Hashtable();

		public static void Listen(string message, Handler action)
		{
			if (listeners[message] is Handler a)
			{
				listeners[message] = (Handler)Delegate.Combine(a, action);
			}
			else
			{
				listeners[message] = action;
			}
		}

		public static void Remove(string message, Handler action)
		{
			if (listeners[message] is Handler source)
			{
				listeners[message] = (Handler)Delegate.Remove(source, action);
			}
		}

		public static void Send(string message, params object[] args)
		{
			if (listeners[message] is Handler handler)
			{
				handler(args);
			}
		}
	}

	[Serializable]
	public struct RigidTransform
	{
		public Vector3 pos;

		public Quaternion rot;

		public static RigidTransform identity => new RigidTransform(Vector3.zero, Quaternion.identity);

		public static RigidTransform FromLocal(Transform t)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return new RigidTransform(t.localPosition, t.localRotation);
		}

		public RigidTransform(Vector3 pos, Quaternion rot)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: 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_0009: Unknown result type (might be due to invalid IL or missing references)
			this.pos = pos;
			this.rot = rot;
		}

		public RigidTransform(Transform t)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_0013: Unknown result type (might be due to invalid IL or missing references)
			pos = t.position;
			rot = t.rotation;
		}

		public RigidTransform(Transform from, Transform to)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: 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_0019: 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_0021: 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)
			//IL_002c: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			Quaternion val = Quaternion.Inverse(from.rotation);
			rot = val * to.rotation;
			pos = val * (to.position - from.position);
		}

		public RigidTransform(HmdMatrix34_t pose)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: 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)
			//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_0047: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			Matrix4x4 matrix = Matrix4x4.identity;
			((Matrix4x4)(ref matrix))[0, 0] = pose.m0;
			((Matrix4x4)(ref matrix))[0, 1] = pose.m1;
			((Matrix4x4)(ref matrix))[0, 2] = 0f - pose.m2;
			((Matrix4x4)(ref matrix))[0, 3] = pose.m3;
			((Matrix4x4)(ref matrix))[1, 0] = pose.m4;
			((Matrix4x4)(ref matrix))[1, 1] = pose.m5;
			((Matrix4x4)(ref matrix))[1, 2] = 0f - pose.m6;
			((Matrix4x4)(ref matrix))[1, 3] = pose.m7;
			((Matrix4x4)(ref matrix))[2, 0] = 0f - pose.m8;
			((Matrix4x4)(ref matrix))[2, 1] = 0f - pose.m9;
			((Matrix4x4)(ref matrix))[2, 2] = pose.m10;
			((Matrix4x4)(ref matrix))[2, 3] = 0f - pose.m11;
			pos = matrix.GetPosition();
			rot = matrix.GetRotation();
		}

		public RigidTransform(HmdMatrix44_t pose)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: 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)
			//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_0047: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			Matrix4x4 matrix = Matrix4x4.identity;
			((Matrix4x4)(ref matrix))[0, 0] = pose.m0;
			((Matrix4x4)(ref matrix))[0, 1] = pose.m1;
			((Matrix4x4)(ref matrix))[0, 2] = 0f - pose.m2;
			((Matrix4x4)(ref matrix))[0, 3] = pose.m3;
			((Matrix4x4)(ref matrix))[1, 0] = pose.m4;
			((Matrix4x4)(ref matrix))[1, 1] = pose.m5;
			((Matrix4x4)(ref matrix))[1, 2] = 0f - pose.m6;
			((Matrix4x4)(ref matrix))[1, 3] = pose.m7;
			((Matrix4x4)(ref matrix))[2, 0] = 0f - pose.m8;
			((Matrix4x4)(ref matrix))[2, 1] = 0f - pose.m9;
			((Matrix4x4)(ref matrix))[2, 2] = pose.m10;
			((Matrix4x4)(ref matrix))[2, 3] = 0f - pose.m11;
			((Matrix4x4)(ref matrix))[3, 0] = pose.m12;
			((Matrix4x4)(ref matrix))[3, 1] = pose.m13;
			((Matrix4x4)(ref matrix))[3, 2] = 0f - pose.m14;
			((Matrix4x4)(ref matrix))[3, 3] = pose.m15;
			pos = matrix.GetPosition();
			rot = matrix.GetRotation();
		}

		public HmdMatrix44_t ToHmdMatrix44()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_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)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			Matrix4x4 val = Matrix4x4.TRS(pos, rot, Vector3.one);
			HmdMatrix44_t result = default(HmdMatrix44_t);
			result.m0 = ((Matrix4x4)(ref val))[0, 0];
			result.m1 = ((Matrix4x4)(ref val))[0, 1];
			result.m2 = 0f - ((Matrix4x4)(ref val))[0, 2];
			result.m3 = ((Matrix4x4)(ref val))[0, 3];
			result.m4 = ((Matrix4x4)(ref val))[1, 0];
			result.m5 = ((Matrix4x4)(ref val))[1, 1];
			result.m6 = 0f - ((Matrix4x4)(ref val))[1, 2];
			result.m7 = ((Matrix4x4)(ref val))[1, 3];
			result.m8 = 0f - ((Matrix4x4)(ref val))[2, 0];
			result.m9 = 0f - ((Matrix4x4)(ref val))[2, 1];
			result.m10 = ((Matrix4x4)(ref val))[2, 2];
			result.m11 = 0f - ((Matrix4x4)(ref val))[2, 3];
			result.m12 = ((Matrix4x4)(ref val))[3, 0];
			result.m13 = ((Matrix4x4)(ref val))[3, 1];
			result.m14 = 0f - ((Matrix4x4)(ref val))[3, 2];
			result.m15 = ((Matrix4x4)(ref val))[3, 3];
			return result;
		}

		public HmdMatrix34_t ToHmdMatrix34()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_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)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			Matrix4x4 val = Matrix4x4.TRS(pos, rot, Vector3.one);
			HmdMatrix34_t result = default(HmdMatrix34_t);
			result.m0 = ((Matrix4x4)(ref val))[0, 0];
			result.m1 = ((Matrix4x4)(ref val))[0, 1];
			result.m2 = 0f - ((Matrix4x4)(ref val))[0, 2];
			result.m3 = ((Matrix4x4)(ref val))[0, 3];
			result.m4 = ((Matrix4x4)(ref val))[1, 0];
			result.m5 = ((Matrix4x4)(ref val))[1, 1];
			result.m6 = 0f - ((Matrix4x4)(ref val))[1, 2];
			result.m7 = ((Matrix4x4)(ref val))[1, 3];
			result.m8 = 0f - ((Matrix4x4)(ref val))[2, 0];
			result.m9 = 0f - ((Matrix4x4)(ref val))[2, 1];
			result.m10 = ((Matrix4x4)(ref val))[2, 2];
			result.m11 = 0f - ((Matrix4x4)(ref val))[2, 3];
			return result;
		}

		public override bool Equals(object o)
		{
			//IL_0010: 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)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (o is RigidTransform rigidTransform)
			{
				if (pos == rigidTransform.pos)
				{
					return rot == rigidTransform.rot;
				}
				return false;
			}
			return false;
		}

		public override int GetHashCode()
		{
			return ((object)(Vector3)(ref pos)).GetHashCode() ^ ((object)(Quaternion)(ref rot)).GetHashCode();
		}

		public static bool operator ==(RigidTransform a, RigidTransform b)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			if (a.pos == b.pos)
			{
				return a.rot == b.rot;
			}
			return false;
		}

		public static bool operator !=(RigidTransform a, RigidTransform b)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			if (!(a.pos != b.pos))
			{
				return a.rot != b.rot;
			}
			return true;
		}

		public static RigidTransform operator *(RigidTransform a, RigidTransform b)
		{
			//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)
			//IL_0016: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			RigidTransform result = default(RigidTransform);
			result.rot = a.rot * b.rot;
			result.pos = a.pos + a.rot * b.pos;
			return result;
		}

		public void Inverse()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//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_0013: 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)
			//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_0028: Unknown result type (might be due to invalid IL or missing references)
			rot = Quaternion.Inverse(rot);
			pos = -(rot * pos);
		}

		public RigidTransform GetInverse()
		{
			//IL_0003: 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)
			RigidTransform result = new RigidTransform(pos, rot);
			result.Inverse();
			return result;
		}

		public void Multiply(RigidTransform a, RigidTransform b)
		{
			//IL_0002: 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_0012: 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)
			//IL_001f: 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)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			rot = a.rot * b.rot;
			pos = a.pos + a.rot * b.pos;
		}

		public Vector3 InverseTransformPoint(Vector3 point)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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)
			return Quaternion.Inverse(rot) * (point - pos);
		}

		public Vector3 TransformPoint(Vector3 point)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			return pos + rot * point;
		}

		public static Vector3 operator *(RigidTransform t, Vector3 v)
		{
			//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)
			return t.TransformPoint(v);
		}

		public static RigidTransform Interpolate(RigidTransform a, RigidTransform b, float t)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_0013: 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)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			return new RigidTransform(Vector3.Lerp(a.pos, b.pos, t), Quaternion.Slerp(a.rot, b.rot, t));
		}

		public void Interpolate(RigidTransform to, float t)
		{
			//IL_0002: 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_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			pos = Lerp(pos, to.pos, t);
			rot = Slerp(rot, to.rot, t);
		}
	}

	public delegate object SystemFn(CVRSystem system, params object[] args);

	private const string secretKey = "foobar";

	public static bool IsValid(Vector3 vector)
	{
		//IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references)
		if (!float.IsNaN(vector.x) && !float.IsNaN(vector.y))
		{
			return !float.IsNaN(vector.z);
		}
		return false;
	}

	public static bool IsValid(Quaternion rotation)
	{
		//IL_0000: 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_001a: 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)
		//IL_0034: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		if (!float.IsNaN(rotation.x) && !float.IsNaN(rotation.y) && !float.IsNaN(rotation.z) && !float.IsNaN(rotation.w))
		{
			if (rotation.x == 0f && rotation.y == 0f && rotation.z == 0f)
			{
				return rotation.w != 0f;
			}
			return true;
		}
		return false;
	}

	public static Quaternion Slerp(Quaternion A, Quaternion B, float t)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: 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_0013: 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_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: 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_0051: 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_005f: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.Clamp(A.x * B.x + A.y * B.y + A.z * B.z + A.w * B.w, -1f, 1f);
		if (num < 0f)
		{
			((Quaternion)(ref B))..ctor(0f - B.x, 0f - B.y, 0f - B.z, 0f - B.w);
			num = 0f - num;
		}
		float num4;
		float num5;
		if (1f - num > 0.0001f)
		{
			float num2 = Mathf.Acos(num);
			float num3 = Mathf.Sin(num2);
			num4 = Mathf.Sin((1f - t) * num2) / num3;
			num5 = Mathf.Sin(t * num2) / num3;
		}
		else
		{
			num4 = 1f - t;
			num5 = t;
		}
		return new Quaternion(num4 * A.x + num5 * B.x, num4 * A.y + num5 * B.y, num4 * A.z + num5 * B.z, num4 * A.w + num5 * B.w);
	}

	public static Vector3 Lerp(Vector3 A, Vector3 B, float t)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		return new Vector3(Lerp(A.x, B.x, t), Lerp(A.y, B.y, t), Lerp(A.z, B.z, t));
	}

	public static float Lerp(float A, float B, float t)
	{
		return A + (B - A) * t;
	}

	public static double Lerp(double A, double B, double t)
	{
		return A + (B - A) * t;
	}

	public static float InverseLerp(Vector3 A, Vector3 B, Vector3 result)
	{
		//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)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: 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_0009: Unknown result type (might be due to invalid IL or missing references)
		return Vector3.Dot(result - A, B - A);
	}

	public static float InverseLerp(float A, float B, float result)
	{
		return (result - A) / (B - A);
	}

	public static double InverseLerp(double A, double B, double result)
	{
		return (result - A) / (B - A);
	}

	public static float Saturate(float A)
	{
		if (!(A < 0f))
		{
			if (!(A > 1f))
			{
				return A;
			}
			return 1f;
		}
		return 0f;
	}

	public static Vector2 Saturate(Vector2 A)
	{
		//IL_0000: 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_0016: Unknown result type (might be due to invalid IL or missing references)
		return new Vector2(Saturate(A.x), Saturate(A.y));
	}

	public static float Abs(float A)
	{
		if (!(A < 0f))
		{
			return A;
		}
		return 0f - A;
	}

	public static Vector2 Abs(Vector2 A)
	{
		//IL_0000: 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_0016: Unknown result type (might be due to invalid IL or missing references)
		return new Vector2(Abs(A.x), Abs(A.y));
	}

	private static float _copysign(float sizeval, float signval)
	{
		if (Mathf.Sign(signval) != 1f)
		{
			return 0f - Mathf.Abs(sizeval);
		}
		return Mathf.Abs(sizeval);
	}

	public static Quaternion GetRotation(this Matrix4x4 matrix)
	{
		//IL_0002: 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_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: 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_0051: 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_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = default(Quaternion);
		val.w = Mathf.Sqrt(Mathf.Max(0f, 1f + matrix.m00 + matrix.m11 + matrix.m22)) / 2f;
		val.x = Mathf.Sqrt(Mathf.Max(0f, 1f + matrix.m00 - matrix.m11 - matrix.m22)) / 2f;
		val.y = Mathf.Sqrt(Mathf.Max(0f, 1f - matrix.m00 + matrix.m11 - matrix.m22)) / 2f;
		val.z = Mathf.Sqrt(Mathf.Max(0f, 1f - matrix.m00 - matrix.m11 + matrix.m22)) / 2f;
		val.x = _copysign(val.x, matrix.m21 - matrix.m12);
		val.y = _copysign(val.y, matrix.m02 - matrix.m20);
		val.z = _copysign(val.z, matrix.m10 - matrix.m01);
		return val;
	}

	public static Vector3 GetPosition(this Matrix4x4 matrix)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references)
		float m = matrix.m03;
		float m2 = matrix.m13;
		float m3 = matrix.m23;
		return new Vector3(m, m2, m3);
	}

	public static Vector3 GetScale(this Matrix4x4 m)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: 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_0013: 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_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: 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_003b: 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_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.Sqrt(m.m00 * m.m00 + m.m01 * m.m01 + m.m02 * m.m02);
		float num2 = Mathf.Sqrt(m.m10 * m.m10 + m.m11 * m.m11 + m.m12 * m.m12);
		float num3 = Mathf.Sqrt(m.m20 * m.m20 + m.m21 * m.m21 + m.m22 * m.m22);
		return new Vector3(num, num2, num3);
	}

	public static float GetLossyScale(Transform t)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return t.lossyScale.x;
	}

	public static string GetBadMD5Hash(string usedString)
	{
		return GetBadMD5Hash(Encoding.UTF8.GetBytes(usedString + "foobar"));
	}

	public static string GetBadMD5Hash(byte[] bytes)
	{
		byte[] array = new MD5CryptoServiceProvider().ComputeHash(bytes);
		StringBuilder stringBuilder = new StringBuilder();
		for (int i = 0; i < array.Length; i++)
		{
			stringBuilder.Append(array[i].ToString("x2"));
		}
		return stringBuilder.ToString();
	}

	public static string GetBadMD5HashFromFile(string filePath)
	{
		if (!File.Exists(filePath))
		{
			return null;
		}
		return GetBadMD5Hash(File.ReadAllText(filePath) + "foobar");
	}

	public static string SanitizePath(string path, bool allowLeadingSlash = true)
	{
		if (path.Contains("\\\\"))
		{
			path = path.Replace("\\\\", "\\");
		}
		if (path.Contains("//"))
		{
			path = path.Replace("//", "/");
		}
		if (!allowLeadingSlash && (path[0] == '/' || path[0] == '\\'))
		{
			path = path.Substring(1);
		}
		return path;
	}

	public static Type FindType(string typeName)
	{
		Type type = Type.GetType(typeName);
		if (type != null)
		{
			return type;
		}
		Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
		for (int i = 0; i < assemblies.Length; i++)
		{
			type = assemblies[i].GetType(typeName);
			if (type != null)
			{
				return type;
			}
		}
		return null;
	}

	public static object CallSystemFn(SystemFn fn, params object[] args)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		bool flag = !SteamVR.active && !SteamVR.usingNativeSupport;
		if (flag)
		{
			EVRInitError val = (EVRInitError)0;
			OpenVR.Init(ref val, (EVRApplicationType)4, "");
		}
		CVRSystem system = OpenVR.System;
		object result = ((system != null) ? fn(system, args) : null);
		if (flag)
		{
			OpenVR.Shutdown();
		}
		return result;
	}

	public static void TakeStereoScreenshot(uint screenshotHandle, GameObject target, int cellSize, float ipd, ref string previewFilename, ref string VRFilename)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Expected O, but got Unknown
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Expected O, but got Unknown
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0523: Unknown result type (might be due to invalid IL or missing references)
		//IL_059d: Unknown result type (might be due to invalid IL or missing references)
		//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0351: Unknown result type (might be due to invalid IL or missing references)
		//IL_0356: Unknown result type (might be due to invalid IL or missing references)
		//IL_035b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0360: Unknown result type (might be due to invalid IL or missing references)
		//IL_0369: Unknown result type (might be due to invalid IL or missing references)
		//IL_036e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0373: Unknown result type (might be due to invalid IL or missing references)
		//IL_0378: Unknown result type (might be due to invalid IL or missing references)
		//IL_0383: Unknown result type (might be due to invalid IL or missing references)
		//IL_0388: Unknown result type (might be due to invalid IL or missing references)
		//IL_038d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03be: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03db: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_0429: Unknown result type (might be due to invalid IL or missing references)
		//IL_042d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0432: Unknown result type (might be due to invalid IL or missing references)
		//IL_0434: Unknown result type (might be due to invalid IL or missing references)
		//IL_0438: Unknown result type (might be due to invalid IL or missing references)
		//IL_043d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0441: Unknown result type (might be due to invalid IL or missing references)
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0451: Unknown result type (might be due to invalid IL or missing references)
		//IL_0453: Unknown result type (might be due to invalid IL or missing references)
		//IL_048f: Unknown result type (might be due to invalid IL or missing references)
		Texture2D val = new Texture2D(4096, 4096, (TextureFormat)5, false);
		Stopwatch stopwatch = new Stopwatch();
		Camera val2 = null;
		stopwatch.Start();
		Camera val3 = target.GetComponent<Camera>();
		if ((Object)(object)val3 == (Object)null)
		{
			if ((Object)(object)val2 == (Object)null)
			{
				val2 = new GameObject().AddComponent<Camera>();
			}
			val3 = val2;
		}
		Texture2D val4 = new Texture2D(2048, 2048, (TextureFormat)5, false);
		RenderTexture val5 = new RenderTexture(2048, 2048, 24);
		RenderTexture targetTexture = val3.targetTexture;
		bool orthographic = val3.orthographic;
		float fieldOfView = val3.fieldOfView;
		float aspect = val3.aspect;
		StereoTargetEyeMask stereoTargetEye = val3.stereoTargetEye;
		val3.stereoTargetEye = (StereoTargetEyeMask)0;
		val3.fieldOfView = 60f;
		val3.orthographic = false;
		val3.targetTexture = val5;
		val3.aspect = 1f;
		val3.Render();
		RenderTexture.active = val5;
		val4.ReadPixels(new Rect(0f, 0f, (float)((Texture)val5).width, (float)((Texture)val5).height), 0, 0);
		RenderTexture.active = null;
		val3.targetTexture = null;
		Object.DestroyImmediate((Object)(object)val5);
		SteamVR_SphericalProjection steamVR_SphericalProjection = ((Component)val3).gameObject.AddComponent<SteamVR_SphericalProjection>();
		Vector3 localPosition = target.transform.localPosition;
		Quaternion localRotation = target.transform.localRotation;
		Vector3 position = target.transform.position;
		Quaternion rotation = target.transform.rotation;
		Quaternion val6 = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f);
		Transform transform = ((Component)val3).transform;
		int num = 1024 / cellSize;
		float num2 = 90f / (float)num;
		float num3 = num2 / 2f;
		RenderTexture val7 = new RenderTexture(cellSize, cellSize, 24);
		((Texture)val7).wrapMode = (TextureWrapMode)1;
		val7.antiAliasing = 8;
		val3.fieldOfView = num2;
		val3.orthographic = false;
		val3.targetTexture = val7;
		val3.aspect = aspect;
		val3.stereoTargetEye = (StereoTargetEyeMask)0;
		for (int i = 0; i < num; i++)
		{
			float num4 = 90f - (float)i * num2 - num3;
			int num5 = 4096 / ((Texture)val7).width;
			float num6 = 360f / (float)num5;
			float num7 = num6 / 2f;
			int num8 = i * 1024 / num;
			for (int j = 0; j < 2; j++)
			{
				if (j == 1)
				{
					num4 = 0f - num4;
					num8 = 2048 - num8 - cellSize;
				}
				for (int k = 0; k < num5; k++)
				{
					float num9 = -180f + (float)k * num6 + num7;
					int num10 = k * 4096 / num5;
					int num11 = 0;
					float num12 = (0f - ipd) / 2f * Mathf.Cos(num4 * (MathF.PI / 180f));
					for (int l = 0; l < 2; l++)
					{
						if (l == 1)
						{
							num11 = 2048;
							num12 = 0f - num12;
						}
						Vector3 val8 = val6 * Quaternion.Euler(0f, num9, 0f) * new Vector3(num12, 0f, 0f);
						transform.position = position + val8;
						Quaternion val9 = Quaternion.Euler(num4, num9, 0f);
						transform.rotation = val6 * val9;
						Vector3 val10 = val9 * Vector3.forward;
						float num13 = num9 - num6 / 2f;
						float num14 = num13 + num6;
						float num15 = num4 + num2 / 2f;
						float num16 = num15 - num2;
						float num17 = (num13 + num14) / 2f;
						float num18 = ((Mathf.Abs(num15) < Mathf.Abs(num16)) ? num15 : num16);
						Vector3 val11 = Quaternion.Euler(num18, num13, 0f) * Vector3.forward;
						Vector3 val12 = Quaternion.Euler(num18, num14, 0f) * Vector3.forward;
						Vector3 val13 = Quaternion.Euler(num15, num17, 0f) * Vector3.forward;
						Vector3 val14 = Quaternion.Euler(num16, num17, 0f) * Vector3.forward;
						Vector3 val15 = val11 / Vector3.Dot(val11, val10);
						Vector3 val16 = val12 / Vector3.Dot(val12, val10);
						Vector3 val17 = val13 / Vector3.Dot(val13, val10);
						Vector3 val18 = val14 / Vector3.Dot(val14, val10);
						Vector3 val19 = val16 - val15;
						Vector3 val20 = val18 - val17;
						float magnitude = ((Vector3)(ref val19)).magnitude;
						float magnitude2 = ((Vector3)(ref val20)).magnitude;
						float num19 = 1f / magnitude;
						float num20 = 1f / magnitude2;
						Vector3 uAxis = val19 * num19;
						Vector3 vAxis = val20 * num20;
						steamVR_SphericalProjection.Set(val10, num13, num14, num15, num16, uAxis, val15, num19, vAxis, val17, num20);
						val3.aspect = magnitude / magnitude2;
						val3.Render();
						RenderTexture.active = val7;
						val.ReadPixels(new Rect(0f, 0f, (float)((Texture)val7).width, (float)((Texture)val7).height), num10, num8 + num11);
						RenderTexture.active = null;
					}
					float num21 = ((float)i * ((float)num5 * 2f) + (float)k + (float)(j * num5)) / ((float)num * ((float)num5 * 2f));
					OpenVR.Screenshots.UpdateScreenshotProgress(screenshotHandle, num21);
				}
			}
		}
		OpenVR.Screenshots.UpdateScreenshotProgress(screenshotHandle, 1f);
		previewFilename += ".png";
		VRFilename += ".png";
		val4.Apply();
		File.WriteAllBytes(previewFilename, ImageConversion.EncodeToPNG(val4));
		val.Apply();
		File.WriteAllBytes(VRFilename, ImageConversion.EncodeToPNG(val));
		if ((Object)(object)val3 != (Object)(object)val2)
		{
			val3.targetTexture = targetTexture;
			val3.orthographic = orthographic;
			val3.fieldOfView = fieldOfView;
			val3.aspect = aspect;
			val3.stereoTargetEye = stereoTargetEye;
			target.transform.localPosition = localPosition;
			target.transform.localRotation = localRotation;
		}
		else
		{
			val2.targetTexture = null;
		}
		Object.DestroyImmediate((Object)(object)val7);
		Object.DestroyImmediate((Object)(object)steamVR_SphericalProjection);
		stopwatch.Stop();
		Debug.Log((object)$"Screenshot took {stopwatch.Elapsed} seconds.");
		if ((Object)(object)val2 != (Object)null)
		{
			Object.DestroyImmediate((Object)(object)((Component)val2).gameObject);
		}
		Object.DestroyImmediate((Object)(object)val4);
		Object.DestroyImmediate((Object)(object)val);
	}
}
namespace Valve.VR
{
	public class SteamVR_CameraHelper : MonoBehaviour
	{
		private void Start()
		{
			if ((Object)(object)((Component)this).gameObject.GetComponent<TrackedPoseDriver>() == (Object)null)
			{
				((Component)this).gameObject.AddComponent<TrackedPoseDriver>();
			}
		}
	}
	[Serializable]
	public class SteamVR_Behaviour_BooleanEvent : UnityEvent<SteamVR_Behaviour_Boolean, SteamVR_Input_Sources, bool>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_PoseEvent : UnityEvent<SteamVR_Behaviour_Pose, SteamVR_Input_Sources>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_Pose_ConnectedChangedEvent : UnityEvent<SteamVR_Behaviour_Pose, SteamVR_Input_Sources, bool>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_Pose_DeviceIndexChangedEvent : UnityEvent<SteamVR_Behaviour_Pose, SteamVR_Input_Sources, int>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_Pose_TrackingChangedEvent : UnityEvent<SteamVR_Behaviour_Pose, SteamVR_Input_Sources, ETrackingResult>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_SingleEvent : UnityEvent<SteamVR_Behaviour_Single, SteamVR_Input_Sources, float, float>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_SkeletonEvent : UnityEvent<SteamVR_Behaviour_Skeleton, SteamVR_Input_Sources>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_Skeleton_ConnectedChangedEvent : UnityEvent<SteamVR_Behaviour_Skeleton, SteamVR_Input_Sources, bool>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_Skeleton_TrackingChangedEvent : UnityEvent<SteamVR_Behaviour_Skeleton, SteamVR_Input_Sources, ETrackingResult>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_Vector2Event : UnityEvent<SteamVR_Behaviour_Vector2, SteamVR_Input_Sources, Vector2, Vector2>
	{
	}
	[Serializable]
	public class SteamVR_Behaviour_Vector3Event : UnityEvent<SteamVR_Behaviour_Vector3, SteamVR_Input_Sources, Vector3, Vector3>
	{
	}
	[Serializable]
	public abstract class SteamVR_Action<SourceMap, SourceElement> : SteamVR_Action, ISteamVR_Action, ISteamVR_Action_Source where SourceMap : SteamVR_Action_Source_Map<SourceElement>, new() where SourceElement : SteamVR_Action_Source, new()
	{
		[NonSerialized]
		protected SourceMap sourceMap;

		[NonSerialized]
		protected bool initialized;

		public virtual SourceElement this[SteamVR_Input_Sources inputSource] => sourceMap[inputSource];

		public override string fullPath => sourceMap.fullPath;

		public override ulong handle => sourceMap.handle;

		public override SteamVR_ActionSet actionSet => sourceMap.actionSet;

		public override SteamVR_ActionDirections direction => sourceMap.direction;

		public override bool active => sourceMap[SteamVR_Input_Sources.Any].active;

		public override bool lastActive => sourceMap[SteamVR_Input_Sources.Any].lastActive;

		public override bool activeBinding => sourceMap[SteamVR_Input_Sources.Any].activeBinding;

		public override bool lastActiveBinding => sourceMap[SteamVR_Input_Sources.Any].lastActiveBinding;

		public override void PreInitialize(string newActionPath)
		{
			actionPath = newActionPath;
			sourceMap = new SourceMap();
			sourceMap.PreInitialize(this, actionPath);
			initialized = true;
		}

		protected override void CreateUninitialized(string newActionPath, bool caseSensitive)
		{
			actionPath = newActionPath;
			sourceMap = new SourceMap();
			sourceMap.PreInitialize(this, actionPath, throwErrors: false);
			needsReinit = true;
			initialized = false;
		}

		protected override void CreateUninitialized(string newActionSet, SteamVR_ActionDirections direction, string newAction, bool caseSensitive)
		{
			actionPath = SteamVR_Input_ActionFile_Action.CreateNewName(newActionSet, direction, newAction);
			sourceMap = new SourceMap();
			sourceMap.PreInitialize(this, actionPath, throwErrors: false);
			needsReinit = true;
			initialized = false;
		}

		public override string TryNeedsInitData()
		{
			if (needsReinit && actionPath != null)
			{
				SteamVR_Action steamVR_Action = SteamVR_Action.FindExistingActionForPartialPath(actionPath);
				if (!(steamVR_Action == null))
				{
					actionPath = steamVR_Action.fullPath;
					sourceMap = (SourceMap)steamVR_Action.GetSourceMap();
					initialized = true;
					needsReinit = false;
					return actionPath;
				}
				sourceMap = null;
			}
			return null;
		}

		public override void Initialize(bool createNew = false, bool throwErrors = true)
		{
			if (needsReinit)
			{
				TryNeedsInitData();
			}
			if (createNew)
			{
				sourceMap.Initialize();
			}
			else
			{
				sourceMap = SteamVR_Input.GetActionDataFromPath<SourceMap>(actionPath);
				_ = sourceMap;
			}
			initialized = true;
		}

		public override SteamVR_Action_Source_Map GetSourceMap()
		{
			return sourceMap;
		}

		protected override void InitializeCopy(string newActionPath, SteamVR_Action_Source_Map newData)
		{
			actionPath = newActionPath;
			sourceMap = (SourceMap)newData;
			initialized = true;
		}

		protected void InitAfterDeserialize()
		{
			if (sourceMap != null)
			{
				if (sourceMap.fullPath != actionPath)
				{
					needsReinit = true;
					TryNeedsInitData();
				}
				if (string.IsNullOrEmpty(actionPath))
				{
					sourceMap = null;
				}
			}
			if (!initialized)
			{
				Initialize(createNew: false, throwErrors: false);
			}
		}

		public override bool GetActive(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].active;
		}

		public override bool GetActiveBinding(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].activeBinding;
		}

		public override bool GetLastActive(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].lastActive;
		}

		public override bool GetLastActiveBinding(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].lastActiveBinding;
		}
	}
	[Serializable]
	public abstract class SteamVR_Action : IEquatable<SteamVR_Action>, ISteamVR_Action, ISteamVR_Action_Source
	{
		[SerializeField]
		protected string actionPath;

		[SerializeField]
		protected bool needsReinit;

		public static bool startUpdatingSourceOnAccess = true;

		[NonSerialized]
		private string cachedShortName;

		public abstract string fullPath { get; }

		public abstract ulong handle { get; }

		public abstract SteamVR_ActionSet actionSet { get; }

		public abstract SteamVR_ActionDirections direction { get; }

		public bool setActive => actionSet.IsActive();

		public abstract bool active { get; }

		public abstract bool activeBinding { get; }

		public abstract bool lastActive { get; }

		public abstract bool lastActiveBinding { get; }

		public SteamVR_Action()
		{
		}

		public static CreateType Create<CreateType>(string newActionPath) where CreateType : SteamVR_Action, new()
		{
			CreateType val = new CreateType();
			val.PreInitialize(newActionPath);
			return val;
		}

		public static CreateType CreateUninitialized<CreateType>(string setName, SteamVR_ActionDirections direction, string newActionName, bool caseSensitive) where CreateType : SteamVR_Action, new()
		{
			CreateType val = new CreateType();
			val.CreateUninitialized(setName, direction, newActionName, caseSensitive);
			return val;
		}

		public static CreateType CreateUninitialized<CreateType>(string actionPath, bool caseSensitive) where CreateType : SteamVR_Action, new()
		{
			CreateType val = new CreateType();
			val.CreateUninitialized(actionPath, caseSensitive);
			return val;
		}

		public CreateType GetCopy<CreateType>() where CreateType : SteamVR_Action, new()
		{
			if (SteamVR_Input.ShouldMakeCopy())
			{
				CreateType val = new CreateType();
				val.InitializeCopy(actionPath, GetSourceMap());
				return val;
			}
			return (CreateType)this;
		}

		public abstract string TryNeedsInitData();

		protected abstract void InitializeCopy(string newActionPath, SteamVR_Action_Source_Map newData);

		public abstract void PreInitialize(string newActionPath);

		protected abstract void CreateUninitialized(string newActionPath, bool caseSensitive);

		protected abstract void CreateUninitialized(string newActionSet, SteamVR_ActionDirections direction, string newAction, bool caseSensitive);

		public abstract void Initialize(bool createNew = false, bool throwNotSetError = true);

		public abstract float GetTimeLastChanged(SteamVR_Input_Sources inputSource);

		public abstract SteamVR_Action_Source_Map GetSourceMap();

		public abstract bool GetActive(SteamVR_Input_Sources inputSource);

		public bool GetSetActive(SteamVR_Input_Sources inputSource)
		{
			return actionSet.IsActive(inputSource);
		}

		public abstract bool GetActiveBinding(SteamVR_Input_Sources inputSource);

		public abstract bool GetLastActive(SteamVR_Input_Sources inputSource);

		public abstract bool GetLastActiveBinding(SteamVR_Input_Sources inputSource);

		public string GetPath()
		{
			return actionPath;
		}

		public abstract bool IsUpdating(SteamVR_Input_Sources inputSource);

		public override int GetHashCode()
		{
			if (actionPath == null)
			{
				return 0;
			}
			return actionPath.GetHashCode();
		}

		public bool Equals(SteamVR_Action other)
		{
			if ((object)other == null)
			{
				return false;
			}
			return actionPath == other.actionPath;
		}

		public override bool Equals(object other)
		{
			if (other == null)
			{
				if (string.IsNullOrEmpty(actionPath))
				{
					return true;
				}
				if (GetSourceMap() == null)
				{
					return true;
				}
				return false;
			}
			if (this == other)
			{
				return true;
			}
			if (other is SteamVR_Action)
			{
				return Equals((SteamVR_Action)other);
			}
			return false;
		}

		public static bool operator !=(SteamVR_Action action1, SteamVR_Action action2)
		{
			return !(action1 == action2);
		}

		public static bool operator ==(SteamVR_Action action1, SteamVR_Action action2)
		{
			bool flag = (object)action1 == null || string.IsNullOrEmpty(action1.actionPath) || action1.GetSourceMap() == null;
			bool flag2 = (object)action2 == null || string.IsNullOrEmpty(action2.actionPath) || action2.GetSourceMap() == null;
			if (flag && flag2)
			{
				return true;
			}
			if (flag != flag2)
			{
				return false;
			}
			return action1.Equals(action2);
		}

		public static SteamVR_Action FindExistingActionForPartialPath(string path)
		{
			if (string.IsNullOrEmpty(path) || path.IndexOf('/') == -1)
			{
				return null;
			}
			string[] array = path.Split(new char[1] { '/' });
			if (array.Length >= 5 && string.IsNullOrEmpty(array[2]))
			{
				string actionSetName = array[2];
				string actionName = array[4];
				return SteamVR_Input.GetBaseAction(actionSetName, actionName);
			}
			return SteamVR_Input.GetBaseActionFromPath(path);
		}

		public string GetShortName()
		{
			if (cachedShortName == null)
			{
				cachedShortName = SteamVR_Input_ActionFile.GetShortName(fullPath);
			}
			return cachedShortName;
		}

		public void ShowOrigins()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			OpenVR.Input.ShowActionOrigins(actionSet.handle, handle);
		}

		public void HideOrigins()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			OpenVR.Input.ShowActionOrigins(0uL, 0uL);
		}
	}
	public abstract class SteamVR_Action_Source_Map<SourceElement> : SteamVR_Action_Source_Map where SourceElement : SteamVR_Action_Source, new()
	{
		protected SourceElement[] sources = new SourceElement[SteamVR_Input_Source.numSources];

		public SourceElement this[SteamVR_Input_Sources inputSource] => GetSourceElementForIndexer(inputSource);

		protected virtual void OnAccessSource(SteamVR_Input_Sources inputSource)
		{
		}

		public override void Initialize()
		{
			base.Initialize();
			for (int i = 0; i < sources.Length; i++)
			{
				if (sources[i] != null)
				{
					sources[i].Initialize();
				}
			}
		}

		protected override void PreinitializeMap(SteamVR_Input_Sources inputSource, SteamVR_Action wrappingAction)
		{
			sources[(int)inputSource] = new SourceElement();
			sources[(int)inputSource].Preinitialize(wrappingAction, inputSource);
		}

		protected virtual SourceElement GetSourceElementForIndexer(SteamVR_Input_Sources inputSource)
		{
			OnAccessSource(inputSource);
			return sources[(int)inputSource];
		}
	}
	public abstract class SteamVR_Action_Source_Map
	{
		public SteamVR_Action action;

		private static string inLowered = "IN".ToLower(CultureInfo.CurrentCulture);

		private static string outLowered = "OUT".ToLower(CultureInfo.CurrentCulture);

		public string fullPath { get; protected set; }

		public ulong handle { get; protected set; }

		public SteamVR_ActionSet actionSet { get; protected set; }

		public SteamVR_ActionDirections direction { get; protected set; }

		public virtual void PreInitialize(SteamVR_Action wrappingAction, string actionPath, bool throwErrors = true)
		{
			fullPath = actionPath;
			action = wrappingAction;
			actionSet = SteamVR_Input.GetActionSetFromPath(GetActionSetPath());
			direction = GetActionDirection();
			SteamVR_Input_Sources[] allSources = SteamVR_Input_Source.GetAllSources();
			for (int i = 0; i < allSources.Length; i++)
			{
				PreinitializeMap(allSources[i], wrappingAction);
			}
		}

		protected abstract void PreinitializeMap(SteamVR_Input_Sources inputSource, SteamVR_Action wrappingAction);

		public virtual void Initialize()
		{
			//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_0022: Unknown result type (might be due to invalid IL or missing references)
			ulong num = 0uL;
			EVRInputError actionHandle = OpenVR.Input.GetActionHandle(fullPath.ToLowerInvariant(), ref num);
			handle = num;
			if ((int)actionHandle != 0)
			{
				Debug.LogError((object)("<b>[SteamVR]</b> GetActionHandle (" + fullPath.ToLowerInvariant() + ") error: " + ((object)(EVRInputError)(ref actionHandle)).ToString()));
			}
		}

		private string GetActionSetPath()
		{
			int startIndex = fullPath.IndexOf('/', 1) + 1;
			int length = fullPath.IndexOf('/', startIndex);
			return fullPath.Substring(0, length);
		}

		private SteamVR_ActionDirections GetActionDirection()
		{
			int startIndex = fullPath.IndexOf('/', 1) + 1;
			int num = fullPath.IndexOf('/', startIndex);
			int length = fullPath.IndexOf('/', num + 1) - num - 1;
			string text = fullPath.Substring(num + 1, length);
			if (text == inLowered)
			{
				return SteamVR_ActionDirections.In;
			}
			if (text == outLowered)
			{
				return SteamVR_ActionDirections.Out;
			}
			Debug.LogError((object)("Could not find match for direction: " + text));
			return SteamVR_ActionDirections.In;
		}
	}
	public abstract class SteamVR_Action_Source : ISteamVR_Action_Source
	{
		protected ulong inputSourceHandle;

		protected SteamVR_Action action;

		public string fullPath => action.fullPath;

		public ulong handle => action.handle;

		public SteamVR_ActionSet actionSet => action.actionSet;

		public SteamVR_ActionDirections direction => action.direction;

		public SteamVR_Input_Sources inputSource { get; protected set; }

		public bool setActive => actionSet.IsActive(inputSource);

		public abstract bool active { get; }

		public abstract bool activeBinding { get; }

		public abstract bool lastActive { get; protected set; }

		public abstract bool lastActiveBinding { get; }

		public virtual void Preinitialize(SteamVR_Action wrappingAction, SteamVR_Input_Sources forInputSource)
		{
			action = wrappingAction;
			inputSource = forInputSource;
		}

		public SteamVR_Action_Source()
		{
		}

		public virtual void Initialize()
		{
			inputSourceHandle = SteamVR_Input_Source.GetHandle(inputSource);
		}
	}
	public interface ISteamVR_Action : ISteamVR_Action_Source
	{
		bool GetActive(SteamVR_Input_Sources inputSource);

		string GetShortName();
	}
	public interface ISteamVR_Action_Source
	{
		bool active { get; }

		bool activeBinding { get; }

		bool lastActive { get; }

		bool lastActiveBinding { get; }

		string fullPath { get; }

		ulong handle { get; }

		SteamVR_ActionSet actionSet { get; }

		SteamVR_ActionDirections direction { get; }
	}
	public enum SteamVR_ActionDirections
	{
		In,
		Out
	}
	[Serializable]
	public class SteamVR_ActionSet : IEquatable<SteamVR_ActionSet>, ISteamVR_ActionSet, ISerializationCallbackReceiver
	{
		[SerializeField]
		private string actionSetPath;

		[NonSerialized]
		protected SteamVR_ActionSet_Data setData;

		[NonSerialized]
		protected bool initialized;

		public SteamVR_Action[] allActions
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.allActions;
			}
		}

		public ISteamVR_Action_In[] nonVisualInActions
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.nonVisualInActions;
			}
		}

		public ISteamVR_Action_In[] visualActions
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.visualActions;
			}
		}

		public SteamVR_Action_Pose[] poseActions
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.poseActions;
			}
		}

		public SteamVR_Action_Skeleton[] skeletonActions
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.skeletonActions;
			}
		}

		public ISteamVR_Action_Out[] outActionArray
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.outActionArray;
			}
		}

		public string fullPath
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.fullPath;
			}
		}

		public string usage
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.usage;
			}
		}

		public ulong handle
		{
			get
			{
				if (!initialized)
				{
					Initialize();
				}
				return setData.handle;
			}
		}

		public static CreateType Create<CreateType>(string newSetPath) where CreateType : SteamVR_ActionSet, new()
		{
			CreateType val = new CreateType();
			val.PreInitialize(newSetPath);
			return val;
		}

		public static CreateType CreateFromName<CreateType>(string newSetName) where CreateType : SteamVR_ActionSet, new()
		{
			CreateType val = new CreateType();
			val.PreInitialize(SteamVR_Input_ActionFile_ActionSet.GetPathFromName(newSetName));
			return val;
		}

		public void PreInitialize(string newActionPath)
		{
			actionSetPath = newActionPath;
			setData = new SteamVR_ActionSet_Data();
			setData.fullPath = actionSetPath;
			setData.PreInitialize();
			initialized = true;
		}

		public virtual void FinishPreInitialize()
		{
			setData.FinishPreInitialize();
		}

		public virtual void Initialize(bool createNew = false, bool throwErrors = true)
		{
			if (createNew)
			{
				setData.Initialize();
			}
			else
			{
				setData = SteamVR_Input.GetActionSetDataFromPath(actionSetPath);
				_ = setData;
			}
			initialized = true;
		}

		public string GetPath()
		{
			return actionSetPath;
		}

		public bool IsActive(SteamVR_Input_Sources source = SteamVR_Input_Sources.Any)
		{
			return setData.IsActive(source);
		}

		public float GetTimeLastChanged(SteamVR_Input_Sources source = SteamVR_Input_Sources.Any)
		{
			return setData.GetTimeLastChanged(source);
		}

		public void Activate(SteamVR_Input_Sources activateForSource = SteamVR_Input_Sources.Any, int priority = 0, bool disableAllOtherActionSets = false)
		{
			setData.Activate(activateForSource, priority, disableAllOtherActionSets);
		}

		public void Deactivate(SteamVR_Input_Sources forSource = SteamVR_Input_Sources.Any)
		{
			setData.Deactivate(forSource);
		}

		public string GetShortName()
		{
			return setData.GetShortName();
		}

		public bool ShowBindingHints(ISteamVR_Action_In originToHighlight = null)
		{
			if (originToHighlight == null)
			{
				return SteamVR_Input.ShowBindingHints(this);
			}
			return SteamVR_Input.ShowBindingHints(originToHighlight);
		}

		public bool ReadRawSetActive(SteamVR_Input_Sources inputSource)
		{
			return setData.ReadRawSetActive(inputSource);
		}

		public float ReadRawSetLastChanged(SteamVR_Input_Sources inputSource)
		{
			return setData.ReadRawSetLastChanged(inputSource);
		}

		public int ReadRawSetPriority(SteamVR_Input_Sources inputSource)
		{
			return setData.ReadRawSetPriority(inputSource);
		}

		public SteamVR_ActionSet_Data GetActionSetData()
		{
			return setData;
		}

		public CreateType GetCopy<CreateType>() where CreateType : SteamVR_ActionSet, new()
		{
			if (SteamVR_Input.ShouldMakeCopy())
			{
				return new CreateType
				{
					actionSetPath = actionSetPath,
					setData = setData,
					initialized = true
				};
			}
			return (CreateType)this;
		}

		public bool Equals(SteamVR_ActionSet other)
		{
			if ((object)other == null)
			{
				return false;
			}
			return actionSetPath == other.actionSetPath;
		}

		public override bool Equals(object other)
		{
			if (other == null)
			{
				if (string.IsNullOrEmpty(actionSetPath))
				{
					return true;
				}
				return false;
			}
			if (this == other)
			{
				return true;
			}
			if (other is SteamVR_ActionSet)
			{
				return Equals((SteamVR_ActionSet)other);
			}
			return false;
		}

		public override int GetHashCode()
		{
			if (actionSetPath == null)
			{
				return 0;
			}
			return actionSetPath.GetHashCode();
		}

		public static bool operator !=(SteamVR_ActionSet set1, SteamVR_ActionSet set2)
		{
			return !(set1 == set2);
		}

		public static bool operator ==(SteamVR_ActionSet set1, SteamVR_ActionSet set2)
		{
			bool flag = (object)set1 == null || string.IsNullOrEmpty(set1.actionSetPath) || set1.GetActionSetData() == null;
			bool flag2 = (object)set2 == null || string.IsNullOrEmpty(set2.actionSetPath) || set2.GetActionSetData() == null;
			if (flag && flag2)
			{
				return true;
			}
			if (flag != flag2)
			{
				return false;
			}
			return set1.Equals(set2);
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
		}

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			if (setData != null && setData.fullPath != actionSetPath)
			{
				setData = SteamVR_Input.GetActionSetDataFromPath(actionSetPath);
			}
			if (!initialized)
			{
				Initialize(createNew: false, throwErrors: false);
			}
		}
	}
	public class SteamVR_ActionSet_Data : ISteamVR_ActionSet
	{
		protected bool[] rawSetActive = new bool[SteamVR_Input_Source.numSources];

		protected float[] rawSetLastChanged = new float[SteamVR_Input_Source.numSources];

		protected int[] rawSetPriority = new int[SteamVR_Input_Source.numSources];

		protected bool initialized;

		private string cachedShortName;

		public SteamVR_Action[] allActions { get; set; }

		public ISteamVR_Action_In[] nonVisualInActions { get; set; }

		public ISteamVR_Action_In[] visualActions { get; set; }

		public SteamVR_Action_Pose[] poseActions { get; set; }

		public SteamVR_Action_Skeleton[] skeletonActions { get; set; }

		public ISteamVR_Action_Out[] outActionArray { get; set; }

		public string fullPath { get; set; }

		public string usage { get; set; }

		public ulong handle { get; set; }

		public void PreInitialize()
		{
		}

		public void FinishPreInitialize()
		{
			List<SteamVR_Action> list = new List<SteamVR_Action>();
			List<ISteamVR_Action_In> list2 = new List<ISteamVR_Action_In>();
			List<ISteamVR_Action_In> list3 = new List<ISteamVR_Action_In>();
			List<SteamVR_Action_Pose> list4 = new List<SteamVR_Action_Pose>();
			List<SteamVR_Action_Skeleton> list5 = new List<SteamVR_Action_Skeleton>();
			List<ISteamVR_Action_Out> list6 = new List<ISteamVR_Action_Out>();
			if (SteamVR_Input.actions == null)
			{
				Debug.LogError((object)"<b>[SteamVR Input]</b> Actions not initialized!");
				return;
			}
			for (int i = 0; i < SteamVR_Input.actions.Length; i++)
			{
				SteamVR_Action steamVR_Action = SteamVR_Input.actions[i];
				if (steamVR_Action.actionSet.GetActionSetData() == this)
				{
					list.Add(steamVR_Action);
					if (steamVR_Action is ISteamVR_Action_Boolean || steamVR_Action is ISteamVR_Action_Single || steamVR_Action is ISteamVR_Action_Vector2 || steamVR_Action is ISteamVR_Action_Vector3)
					{
						list2.Add((ISteamVR_Action_In)steamVR_Action);
					}
					else if (steamVR_Action is SteamVR_Action_Pose)
					{
						list3.Add((ISteamVR_Action_In)steamVR_Action);
						list4.Add((SteamVR_Action_Pose)steamVR_Action);
					}
					else if (steamVR_Action is SteamVR_Action_Skeleton)
					{
						list3.Add((ISteamVR_Action_In)steamVR_Action);
						list5.Add((SteamVR_Action_Skeleton)steamVR_Action);
					}
					else if (steamVR_Action is ISteamVR_Action_Out)
					{
						list6.Add((ISteamVR_Action_Out)steamVR_Action);
					}
					else
					{
						Debug.LogError((object)("<b>[SteamVR Input]</b> Action doesn't implement known interface: " + steamVR_Action.fullPath));
					}
				}
			}
			allActions = list.ToArray();
			nonVisualInActions = list2.ToArray();
			visualActions = list3.ToArray();
			poseActions = list4.ToArray();
			skeletonActions = list5.ToArray();
			outActionArray = list6.ToArray();
		}

		public void Initialize()
		{
			//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_0022: Unknown result type (might be due to invalid IL or missing references)
			ulong num = 0uL;
			EVRInputError actionSetHandle = OpenVR.Input.GetActionSetHandle(fullPath.ToLower(), ref num);
			handle = num;
			if ((int)actionSetHandle != 0)
			{
				Debug.LogError((object)("<b>[SteamVR]</b> GetActionSetHandle (" + fullPath + ") error: " + ((object)(EVRInputError)(ref actionSetHandle)).ToString()));
			}
			initialized = true;
		}

		public bool IsActive(SteamVR_Input_Sources source = SteamVR_Input_Sources.Any)
		{
			if (initialized)
			{
				if (!rawSetActive[(int)source])
				{
					return rawSetActive[0];
				}
				return true;
			}
			return false;
		}

		public float GetTimeLastChanged(SteamVR_Input_Sources source = SteamVR_Input_Sources.Any)
		{
			if (initialized)
			{
				return rawSetLastChanged[(int)source];
			}
			return 0f;
		}

		public void Activate(SteamVR_Input_Sources activateForSource = SteamVR_Input_Sources.Any, int priority = 0, bool disableAllOtherActionSets = false)
		{
			if (disableAllOtherActionSets)
			{
				SteamVR_ActionSet_Manager.DisableAllActionSets();
			}
			if (!rawSetActive[(int)activateForSource])
			{
				rawSetActive[(int)activateForSource] = true;
				SteamVR_ActionSet_Manager.SetChanged();
				rawSetLastChanged[(int)activateForSource] = Time.realtimeSinceStartup;
			}
			if (rawSetPriority[(int)activateForSource] != priority)
			{
				rawSetPriority[(int)activateForSource] = priority;
				SteamVR_ActionSet_Manager.SetChanged();
				rawSetLastChanged[(int)activateForSource] = Time.realtimeSinceStartup;
			}
		}

		public void Deactivate(SteamVR_Input_Sources forSource = SteamVR_Input_Sources.Any)
		{
			if (rawSetActive[(int)forSource])
			{
				rawSetLastChanged[(int)forSource] = Time.realtimeSinceStartup;
				SteamVR_ActionSet_Manager.SetChanged();
			}
			rawSetActive[(int)forSource] = false;
			rawSetPriority[(int)forSource] = 0;
		}

		public string GetShortName()
		{
			if (cachedShortName == null)
			{
				cachedShortName = SteamVR_Input_ActionFile.GetShortName(fullPath);
			}
			return cachedShortName;
		}

		public bool ReadRawSetActive(SteamVR_Input_Sources inputSource)
		{
			return rawSetActive[(int)inputSource];
		}

		public float ReadRawSetLastChanged(SteamVR_Input_Sources inputSource)
		{
			return rawSetLastChanged[(int)inputSource];
		}

		public int ReadRawSetPriority(SteamVR_Input_Sources inputSource)
		{
			return rawSetPriority[(int)inputSource];
		}
	}
	public interface ISteamVR_ActionSet
	{
		SteamVR_Action[] allActions { get; }

		ISteamVR_Action_In[] nonVisualInActions { get; }

		ISteamVR_Action_In[] visualActions { get; }

		SteamVR_Action_Pose[] poseActions { get; }

		SteamVR_Action_Skeleton[] skeletonActions { get; }

		ISteamVR_Action_Out[] outActionArray { get; }

		string fullPath { get; }

		string usage { get; }

		ulong handle { get; }

		bool ReadRawSetActive(SteamVR_Input_Sources inputSource);

		float ReadRawSetLastChanged(SteamVR_Input_Sources inputSource);

		int ReadRawSetPriority(SteamVR_Input_Sources inputSource);

		bool IsActive(SteamVR_Input_Sources source = SteamVR_Input_Sources.Any);

		float GetTimeLastChanged(SteamVR_Input_Sources source = SteamVR_Input_Sources.Any);

		void Activate(SteamVR_Input_Sources activateForSource = SteamVR_Input_Sources.Any, int priority = 0, bool disableAllOtherActionSets = false);

		void Deactivate(SteamVR_Input_Sources forSource = SteamVR_Input_Sources.Any);

		string GetShortName();
	}
	public static class SteamVR_ActionSet_Manager
	{
		public static VRActiveActionSet_t[] rawActiveActionSetArray;

		[NonSerialized]
		private static uint activeActionSetSize;

		private static bool changed;

		private static int lastFrameUpdated;

		public static string debugActiveSetListText;

		public static bool updateDebugTextInBuilds;

		public static void Initialize()
		{
			activeActionSetSize = (uint)Marshal.SizeOf(typeof(VRActiveActionSet_t));
		}

		public static void DisableAllActionSets()
		{
			for (int i = 0; i < SteamVR_Input.actionSets.Length; i++)
			{
				SteamVR_Input.actionSets[i].Deactivate();
				SteamVR_Input.actionSets[i].Deactivate(SteamVR_Input_Sources.LeftHand);
				SteamVR_Input.actionSets[i].Deactivate(SteamVR_Input_Sources.RightHand);
			}
		}

		public static void UpdateActionStates(bool force = false)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			if (!force && Time.frameCount == lastFrameUpdated)
			{
				return;
			}
			lastFrameUpdated = Time.frameCount;
			if (changed)
			{
				UpdateActionSetsArray();
			}
			if (rawActiveActionSetArray != null && rawActiveActionSetArray.Length != 0 && OpenVR.Input != null)
			{
				EVRInputError val = OpenVR.Input.UpdateActionState(rawActiveActionSetArray, activeActionSetSize);
				if ((int)val != 0)
				{
					Debug.LogError((object)("<b>[SteamVR]</b> UpdateActionState error: " + ((object)(EVRInputError)(ref val)).ToString()));
				}
			}
		}

		public static void SetChanged()
		{
			changed = true;
		}

		private static void UpdateActionSetsArray()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			List<VRActiveActionSet_t> list = new List<VRActiveActionSet_t>();
			SteamVR_Input_Sources[] allSources = SteamVR_Input_Source.GetAllSources();
			for (int i = 0; i < SteamVR_Input.actionSets.Length; i++)
			{
				SteamVR_ActionSet steamVR_ActionSet = SteamVR_Input.actionSets[i];
				foreach (SteamVR_Input_Sources inputSource in allSources)
				{
					if (steamVR_ActionSet.ReadRawSetActive(inputSource))
					{
						VRActiveActionSet_t val = default(VRActiveActionSet_t);
						val.ulActionSet = steamVR_ActionSet.handle;
						val.nPriority = steamVR_ActionSet.ReadRawSetPriority(inputSource);
						val.ulRestrictedToDevice = SteamVR_Input_Source.GetHandle(inputSource);
						int num = 0;
						for (num = 0; num < list.Count && list[num].nPriority <= val.nPriority; num++)
						{
						}
						list.Insert(num, val);
					}
				}
			}
			changed = false;
			rawActiveActionSetArray = list.ToArray();
			if (Application.isEditor || updateDebugTextInBuilds)
			{
				UpdateDebugText();
			}
		}

		public static SteamVR_ActionSet GetSetFromHandle(ulong handle)
		{
			for (int i = 0; i < SteamVR_Input.actionSets.Length; i++)
			{
				SteamVR_ActionSet steamVR_ActionSet = SteamVR_Input.actionSets[i];
				if (steamVR_ActionSet.handle == handle)
				{
					return steamVR_ActionSet;
				}
			}
			return null;
		}

		private static void UpdateDebugText()
		{
			//IL_0010: 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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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)
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < rawActiveActionSetArray.Length; i++)
			{
				VRActiveActionSet_t val = rawActiveActionSetArray[i];
				stringBuilder.Append(val.nPriority);
				stringBuilder.Append("\t");
				stringBuilder.Append(SteamVR_Input_Source.GetSource(val.ulRestrictedToDevice));
				stringBuilder.Append("\t");
				stringBuilder.Append(GetSetFromHandle(val.ulActionSet).GetShortName());
				stringBuilder.Append("\n");
			}
			debugActiveSetListText = stringBuilder.ToString();
		}
	}
	[Serializable]
	public class SteamVR_Action_Boolean : SteamVR_Action_In<SteamVR_Action_Boolean_Source_Map, SteamVR_Action_Boolean_Source>, ISteamVR_Action_Boolean, ISteamVR_Action_In_Source, ISteamVR_Action_Source, ISerializationCallbackReceiver
	{
		public delegate void StateDownHandler(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource);

		public delegate void StateUpHandler(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource);

		public delegate void StateHandler(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource);

		public delegate void ActiveChangeHandler(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource, bool active);

		public delegate void ChangeHandler(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState);

		public delegate void UpdateHandler(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource, bool newState);

		public bool state => sourceMap[SteamVR_Input_Sources.Any].state;

		public bool stateDown => sourceMap[SteamVR_Input_Sources.Any].stateDown;

		public bool stateUp => sourceMap[SteamVR_Input_Sources.Any].stateUp;

		public bool lastState => sourceMap[SteamVR_Input_Sources.Any].lastState;

		public bool lastStateDown => sourceMap[SteamVR_Input_Sources.Any].lastStateDown;

		public bool lastStateUp => sourceMap[SteamVR_Input_Sources.Any].lastStateUp;

		public event ChangeHandler onChange
		{
			add
			{
				sourceMap[SteamVR_Input_Sources.Any].onChange += value;
			}
			remove
			{
				sourceMap[SteamVR_Input_Sources.Any].onChange -= value;
			}
		}

		public event UpdateHandler onUpdate
		{
			add
			{
				sourceMap[SteamVR_Input_Sources.Any].onUpdate += value;
			}
			remove
			{
				sourceMap[SteamVR_Input_Sources.Any].onUpdate -= value;
			}
		}

		public event StateHandler onState
		{
			add
			{
				sourceMap[SteamVR_Input_Sources.Any].onState += value;
			}
			remove
			{
				sourceMap[SteamVR_Input_Sources.Any].onState -= value;
			}
		}

		public event StateDownHandler onStateDown
		{
			add
			{
				sourceMap[SteamVR_Input_Sources.Any].onStateDown += value;
			}
			remove
			{
				sourceMap[SteamVR_Input_Sources.Any].onStateDown -= value;
			}
		}

		public event StateUpHandler onStateUp
		{
			add
			{
				sourceMap[SteamVR_Input_Sources.Any].onStateUp += value;
			}
			remove
			{
				sourceMap[SteamVR_Input_Sources.Any].onStateUp -= value;
			}
		}

		public event ActiveChangeHandler onActiveChange
		{
			add
			{
				sourceMap[SteamVR_Input_Sources.Any].onActiveChange += value;
			}
			remove
			{
				sourceMap[SteamVR_Input_Sources.Any].onActiveChange -= value;
			}
		}

		public event ActiveChangeHandler onActiveBindingChange
		{
			add
			{
				sourceMap[SteamVR_Input_Sources.Any].onActiveBindingChange += value;
			}
			remove
			{
				sourceMap[SteamVR_Input_Sources.Any].onActiveBindingChange -= value;
			}
		}

		public bool GetStateDown(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].stateDown;
		}

		public bool GetStateUp(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].stateUp;
		}

		public bool GetState(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].state;
		}

		public bool GetLastStateDown(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].lastStateDown;
		}

		public bool GetLastStateUp(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].lastStateUp;
		}

		public bool GetLastState(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].lastState;
		}

		public void AddOnActiveChangeListener(ActiveChangeHandler functionToCall, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onActiveChange += functionToCall;
		}

		public void RemoveOnActiveChangeListener(ActiveChangeHandler functionToStopCalling, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onActiveChange -= functionToStopCalling;
		}

		public void AddOnActiveBindingChangeListener(ActiveChangeHandler functionToCall, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onActiveBindingChange += functionToCall;
		}

		public void RemoveOnActiveBindingChangeListener(ActiveChangeHandler functionToStopCalling, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onActiveBindingChange -= functionToStopCalling;
		}

		public void AddOnChangeListener(ChangeHandler functionToCall, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onChange += functionToCall;
		}

		public void RemoveOnChangeListener(ChangeHandler functionToStopCalling, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onChange -= functionToStopCalling;
		}

		public void AddOnUpdateListener(UpdateHandler functionToCall, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onUpdate += functionToCall;
		}

		public void RemoveOnUpdateListener(UpdateHandler functionToStopCalling, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onUpdate -= functionToStopCalling;
		}

		public void AddOnStateDownListener(StateDownHandler functionToCall, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onStateDown += functionToCall;
		}

		public void RemoveOnStateDownListener(StateDownHandler functionToStopCalling, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onStateDown -= functionToStopCalling;
		}

		public void AddOnStateUpListener(StateUpHandler functionToCall, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onStateUp += functionToCall;
		}

		public void RemoveOnStateUpListener(StateUpHandler functionToStopCalling, SteamVR_Input_Sources inputSource)
		{
			sourceMap[inputSource].onStateUp -= functionToStopCalling;
		}

		public void RemoveAllListeners(SteamVR_Input_Sources input_Sources)
		{
			sourceMap[input_Sources].RemoveAllListeners();
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
		}

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			InitAfterDeserialize();
		}
	}
	public class SteamVR_Action_Boolean_Source_Map : SteamVR_Action_In_Source_Map<SteamVR_Action_Boolean_Source>
	{
	}
	public class SteamVR_Action_Boolean_Source : SteamVR_Action_In_Source, ISteamVR_Action_Boolean, ISteamVR_Action_In_Source, ISteamVR_Action_Source
	{
		protected static uint actionData_size;

		protected InputDigitalActionData_t actionData;

		protected InputDigitalActionData_t lastActionData;

		protected SteamVR_Action_Boolean booleanAction;

		public bool state
		{
			get
			{
				if (active)
				{
					return actionData.bState;
				}
				return false;
			}
		}

		public bool stateDown
		{
			get
			{
				if (active && actionData.bState)
				{
					return actionData.bChanged;
				}
				return false;
			}
		}

		public bool stateUp
		{
			get
			{
				if (active && !actionData.bState)
				{
					return actionData.bChanged;
				}
				return false;
			}
		}

		public override bool changed
		{
			get
			{
				if (active)
				{
					return actionData.bChanged;
				}
				return false;
			}
			protected set
			{
			}
		}

		public bool lastState => lastActionData.bState;

		public bool lastStateDown
		{
			get
			{
				if (lastActionData.bState)
				{
					return lastActionData.bChanged;
				}
				return false;
			}
		}

		public bool lastStateUp
		{
			get
			{
				if (!lastActionData.bState)
				{
					return lastActionData.bChanged;
				}
				return false;
			}
		}

		public override bool lastChanged
		{
			get
			{
				return lastActionData.bChanged;
			}
			protected set
			{
			}
		}

		public override ulong activeOrigin
		{
			get
			{
				if (active)
				{
					return actionData.activeOrigin;
				}
				return 0uL;
			}
		}

		public override ulong lastActiveOrigin => lastActionData.activeOrigin;

		public override bool active
		{
			get
			{
				if (activeBinding)
				{
					return action.actionSet.IsActive(base.inputSource);
				}
				return false;
			}
		}

		public override bool activeBinding => actionData.bActive;

		public override bool lastActive { get; protected set; }

		public override bool lastActiveBinding => lastActionData.bActive;

		public event SteamVR_Action_Boolean.StateDownHandler onStateDown;

		public event SteamVR_Action_Boolean.StateUpHandler onStateUp;

		public event SteamVR_Action_Boolean.StateHandler onState;

		public event SteamVR_Action_Boolean.ActiveChangeHandler onActiveChange;

		public event SteamVR_Action_Boolean.ActiveChangeHandler onActiveBindingChange;

		public event SteamVR_Action_Boolean.ChangeHandler onChange;

		public event SteamVR_Action_Boolean.UpdateHandler onUpdate;

		public override void Preinitialize(SteamVR_Action wrappingAction, SteamVR_Input_Sources forInputSource)
		{
			base.Preinitialize(wrappingAction, forInputSource);
			booleanAction = (SteamVR_Action_Boolean)wrappingAction;
		}

		public override void Initialize()
		{
			base.Initialize();
			if (actionData_size == 0)
			{
				actionData_size = (uint)Marshal.SizeOf(typeof(InputDigitalActionData_t));
			}
		}

		public void RemoveAllListeners()
		{
			Delegate[] invocationList;
			if (this.onStateDown != null)
			{
				invocationList = this.onStateDown.GetInvocationList();
				if (invocationList != null)
				{
					Delegate[] array = invocationList;
					foreach (Delegate @delegate in array)
					{
						onStateDown -= (SteamVR_Action_Boolean.StateDownHandler)@delegate;
					}
				}
			}
			if (this.onStateUp != null)
			{
				invocationList = this.onStateUp.GetInvocationList();
				if (invocationList != null)
				{
					Delegate[] array = invocationList;
					foreach (Delegate delegate2 in array)
					{
						onStateUp -= (SteamVR_Action_Boolean.StateUpHandler)delegate2;
					}
				}
			}
			if (this.onState == null)
			{
				return;
			}
			invocationList = this.onState.GetInvocationList();
			if (invocationList != null)
			{
				Delegate[] array = invocationList;
				foreach (Delegate delegate3 in array)
				{
					onState -= (SteamVR_Action_Boolean.StateHandler)delegate3;
				}
			}
		}

		public override void UpdateValue()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			lastActionData = actionData;
			lastActive = active;
			EVRInputError digitalActionData = OpenVR.Input.GetDigitalActionData(action.handle, ref actionData, actionData_size, inputSourceHandle);
			if ((int)digitalActionData != 0)
			{
				Debug.LogError((object)("<b>[SteamVR]</b> GetDigitalActionData error (" + action.fullPath + "): " + ((object)(EVRInputError)(ref digitalActionData)).ToString() + " handle: " + action.handle));
			}
			if (changed)
			{
				base.changedTime = Time.realtimeSinceStartup + actionData.fUpdateTime;
			}
			base.updateTime = Time.realtimeSinceStartup;
			if (active)
			{
				if (this.onStateDown != null && stateDown)
				{
					this.onStateDown(booleanAction, base.inputSource);
				}
				if (this.onStateUp != null && stateUp)
				{
					this.onStateUp(booleanAction, base.inputSource);
				}
				if (this.onState != null && state)
				{
					this.onState(booleanAction, base.inputSource);
				}
				if (this.onChange != null && changed)
				{
					this.onChange(booleanAction, base.inputSource, state);
				}
				if (this.onUpdate != null)
				{
					this.onUpdate(booleanAction, base.inputSource, state);
				}
			}
			if (this.onActiveBindingChange != null && lastActiveBinding != activeBinding)
			{
				this.onActiveBindingChange(booleanAction, base.inputSource, activeBinding);
			}
			if (this.onActiveChange != null && lastActive != active)
			{
				this.onActiveChange(booleanAction, base.inputSource, activeBinding);
			}
		}
	}
	public interface ISteamVR_Action_Boolean : ISteamVR_Action_In_Source, ISteamVR_Action_Source
	{
		bool state { get; }

		bool stateDown { get; }

		bool stateUp { get; }

		bool lastState { get; }

		bool lastStateDown { get; }

		bool lastStateUp { get; }
	}
	[Serializable]
	public abstract class SteamVR_Action_In<SourceMap, SourceElement> : SteamVR_Action<SourceMap, SourceElement>, ISteamVR_Action_In, ISteamVR_Action, ISteamVR_Action_Source, ISteamVR_Action_In_Source where SourceMap : SteamVR_Action_In_Source_Map<SourceElement>, new() where SourceElement : SteamVR_Action_In_Source, new()
	{
		public bool changed => sourceMap[SteamVR_Input_Sources.Any].changed;

		public bool lastChanged => sourceMap[SteamVR_Input_Sources.Any].changed;

		public float changedTime => sourceMap[SteamVR_Input_Sources.Any].changedTime;

		public float updateTime => sourceMap[SteamVR_Input_Sources.Any].updateTime;

		public ulong activeOrigin => sourceMap[SteamVR_Input_Sources.Any].activeOrigin;

		public ulong lastActiveOrigin => sourceMap[SteamVR_Input_Sources.Any].lastActiveOrigin;

		public SteamVR_Input_Sources activeDevice => sourceMap[SteamVR_Input_Sources.Any].activeDevice;

		public uint trackedDeviceIndex => sourceMap[SteamVR_Input_Sources.Any].trackedDeviceIndex;

		public string renderModelComponentName => sourceMap[SteamVR_Input_Sources.Any].renderModelComponentName;

		public string localizedOriginName => sourceMap[SteamVR_Input_Sources.Any].localizedOriginName;

		public virtual void UpdateValues()
		{
			sourceMap.UpdateValues();
		}

		public virtual string GetRenderModelComponentName(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].renderModelComponentName;
		}

		public virtual SteamVR_Input_Sources GetActiveDevice(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].activeDevice;
		}

		public virtual uint GetDeviceIndex(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].trackedDeviceIndex;
		}

		public virtual bool GetChanged(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].changed;
		}

		public override float GetTimeLastChanged(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].changedTime;
		}

		public string GetLocalizedOriginPart(SteamVR_Input_Sources inputSource, params EVRInputStringBits[] localizedParts)
		{
			return sourceMap[inputSource].GetLocalizedOriginPart(localizedParts);
		}

		public string GetLocalizedOrigin(SteamVR_Input_Sources inputSource)
		{
			return sourceMap[inputSource].GetLocalizedOrigin();
		}

		public override bool IsUpdating(SteamVR_Input_Sources inputSource)
		{
			return sourceMap.IsUpdating(inputSource);
		}

		public void ForceAddSourceToUpdateList(SteamVR_Input_Sources inputSource)
		{
			sourceMap.ForceAddSourceToUpdateList(inputSource);
		}

		public string GetControllerType(SteamVR_Input_Sources inputSource)
		{
			return SteamVR.instance.GetStringProperty((ETrackedDeviceProperty)7000, GetDeviceIndex(inputSource));
		}
	}
	public class SteamVR_Action_In_Source_Map<SourceElement> : SteamVR_Action_Source_Map<SourceElement> where SourceElement : SteamVR_Action_In_Source, new()
	{
		protected List<int> updatingSources = new List<int>();

		public bool IsUpdating(SteamVR_Input_Sources inputSource)
		{
			for (int i = 0; i < updatingSources.Count; i++)
			{
				if (inputSource == (SteamVR_Input_Sources)updatingSources[i])
				{
					return true;
				}
			}
			return false;
		}

		protected override void OnAccessSource(SteamVR_Input_Sources inputSource)
		{
			if (SteamVR_Action.startUpdatingSourceOnAccess)
			{
				ForceAddSourceToUpdateList(inputSource);
			}
		}

		public void ForceAddSourceToUpdateList(SteamVR_Input_Sources inputSource)
		{
			if (sources[(int)inputSource] == null)
			{
				sources[(int)inputSource] = new SourceElement();
			}
			if (!sources[(int)inputSource].isUpdating)
			{
				updatingSources.Add((int)inputSource);
				sources[(int)inputSource].isUpdating = true;
				if (!SteamVR_Input.isStartupFrame)
				{
					sources[(int)inputSource].UpdateValue();
				}
			}
		}

		public void UpdateValues()
		{
			for (int i = 0; i < updatingSources.Count; i++)
			{
				sources[updatingSources[i]].UpdateValue();
			}
		}
	}
	public abstract class SteamVR_Action_In_Source : SteamVR_Action_Source, ISteamVR_Action_In_Source, ISteamVR_Action_Source
	{
		protected static uint inputOriginInfo_size;

		protected InputOriginInfo_t inputOriginInfo;

		protected InputOriginInfo_t lastInputOriginInfo;

		public bool isUpdating { get; set; }

		public float updateTime { get; protected set; }

		public abstract ulong activeOrigin { get; }

		public abstract ulong lastActiveOrigin { get; }

		public abstract bool changed { get; protected set; }

		public abstract bool lastChanged { get; protected set; }

		public SteamVR_Input_Sources activeDevice
		{
			get
			{
				UpdateOriginTrackedDeviceInfo();
				return SteamVR_Input_Source.GetSource(inputOriginInfo.devicePath);
			}
		}

		public uint trackedDeviceIndex
		{
			get
			{
				UpdateOriginTrackedDeviceInfo();
				return inputOriginInfo.trackedDeviceIndex;
			}
		}

		public string renderModelComponentName
		{
			get
			{
				UpdateOriginTrackedDeviceInfo();
				return ((InputOriginInfo_t)(ref inputOriginInfo)).rchRenderModelComponentName;
			}
		}

		public string localizedOriginName
		{
			get
			{
				UpdateOriginTrackedDeviceInfo();
				return GetLocalizedOrigin();
			}
		}

		public float changedTime { get; protected set; }

		protected int lastOriginGetFrame { get; set; }

		public abstract void UpdateValue();

		public override void Initialize()
		{
			base.Initialize();
			if (inputOriginInfo_size == 0)
			{
				inputOriginInfo_size = (uint)Marshal.SizeOf(typeof(InputOriginInfo_t));
			}
		}

		protected void UpdateOriginTrackedDeviceInfo()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			if (lastOriginGetFrame != Time.frameCount)
			{
				EVRInputError originTrackedDeviceInfo = OpenVR.Input.GetOriginTrackedDeviceInfo(activeOrigin, ref inputOriginInfo, inputOriginInfo_size);
				if ((int)originTrackedDeviceInfo != 0)
				{
					Debug.LogError((object)("<b>[SteamVR]</b> GetOriginTrackedDeviceInfo error (" + base.fullPath + "): " + ((object)(EVRInputError)(ref originTrackedDeviceInfo)).ToString() + " handle: " + base.handle + " activeOrigin: " + activeOrigin + " active: " + active));
				}
				lastInputOriginInfo = inputOriginInfo;
				lastOriginGetFrame = Time.frameCount;
			}
		}

		public string GetLocalizedOriginPart(params EVRInputStringBits[] localizedParts)
		{
			UpdateOriginTrackedDeviceInfo();
			if (active)
			{
				return SteamVR_Input.GetLocalizedName(activeOrigin, localizedParts);
			}
			return null;
		}

		public string GetLocalizedOrigin()
		{
			UpdateOriginTrackedDeviceInfo();
			if (active)
			{
				return SteamVR_Input.GetLocalizedName(activeOrigin, (EVRInputStringBits)(-1));
			}
			return null;
		}
	}
	public interface ISteamVR_Action_In : ISteamVR_Action, ISteamVR_Action_Source, ISteamVR_Action_In_Source
	{
		void UpdateValues();

		string GetRenderModelComponentName(SteamVR_Input_Sources inputSource);

		SteamVR_Input_Sources GetActiveDevice(SteamVR_Input_Sources inputSource);

		uint GetDeviceIndex(SteamVR_Input_Sources inputSource);

		bool GetChanged(SteamVR_Input_Sources inputSource);

		string GetLocalizedOriginPart(SteamVR_Input_Sources inputSource, params EVRInputStringBits[] localizedParts);

		string GetLocalizedOrigin(SteamVR_Input_Sources inputSource);
	}
	public interface ISteamVR_Action_In_Source : ISteamVR_Action_Source
	{
		bool changed { get; }

		bool lastChanged { get; }

		float changedTime { get; }

		float updateTime { get; }

		ulong activeOrigin { get; }

		ulong lastActiveOrigin { get; }

		SteamVR_Input_Sources activeDevice { get; }

		uint trackedDeviceIndex { get; }

		string renderModelComponentName { get; }

		string localizedOriginName { get; }
	}
	[Serializable]
	public abstract class SteamVR_Action_Out<SourceMap, SourceElement> : SteamVR_Action<SourceMap, SourceElement>, ISteamVR_Action_Out, ISteamVR_Action, ISteamVR_Action_Source, ISteamVR_Action_Out_Source where SourceMap : SteamVR_Action_Source_Map<SourceElement>, new() where SourceElement : SteamVR_Action_Out_Source, new()
	{
	}
	public abstract class SteamVR_Action_Out_Source : SteamVR_Action_Source, ISteamVR_Action_Out_Source, ISteamVR_Action_Source
	{
	}
	public interface ISteamVR_Action_Out : ISteamVR_Action, ISteamVR_Action_Sou

BepInEx/patchers/MoveToGame/Managed/SteamVR_Actions.dll

Decompiled a month ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Valve.VR;

public class SteamVR_Input_ActionSet_NewSet : SteamVR_ActionSet
{
}
public class SteamVR_Input_ActionSet_default : SteamVR_ActionSet
{
	public virtual SteamVR_Action_Single LeftTrigger => SteamVR_Actions.default_LeftTrigger;

	public virtual SteamVR_Action_Single RightTrigger => SteamVR_Actions.default_RightTrigger;

	public virtual SteamVR_Action_Boolean LeftGrip => SteamVR_Actions.default_LeftGrip;

	public virtual SteamVR_Action_Boolean RightGrip => SteamVR_Actions.default_RightGrip;

	public virtual SteamVR_Action_Vector2 LeftJoystick => SteamVR_Actions.default_LeftJoystick;

	public virtual SteamVR_Action_Vector2 RightJoystick => SteamVR_Actions.default_RightJoystick;

	public virtual SteamVR_Action_Boolean ClickLeftJoystick => SteamVR_Actions.default_ClickLeftJoystick;

	public virtual SteamVR_Action_Boolean ClickRightJoystick => SteamVR_Actions.default_ClickRightJoystick;

	public virtual SteamVR_Action_Boolean ButtonB => SteamVR_Actions.default_ButtonB;

	public virtual SteamVR_Action_Boolean ButtonY => SteamVR_Actions.default_ButtonY;

	public virtual SteamVR_Action_Boolean ButtonA => SteamVR_Actions.default_ButtonA;

	public virtual SteamVR_Action_Boolean ButtonX => SteamVR_Actions.default_ButtonX;

	public virtual SteamVR_Action_Boolean NorthDPAD => SteamVR_Actions.default_NorthDPAD;

	public virtual SteamVR_Action_Boolean EastDPAD => SteamVR_Actions.default_EastDPAD;

	public virtual SteamVR_Action_Boolean SouthDPAD => SteamVR_Actions.default_SouthDPAD;

	public virtual SteamVR_Action_Boolean WestDPAD => SteamVR_Actions.default_WestDPAD;

	public virtual SteamVR_Action_Boolean Back => SteamVR_Actions.default_Back;

	public virtual SteamVR_Action_Boolean Start => SteamVR_Actions.default_Start;

	public virtual SteamVR_Action_Skeleton SkeletonLeftHand => SteamVR_Actions.default_SkeletonLeftHand;

	public virtual SteamVR_Action_Skeleton SkeletonRightHand => SteamVR_Actions.default_SkeletonRightHand;

	public virtual SteamVR_Action_Pose LeftHandPose => SteamVR_Actions.default_LeftHandPose;

	public virtual SteamVR_Action_Pose RightHandPose => SteamVR_Actions.default_RightHandPose;

	public virtual SteamVR_Action_Vibration Haptic => SteamVR_Actions.default_Haptic;
}
public class SteamVR_Actions
{
	private static SteamVR_Input_ActionSet_default p__default;

	private static SteamVR_Input_ActionSet_NewSet p_NewSet;

	private static SteamVR_Action_Single p_default_LeftTrigger;

	private static SteamVR_Action_Single p_default_RightTrigger;

	private static SteamVR_Action_Boolean p_default_LeftGrip;

	private static SteamVR_Action_Boolean p_default_RightGrip;

	private static SteamVR_Action_Vector2 p_default_LeftJoystick;

	private static SteamVR_Action_Vector2 p_default_RightJoystick;

	private static SteamVR_Action_Boolean p_default_ClickLeftJoystick;

	private static SteamVR_Action_Boolean p_default_ClickRightJoystick;

	private static SteamVR_Action_Boolean p_default_ButtonB;

	private static SteamVR_Action_Boolean p_default_ButtonY;

	private static SteamVR_Action_Boolean p_default_ButtonA;

	private static SteamVR_Action_Boolean p_default_ButtonX;

	private static SteamVR_Action_Boolean p_default_NorthDPAD;

	private static SteamVR_Action_Boolean p_default_EastDPAD;

	private static SteamVR_Action_Boolean p_default_SouthDPAD;

	private static SteamVR_Action_Boolean p_default_WestDPAD;

	private static SteamVR_Action_Boolean p_default_Back;

	private static SteamVR_Action_Boolean p_default_Start;

	private static SteamVR_Action_Skeleton p_default_SkeletonLeftHand;

	private static SteamVR_Action_Skeleton p_default_SkeletonRightHand;

	private static SteamVR_Action_Pose p_default_LeftHandPose;

	private static SteamVR_Action_Pose p_default_RightHandPose;

	private static SteamVR_Action_Vibration p_default_Haptic;

	public static SteamVR_Input_ActionSet_default _default => ((SteamVR_ActionSet)p__default).GetCopy<SteamVR_Input_ActionSet_default>();

	public static SteamVR_Input_ActionSet_NewSet NewSet => ((SteamVR_ActionSet)p_NewSet).GetCopy<SteamVR_Input_ActionSet_NewSet>();

	public static SteamVR_Action_Single default_LeftTrigger => ((SteamVR_Action)p_default_LeftTrigger).GetCopy<SteamVR_Action_Single>();

	public static SteamVR_Action_Single default_RightTrigger => ((SteamVR_Action)p_default_RightTrigger).GetCopy<SteamVR_Action_Single>();

	public static SteamVR_Action_Boolean default_LeftGrip => ((SteamVR_Action)p_default_LeftGrip).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_RightGrip => ((SteamVR_Action)p_default_RightGrip).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Vector2 default_LeftJoystick => ((SteamVR_Action)p_default_LeftJoystick).GetCopy<SteamVR_Action_Vector2>();

	public static SteamVR_Action_Vector2 default_RightJoystick => ((SteamVR_Action)p_default_RightJoystick).GetCopy<SteamVR_Action_Vector2>();

	public static SteamVR_Action_Boolean default_ClickLeftJoystick => ((SteamVR_Action)p_default_ClickLeftJoystick).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_ClickRightJoystick => ((SteamVR_Action)p_default_ClickRightJoystick).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_ButtonB => ((SteamVR_Action)p_default_ButtonB).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_ButtonY => ((SteamVR_Action)p_default_ButtonY).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_ButtonA => ((SteamVR_Action)p_default_ButtonA).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_ButtonX => ((SteamVR_Action)p_default_ButtonX).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_NorthDPAD => ((SteamVR_Action)p_default_NorthDPAD).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_EastDPAD => ((SteamVR_Action)p_default_EastDPAD).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_SouthDPAD => ((SteamVR_Action)p_default_SouthDPAD).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_WestDPAD => ((SteamVR_Action)p_default_WestDPAD).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_Back => ((SteamVR_Action)p_default_Back).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Boolean default_Start => ((SteamVR_Action)p_default_Start).GetCopy<SteamVR_Action_Boolean>();

	public static SteamVR_Action_Skeleton default_SkeletonLeftHand => ((SteamVR_Action)p_default_SkeletonLeftHand).GetCopy<SteamVR_Action_Skeleton>();

	public static SteamVR_Action_Skeleton default_SkeletonRightHand => ((SteamVR_Action)p_default_SkeletonRightHand).GetCopy<SteamVR_Action_Skeleton>();

	public static SteamVR_Action_Pose default_LeftHandPose => ((SteamVR_Action)p_default_LeftHandPose).GetCopy<SteamVR_Action_Pose>();

	public static SteamVR_Action_Pose default_RightHandPose => ((SteamVR_Action)p_default_RightHandPose).GetCopy<SteamVR_Action_Pose>();

	public static SteamVR_Action_Vibration default_Haptic => ((SteamVR_Action)p_default_Haptic).GetCopy<SteamVR_Action_Vibration>();

	private static void StartPreInitActionSets()
	{
		p__default = SteamVR_ActionSet.Create<SteamVR_Input_ActionSet_default>("/actions/default");
		p_NewSet = SteamVR_ActionSet.Create<SteamVR_Input_ActionSet_NewSet>("/actions/NewSet");
		SteamVR_Input.actionSets = (SteamVR_ActionSet[])(object)new SteamVR_ActionSet[2] { _default, NewSet };
	}

	private static void InitializeActionArrays()
	{
		SteamVR_Input.actions = (SteamVR_Action[])(object)new SteamVR_Action[23]
		{
			(SteamVR_Action)default_LeftTrigger,
			(SteamVR_Action)default_RightTrigger,
			(SteamVR_Action)default_LeftGrip,
			(SteamVR_Action)default_RightGrip,
			(SteamVR_Action)default_LeftJoystick,
			(SteamVR_Action)default_RightJoystick,
			(SteamVR_Action)default_ClickLeftJoystick,
			(SteamVR_Action)default_ClickRightJoystick,
			(SteamVR_Action)default_ButtonB,
			(SteamVR_Action)default_ButtonY,
			(SteamVR_Action)default_ButtonA,
			(SteamVR_Action)default_ButtonX,
			(SteamVR_Action)default_NorthDPAD,
			(SteamVR_Action)default_EastDPAD,
			(SteamVR_Action)default_SouthDPAD,
			(SteamVR_Action)default_WestDPAD,
			(SteamVR_Action)default_Back,
			(SteamVR_Action)default_Start,
			(SteamVR_Action)default_SkeletonLeftHand,
			(SteamVR_Action)default_SkeletonRightHand,
			(SteamVR_Action)default_LeftHandPose,
			(SteamVR_Action)default_RightHandPose,
			(SteamVR_Action)default_Haptic
		};
		SteamVR_Input.actionsIn = (ISteamVR_Action_In[])(object)new ISteamVR_Action_In[22]
		{
			(ISteamVR_Action_In)default_LeftTrigger,
			(ISteamVR_Action_In)default_RightTrigger,
			(ISteamVR_Action_In)default_LeftGrip,
			(ISteamVR_Action_In)default_RightGrip,
			(ISteamVR_Action_In)default_LeftJoystick,
			(ISteamVR_Action_In)default_RightJoystick,
			(ISteamVR_Action_In)default_ClickLeftJoystick,
			(ISteamVR_Action_In)default_ClickRightJoystick,
			(ISteamVR_Action_In)default_ButtonB,
			(ISteamVR_Action_In)default_ButtonY,
			(ISteamVR_Action_In)default_ButtonA,
			(ISteamVR_Action_In)default_ButtonX,
			(ISteamVR_Action_In)default_NorthDPAD,
			(ISteamVR_Action_In)default_EastDPAD,
			(ISteamVR_Action_In)default_SouthDPAD,
			(ISteamVR_Action_In)default_WestDPAD,
			(ISteamVR_Action_In)default_Back,
			(ISteamVR_Action_In)default_Start,
			(ISteamVR_Action_In)default_SkeletonLeftHand,
			(ISteamVR_Action_In)default_SkeletonRightHand,
			(ISteamVR_Action_In)default_LeftHandPose,
			(ISteamVR_Action_In)default_RightHandPose
		};
		SteamVR_Input.actionsOut = (ISteamVR_Action_Out[])(object)new ISteamVR_Action_Out[1] { (ISteamVR_Action_Out)default_Haptic };
		SteamVR_Input.actionsVibration = (SteamVR_Action_Vibration[])(object)new SteamVR_Action_Vibration[1] { default_Haptic };
		SteamVR_Input.actionsPose = (SteamVR_Action_Pose[])(object)new SteamVR_Action_Pose[2] { default_LeftHandPose, default_RightHandPose };
		SteamVR_Input.actionsBoolean = (SteamVR_Action_Boolean[])(object)new SteamVR_Action_Boolean[14]
		{
			default_LeftGrip, default_RightGrip, default_ClickLeftJoystick, default_ClickRightJoystick, default_ButtonB, default_ButtonY, default_ButtonA, default_ButtonX, default_NorthDPAD, default_EastDPAD,
			default_SouthDPAD, default_WestDPAD, default_Back, default_Start
		};
		SteamVR_Input.actionsSingle = (SteamVR_Action_Single[])(object)new SteamVR_Action_Single[2] { default_LeftTrigger, default_RightTrigger };
		SteamVR_Input.actionsVector2 = (SteamVR_Action_Vector2[])(object)new SteamVR_Action_Vector2[2] { default_LeftJoystick, default_RightJoystick };
		SteamVR_Input.actionsVector3 = (SteamVR_Action_Vector3[])(object)new SteamVR_Action_Vector3[0];
		SteamVR_Input.actionsSkeleton = (SteamVR_Action_Skeleton[])(object)new SteamVR_Action_Skeleton[2] { default_SkeletonLeftHand, default_SkeletonRightHand };
		SteamVR_Input.actionsNonPoseNonSkeletonIn = (ISteamVR_Action_In[])(object)new ISteamVR_Action_In[18]
		{
			(ISteamVR_Action_In)default_LeftTrigger,
			(ISteamVR_Action_In)default_RightTrigger,
			(ISteamVR_Action_In)default_LeftGrip,
			(ISteamVR_Action_In)default_RightGrip,
			(ISteamVR_Action_In)default_LeftJoystick,
			(ISteamVR_Action_In)default_RightJoystick,
			(ISteamVR_Action_In)default_ClickLeftJoystick,
			(ISteamVR_Action_In)default_ClickRightJoystick,
			(ISteamVR_Action_In)default_ButtonB,
			(ISteamVR_Action_In)default_ButtonY,
			(ISteamVR_Action_In)default_ButtonA,
			(ISteamVR_Action_In)default_ButtonX,
			(ISteamVR_Action_In)default_NorthDPAD,
			(ISteamVR_Action_In)default_EastDPAD,
			(ISteamVR_Action_In)default_SouthDPAD,
			(ISteamVR_Action_In)default_WestDPAD,
			(ISteamVR_Action_In)default_Back,
			(ISteamVR_Action_In)default_Start
		};
	}

	private static void PreInitActions()
	{
		p_default_LeftTrigger = SteamVR_Action.Create<SteamVR_Action_Single>("/actions/default/in/LeftTrigger");
		p_default_RightTrigger = SteamVR_Action.Create<SteamVR_Action_Single>("/actions/default/in/RightTrigger");
		p_default_LeftGrip = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/LeftGrip");
		p_default_RightGrip = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/RightGrip");
		p_default_LeftJoystick = SteamVR_Action.Create<SteamVR_Action_Vector2>("/actions/default/in/LeftJoystick");
		p_default_RightJoystick = SteamVR_Action.Create<SteamVR_Action_Vector2>("/actions/default/in/RightJoystick");
		p_default_ClickLeftJoystick = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/ClickLeftJoystick");
		p_default_ClickRightJoystick = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/ClickRightJoystick");
		p_default_ButtonB = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/ButtonB");
		p_default_ButtonY = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/ButtonY");
		p_default_ButtonA = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/ButtonA");
		p_default_ButtonX = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/ButtonX");
		p_default_NorthDPAD = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/NorthDPAD");
		p_default_EastDPAD = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/EastDPAD");
		p_default_SouthDPAD = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/SouthDPAD");
		p_default_WestDPAD = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/WestDPAD");
		p_default_Back = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/Back");
		p_default_Start = SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/Start");
		p_default_SkeletonLeftHand = SteamVR_Action.Create<SteamVR_Action_Skeleton>("/actions/default/in/SkeletonLeftHand");
		p_default_SkeletonRightHand = SteamVR_Action.Create<SteamVR_Action_Skeleton>("/actions/default/in/SkeletonRightHand");
		p_default_LeftHandPose = SteamVR_Action.Create<SteamVR_Action_Pose>("/actions/default/in/LeftHandPose");
		p_default_RightHandPose = SteamVR_Action.Create<SteamVR_Action_Pose>("/actions/default/in/RightHandPose");
		p_default_Haptic = SteamVR_Action.Create<SteamVR_Action_Vibration>("/actions/default/out/Haptic");
	}

	public static void PreInitialize()
	{
		StartPreInitActionSets();
		SteamVR_Input.PreinitializeActionSetDictionaries();
		PreInitActions();
		InitializeActionArrays();
		SteamVR_Input.PreinitializeActionDictionaries();
		SteamVR_Input.PreinitializeFinishActionSets();
	}
}

BepInEx/patchers/MoveToGame/Managed/Unity.XR.Management.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using UnityEngine.Rendering;
using UnityEngine.Serialization;

[assembly: InternalsVisibleTo("Unity.XR.Management.Editor")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: InternalsVisibleTo("Unity.XR.Management.Tests")]
[assembly: InternalsVisibleTo("Unity.XR.Management.EditorTests")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.XR.Management;

[AttributeUsage(AttributeTargets.Class)]
public sealed class XRConfigurationDataAttribute : Attribute
{
	public string displayName { get; set; }

	public string buildSettingsKey { get; set; }

	public XRConfigurationDataAttribute()
	{
	}

	public XRConfigurationDataAttribute(string displayName, string buildSettingsKey)
	{
		this.displayName = displayName;
		this.buildSettingsKey = buildSettingsKey;
	}
}
public class XRGeneralSettings : ScriptableObject
{
	public static string k_SettingsKey = "com.unity.xr.management.loader_settings";

	public static XRGeneralSettings s_RuntimeSettingsInstance = null;

	[SerializeField]
	public XRManagerSettings m_LoaderManagerInstance;

	[SerializeField]
	[Tooltip("Toggling this on/off will enable/disable the automatic startup of XR at run time.")]
	public bool m_InitManagerOnStart = true;

	public XRManagerSettings m_XRManager;

	public bool m_ProviderIntialized;

	public bool m_ProviderStarted;

	public XRManagerSettings Manager
	{
		get
		{
			return m_LoaderManagerInstance;
		}
		set
		{
			m_LoaderManagerInstance = value;
		}
	}

	public static XRGeneralSettings Instance => s_RuntimeSettingsInstance;

	public XRManagerSettings AssignedSettings => m_LoaderManagerInstance;

	public bool InitManagerOnStart => m_InitManagerOnStart;

	public void Awake()
	{
		Debug.Log((object)"XRGeneral Settings awakening...");
		s_RuntimeSettingsInstance = this;
		Application.quitting += Quit;
		Object.DontDestroyOnLoad((Object)(object)s_RuntimeSettingsInstance);
	}

	public static void Quit()
	{
		XRGeneralSettings instance = Instance;
		if (!((Object)(object)instance == (Object)null))
		{
			instance.DeInitXRSDK();
		}
	}

	public void Start()
	{
		StartXRSDK();
	}

	public void OnDestroy()
	{
		DeInitXRSDK();
	}

	[RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)]
	public static void AttemptInitializeXRSDKOnLoad()
	{
		XRGeneralSettings instance = Instance;
		if (!((Object)(object)instance == (Object)null) && instance.InitManagerOnStart)
		{
			instance.InitXRSDK();
		}
	}

	[RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)]
	public static void AttemptStartXRSDKOnBeforeSplashScreen()
	{
		XRGeneralSettings instance = Instance;
		if (!((Object)(object)instance == (Object)null) && instance.InitManagerOnStart)
		{
			instance.StartXRSDK();
		}
	}

	public void InitXRSDK()
	{
		if (!((Object)(object)Instance == (Object)null) && !((Object)(object)Instance.m_LoaderManagerInstance == (Object)null) && Instance.m_InitManagerOnStart)
		{
			m_XRManager = Instance.m_LoaderManagerInstance;
			if ((Object)(object)m_XRManager == (Object)null)
			{
				Debug.LogError((object)"Assigned GameObject for XR Management loading is invalid. No XR Providers will be automatically loaded.");
				return;
			}
			m_XRManager.automaticLoading = false;
			m_XRManager.automaticRunning = false;
			m_XRManager.InitializeLoaderSync();
			m_ProviderIntialized = true;
		}
	}

	public void StartXRSDK()
	{
		if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null)
		{
			m_XRManager.StartSubsystems();
			m_ProviderStarted = true;
		}
	}

	public void StopXRSDK()
	{
		if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null)
		{
			m_XRManager.StopSubsystems();
			m_ProviderStarted = false;
		}
	}

	public void DeInitXRSDK()
	{
		if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null)
		{
			m_XRManager.DeinitializeLoader();
			m_XRManager = null;
			m_ProviderIntialized = false;
		}
	}
}
public abstract class XRLoader : ScriptableObject
{
	public virtual bool Initialize()
	{
		return true;
	}

	public virtual bool Start()
	{
		return true;
	}

	public virtual bool Stop()
	{
		return true;
	}

	public virtual bool Deinitialize()
	{
		return true;
	}

	public abstract T GetLoadedSubsystem<T>() where T : class, ISubsystem;

	public virtual List<GraphicsDeviceType> GetSupportedGraphicsDeviceTypes(bool buildingPlayer)
	{
		return new List<GraphicsDeviceType>();
	}

	public XRLoader()
	{
	}
}
public abstract class XRLoaderHelper : XRLoader
{
	public Dictionary<Type, ISubsystem> m_SubsystemInstanceMap = new Dictionary<Type, ISubsystem>();

	public override T GetLoadedSubsystem<T>()
	{
		Type typeFromHandle = typeof(T);
		m_SubsystemInstanceMap.TryGetValue(typeFromHandle, out var value);
		return value as T;
	}

	public void StartSubsystem<T>() where T : class, ISubsystem
	{
		T loadedSubsystem = GetLoadedSubsystem<T>();
		if (loadedSubsystem != null)
		{
			((ISubsystem)loadedSubsystem).Start();
		}
	}

	public void StopSubsystem<T>() where T : class, ISubsystem
	{
		T loadedSubsystem = GetLoadedSubsystem<T>();
		if (loadedSubsystem != null)
		{
			((ISubsystem)loadedSubsystem).Stop();
		}
	}

	public void DestroySubsystem<T>() where T : class, ISubsystem
	{
		T loadedSubsystem = GetLoadedSubsystem<T>();
		if (loadedSubsystem != null)
		{
			Type typeFromHandle = typeof(T);
			if (m_SubsystemInstanceMap.ContainsKey(typeFromHandle))
			{
				m_SubsystemInstanceMap.Remove(typeFromHandle);
			}
			((ISubsystem)loadedSubsystem).Destroy();
		}
	}

	public void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem
	{
		if (descriptors == null)
		{
			throw new ArgumentNullException("descriptors");
		}
		SubsystemManager.GetSubsystemDescriptors<TDescriptor>(descriptors);
		if (descriptors.Count <= 0)
		{
			return;
		}
		foreach (TDescriptor descriptor in descriptors)
		{
			ISubsystem val = null;
			if (string.Compare(((ISubsystemDescriptor)descriptor).id, id, ignoreCase: true) == 0)
			{
				val = ((ISubsystemDescriptor)descriptor).Create();
			}
			if (val != null)
			{
				m_SubsystemInstanceMap[typeof(TSubsystem)] = val;
				break;
			}
		}
	}

	[Obsolete("This method is obsolete. Please use the geenric CreateSubsystem method.", false)]
	public void CreateIntegratedSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : IntegratedSubsystemDescriptor where TSubsystem : IntegratedSubsystem
	{
		this.CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id);
	}

	[Obsolete("This method is obsolete. Please use the generic CreateSubsystem method.", false)]
	public void CreateStandaloneSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : SubsystemDescriptor where TSubsystem : Subsystem
	{
		this.CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id);
	}

	public override bool Deinitialize()
	{
		m_SubsystemInstanceMap.Clear();
		return base.Deinitialize();
	}

	public XRLoaderHelper()
	{
	}
}
public static class XRManagementAnalytics
{
	[Serializable]
	public struct BuildEvent
	{
		public string buildGuid;

		public string buildTarget;

		public string buildTargetGroup;

		public string[] assigned_loaders;
	}

	public const int kMaxEventsPerHour = 1000;

	public const int kMaxNumberOfElements = 1000;

	public const string kVendorKey = "unity.xrmanagement";

	public const string kEventBuild = "xrmanagment_build";

	public static bool s_Initialized;

	public static bool Initialize()
	{
		return s_Initialized;
	}
}
public sealed class XRManagerSettings : ScriptableObject
{
	[HideInInspector]
	public bool m_InitializationComplete;

	[HideInInspector]
	[SerializeField]
	public bool m_RequiresSettingsUpdate;

	[Tooltip("Determines if the XR Manager instance is responsible for creating and destroying the appropriate loader instance.")]
	[FormerlySerializedAs("AutomaticLoading")]
	[SerializeField]
	public bool m_AutomaticLoading;

	[FormerlySerializedAs("AutomaticRunning")]
	[SerializeField]
	[Tooltip("Determines if the XR Manager instance is responsible for starting and stopping subsystems for the active loader instance.")]
	public bool m_AutomaticRunning;

	[SerializeField]
	[FormerlySerializedAs("Loaders")]
	[Tooltip("List of XR Loader instances arranged in desired load order.")]
	public List<XRLoader> m_Loaders = new List<XRLoader>();

	[SerializeField]
	[HideInInspector]
	public HashSet<XRLoader> m_RegisteredLoaders = new HashSet<XRLoader>();

	public bool automaticLoading
	{
		get
		{
			return m_AutomaticLoading;
		}
		set
		{
			m_AutomaticLoading = value;
		}
	}

	public bool automaticRunning
	{
		get
		{
			return m_AutomaticRunning;
		}
		set
		{
			m_AutomaticRunning = value;
		}
	}

	[Obsolete("'XRManagerSettings.loaders' property is obsolete. Use 'XRManagerSettings.activeLoaders' instead to get a list of the current loaders.")]
	public List<XRLoader> loaders => m_Loaders;

	public IReadOnlyList<XRLoader> activeLoaders => m_Loaders;

	public bool isInitializationComplete => m_InitializationComplete;

	[HideInInspector]
	public XRLoader activeLoader { get; set; }

	public List<XRLoader> currentLoaders
	{
		get
		{
			return m_Loaders;
		}
		set
		{
			m_Loaders = value;
		}
	}

	public HashSet<XRLoader> registeredLoaders => m_RegisteredLoaders;

	public T ActiveLoaderAs<T>() where T : XRLoader
	{
		return activeLoader as T;
	}

	public void InitializeLoaderSync()
	{
		if ((Object)(object)activeLoader != (Object)null)
		{
			Debug.LogWarning((object)"XR Management has already initialized an active loader in this scene. Please make sure to stop all subsystems and deinitialize the active loader before initializing a new one.");
			return;
		}
		foreach (XRLoader currentLoader in currentLoaders)
		{
			if ((Object)(object)currentLoader != (Object)null && CheckGraphicsAPICompatibility(currentLoader) && currentLoader.Initialize())
			{
				activeLoader = currentLoader;
				m_InitializationComplete = true;
				return;
			}
		}
		activeLoader = null;
	}

	public IEnumerator InitializeLoader()
	{
		if ((Object)(object)activeLoader != (Object)null)
		{
			Debug.LogWarning((object)"XR Management has already initialized an active loader in this scene. Please make sure to stop all subsystems and deinitialize the active loader before initializing a new one.");
			yield break;
		}
		foreach (XRLoader currentLoader in currentLoaders)
		{
			if ((Object)(object)currentLoader != (Object)null && CheckGraphicsAPICompatibility(currentLoader) && currentLoader.Initialize())
			{
				activeLoader = currentLoader;
				m_InitializationComplete = true;
				yield break;
			}
			yield return null;
		}
		activeLoader = null;
	}

	public bool TryAddLoader(XRLoader loader, int index = -1)
	{
		if ((Object)(object)loader == (Object)null || currentLoaders.Contains(loader))
		{
			return false;
		}
		if (!m_RegisteredLoaders.Contains(loader))
		{
			return false;
		}
		if (index < 0 || index >= currentLoaders.Count)
		{
			currentLoaders.Add(loader);
		}
		else
		{
			currentLoaders.Insert(index, loader);
		}
		return true;
	}

	public bool TryRemoveLoader(XRLoader loader)
	{
		bool result = true;
		if (currentLoaders.Contains(loader))
		{
			result = currentLoaders.Remove(loader);
		}
		return result;
	}

	public bool TrySetLoaders(List<XRLoader> reorderedLoaders)
	{
		List<XRLoader> list = new List<XRLoader>(activeLoaders);
		currentLoaders.Clear();
		foreach (XRLoader reorderedLoader in reorderedLoaders)
		{
			if (!TryAddLoader(reorderedLoader))
			{
				currentLoaders = list;
				return false;
			}
		}
		return true;
	}

	public bool CheckGraphicsAPICompatibility(XRLoader loader)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType;
		List<GraphicsDeviceType> supportedGraphicsDeviceTypes = loader.GetSupportedGraphicsDeviceTypes(buildingPlayer: false);
		if (supportedGraphicsDeviceTypes.Count > 0 && !supportedGraphicsDeviceTypes.Contains(graphicsDeviceType))
		{
			Debug.LogWarning((object)$"The {((Object)loader).name} does not support the initialized graphics device, {((object)(GraphicsDeviceType)(ref graphicsDeviceType)).ToString()}. Please change the preffered Graphics API in PlayerSettings. Attempting to start the next XR loader.");
			return false;
		}
		return true;
	}

	public void StartSubsystems()
	{
		if (!m_InitializationComplete)
		{
			Debug.LogWarning((object)"Call to StartSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API.");
		}
		else if ((Object)(object)activeLoader != (Object)null)
		{
			activeLoader.Start();
		}
	}

	public void StopSubsystems()
	{
		if (!m_InitializationComplete)
		{
			Debug.LogWarning((object)"Call to StopSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API.");
		}
		else if ((Object)(object)activeLoader != (Object)null)
		{
			activeLoader.Stop();
		}
	}

	public void DeinitializeLoader()
	{
		if (!m_InitializationComplete)
		{
			Debug.LogWarning((object)"Call to DeinitializeLoader without an initialized manager.Please make sure wait for initialization to complete before calling this API.");
			return;
		}
		StopSubsystems();
		if ((Object)(object)activeLoader != (Object)null)
		{
			activeLoader.Deinitialize();
			activeLoader = null;
		}
		m_InitializationComplete = false;
	}

	public void Start()
	{
		if (automaticLoading && automaticRunning)
		{
			StartSubsystems();
		}
	}

	public void OnDisable()
	{
		if (automaticLoading && automaticRunning)
		{
			StopSubsystems();
		}
	}

	public void OnDestroy()
	{
		if (automaticLoading)
		{
			DeinitializeLoader();
		}
	}
}

BepInEx/patchers/MoveToGame/Managed/Unity.XR.OpenVR.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using AOT;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.InputSystem.XR;
using UnityEngine.XR;
using UnityEngine.XR.Management;
using Valve.VR;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Valve.VR
{
	public struct IVRSystem
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetRecommendedRenderTargetSize(ref uint pnWidth, ref uint pnHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate HmdMatrix44_t _GetProjectionMatrix(EVREye eEye, float fNearZ, float fFarZ);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetProjectionRaw(EVREye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ComputeDistortion(EVREye eEye, float fU, float fV, ref DistortionCoordinates_t pDistortionCoordinates);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate HmdMatrix34_t _GetEyeToHeadTransform(EVREye eEye);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetTimeSinceLastVsync(ref float pfSecondsSinceLastVsync, ref ulong pulFrameCounter);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate int _GetD3D9AdapterIndex();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetOutputDevice(ref ulong pnDevice, ETextureType textureType, IntPtr pInstance);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsDisplayOnDesktop();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _SetDisplayVisibility(bool bIsVisibleOnDesktop);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, [In][Out] TrackedDevicePose_t[] pTrackedDevicePoseArray, uint unTrackedDevicePoseArrayCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate HmdMatrix34_t _GetSeatedZeroPoseToStandingAbsoluteTrackingPose();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate HmdMatrix34_t _GetRawZeroPoseToStandingAbsoluteTrackingPose();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetSortedTrackedDeviceIndicesOfClass(ETrackedDeviceClass eTrackedDeviceClass, [In][Out] uint[] punTrackedDeviceIndexArray, uint unTrackedDeviceIndexArrayCount, uint unRelativeToTrackedDeviceIndex);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EDeviceActivityLevel _GetTrackedDeviceActivityLevel(uint unDeviceId);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ApplyTransform(ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pTrackedDevicePose, ref HmdMatrix34_t pTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole unDeviceType);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedControllerRole _GetControllerRoleForTrackedDeviceIndex(uint unDeviceIndex);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedDeviceClass _GetTrackedDeviceClass(uint unDeviceIndex);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsTrackedDeviceConnected(uint unDeviceIndex);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetBoolTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate float _GetFloatTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate int _GetInt32TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ulong _GetUint64TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate HmdMatrix34_t _GetMatrix34TrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, ref ETrackedPropertyError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetArrayTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, uint propType, IntPtr pBuffer, uint unBufferSize, ref ETrackedPropertyError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetStringTrackedDeviceProperty(uint unDeviceIndex, ETrackedDeviceProperty prop, StringBuilder pchValue, uint unBufferSize, ref ETrackedPropertyError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetPropErrorNameFromEnum(ETrackedPropertyError error);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetEventTypeNameFromEnum(EVREventType eType);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate HiddenAreaMesh_t _GetHiddenAreaMesh(EVREye eEye, EHiddenAreaMeshType type);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetControllerState(uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin, uint unControllerDeviceIndex, ref VRControllerState_t pControllerState, uint unControllerStateSize, ref TrackedDevicePose_t pTrackedDevicePose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _TriggerHapticPulse(uint unControllerDeviceIndex, uint unAxisId, ushort usDurationMicroSec);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetButtonIdNameFromEnum(EVRButtonId eButtonId);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsInputAvailable();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsSteamVRDrawingControllers();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ShouldApplicationPause();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ShouldApplicationReduceRenderingWork();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRFirmwareError _PerformFirmwareUpdate(uint unDeviceIndex);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _AcknowledgeQuit_Exiting();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetAppContainerFilePaths(StringBuilder pchBuffer, uint unBufferSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetRuntimeVersion();

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRecommendedRenderTargetSize GetRecommendedRenderTargetSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetProjectionMatrix GetProjectionMatrix;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetProjectionRaw GetProjectionRaw;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ComputeDistortion ComputeDistortion;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetEyeToHeadTransform GetEyeToHeadTransform;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetTimeSinceLastVsync GetTimeSinceLastVsync;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetD3D9AdapterIndex GetD3D9AdapterIndex;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDXGIOutputInfo GetDXGIOutputInfo;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOutputDevice GetOutputDevice;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsDisplayOnDesktop IsDisplayOnDesktop;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetDisplayVisibility SetDisplayVisibility;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDeviceToAbsoluteTrackingPose GetDeviceToAbsoluteTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSeatedZeroPoseToStandingAbsoluteTrackingPose GetSeatedZeroPoseToStandingAbsoluteTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRawZeroPoseToStandingAbsoluteTrackingPose GetRawZeroPoseToStandingAbsoluteTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSortedTrackedDeviceIndicesOfClass GetSortedTrackedDeviceIndicesOfClass;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetTrackedDeviceActivityLevel GetTrackedDeviceActivityLevel;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ApplyTransform ApplyTransform;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetTrackedDeviceIndexForControllerRole GetTrackedDeviceIndexForControllerRole;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetControllerRoleForTrackedDeviceIndex GetControllerRoleForTrackedDeviceIndex;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetTrackedDeviceClass GetTrackedDeviceClass;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsTrackedDeviceConnected IsTrackedDeviceConnected;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetBoolTrackedDeviceProperty GetBoolTrackedDeviceProperty;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetFloatTrackedDeviceProperty GetFloatTrackedDeviceProperty;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetInt32TrackedDeviceProperty GetInt32TrackedDeviceProperty;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetUint64TrackedDeviceProperty GetUint64TrackedDeviceProperty;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetMatrix34TrackedDeviceProperty GetMatrix34TrackedDeviceProperty;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetArrayTrackedDeviceProperty GetArrayTrackedDeviceProperty;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetStringTrackedDeviceProperty GetStringTrackedDeviceProperty;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPropErrorNameFromEnum GetPropErrorNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PollNextEvent PollNextEvent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PollNextEventWithPose PollNextEventWithPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetEventTypeNameFromEnum GetEventTypeNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetHiddenAreaMesh GetHiddenAreaMesh;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetControllerState GetControllerState;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetControllerStateWithPose GetControllerStateWithPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _TriggerHapticPulse TriggerHapticPulse;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetButtonIdNameFromEnum GetButtonIdNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetControllerAxisTypeNameFromEnum GetControllerAxisTypeNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsInputAvailable IsInputAvailable;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsSteamVRDrawingControllers IsSteamVRDrawingControllers;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShouldApplicationPause ShouldApplicationPause;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShouldApplicationReduceRenderingWork ShouldApplicationReduceRenderingWork;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PerformFirmwareUpdate PerformFirmwareUpdate;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _AcknowledgeQuit_Exiting AcknowledgeQuit_Exiting;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetAppContainerFilePaths GetAppContainerFilePaths;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRuntimeVersion GetRuntimeVersion;
	}
	public struct IVRExtendedDisplay
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetWindowBounds(ref int pnX, ref int pnY, ref uint pnWidth, ref uint pnHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetEyeOutputViewport(EVREye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetDXGIOutputInfo(ref int pnAdapterIndex, ref int pnAdapterOutputIndex);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetWindowBounds GetWindowBounds;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetEyeOutputViewport GetEyeOutputViewport;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDXGIOutputInfo GetDXGIOutputInfo;
	}
	public struct IVRTrackedCamera
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetCameraErrorNameFromEnum(EVRTrackedCameraError eCameraError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _HasCamera(uint nDeviceIndex, ref bool pHasCamera);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _GetCameraFrameSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref uint pnWidth, ref uint pnHeight, ref uint pnFrameBufferSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _GetCameraIntrinsics(uint nDeviceIndex, uint nCameraIndex, EVRTrackedCameraFrameType eFrameType, ref HmdVector2_t pFocalLength, ref HmdVector2_t pCenter);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _GetCameraProjection(uint nDeviceIndex, uint nCameraIndex, EVRTrackedCameraFrameType eFrameType, float flZNear, float flZFar, ref HmdMatrix44_t pProjection);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _AcquireVideoStreamingService(uint nDeviceIndex, ref ulong pHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _ReleaseVideoStreamingService(ulong hTrackedCamera);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _GetVideoStreamFrameBuffer(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pFrameBuffer, uint nFrameBufferSize, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _GetVideoStreamTextureSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref VRTextureBounds_t pTextureBounds, ref uint pnWidth, ref uint pnHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _GetVideoStreamTextureD3D11(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _GetVideoStreamTextureGL(ulong hTrackedCamera, EVRTrackedCameraFrameType eFrameType, ref uint pglTextureId, ref CameraVideoStreamFrameHeader_t pFrameHeader, uint nFrameHeaderSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRTrackedCameraError _ReleaseVideoStreamTextureGL(ulong hTrackedCamera, uint glTextureId);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetCameraTrackingSpace(ETrackingUniverseOrigin eUniverse);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackingUniverseOrigin _GetCameraTrackingSpace();

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCameraErrorNameFromEnum GetCameraErrorNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HasCamera HasCamera;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCameraFrameSize GetCameraFrameSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCameraIntrinsics GetCameraIntrinsics;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCameraProjection GetCameraProjection;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _AcquireVideoStreamingService AcquireVideoStreamingService;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseVideoStreamingService ReleaseVideoStreamingService;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetVideoStreamFrameBuffer GetVideoStreamFrameBuffer;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetVideoStreamTextureSize GetVideoStreamTextureSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetVideoStreamTextureD3D11 GetVideoStreamTextureD3D11;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetVideoStreamTextureGL GetVideoStreamTextureGL;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseVideoStreamTextureGL ReleaseVideoStreamTextureGL;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetCameraTrackingSpace SetCameraTrackingSpace;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCameraTrackingSpace GetCameraTrackingSpace;
	}
	public struct IVRApplications
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _AddApplicationManifest(IntPtr pchApplicationManifestFullPath, bool bTemporary);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _RemoveApplicationManifest(IntPtr pchApplicationManifestFullPath);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsApplicationInstalled(IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetApplicationCount();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _GetApplicationKeyByIndex(uint unApplicationIndex, StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _GetApplicationKeyByProcessId(uint unProcessId, StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _LaunchApplication(IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _LaunchTemplateApplication(IntPtr pchTemplateAppKey, IntPtr pchNewAppKey, [In][Out] AppOverrideKeys_t[] pKeys, uint unKeys);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _LaunchApplicationFromMimeType(IntPtr pchMimeType, IntPtr pchArgs);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _LaunchDashboardOverlay(IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _CancelApplicationLaunch(IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _IdentifyApplication(uint unProcessId, IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetApplicationProcessId(IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetApplicationsErrorNameFromEnum(EVRApplicationError error);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetApplicationPropertyString(IntPtr pchAppKey, EVRApplicationProperty eProperty, StringBuilder pchPropertyValueBuffer, uint unPropertyValueBufferLen, ref EVRApplicationError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetApplicationPropertyBool(IntPtr pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ulong _GetApplicationPropertyUint64(IntPtr pchAppKey, EVRApplicationProperty eProperty, ref EVRApplicationError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _SetApplicationAutoLaunch(IntPtr pchAppKey, bool bAutoLaunch);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetApplicationAutoLaunch(IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _SetDefaultApplicationForMimeType(IntPtr pchAppKey, IntPtr pchMimeType);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetDefaultApplicationForMimeType(IntPtr pchMimeType, StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetApplicationSupportedMimeTypes(IntPtr pchAppKey, StringBuilder pchMimeTypesBuffer, uint unMimeTypesBuffer);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetApplicationsThatSupportMimeType(IntPtr pchMimeType, StringBuilder pchAppKeysThatSupportBuffer, uint unAppKeysThatSupportBuffer);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetApplicationLaunchArguments(uint unHandle, StringBuilder pchArgs, uint unArgs);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _GetStartingApplication(StringBuilder pchAppKeyBuffer, uint unAppKeyBufferLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRSceneApplicationState _GetSceneApplicationState();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _PerformApplicationPrelaunchCheck(IntPtr pchAppKey);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetSceneApplicationStateNameFromEnum(EVRSceneApplicationState state);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRApplicationError _LaunchInternalProcess(IntPtr pchBinaryPath, IntPtr pchArguments, IntPtr pchWorkingDirectory);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetCurrentSceneProcessId();

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _AddApplicationManifest AddApplicationManifest;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RemoveApplicationManifest RemoveApplicationManifest;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsApplicationInstalled IsApplicationInstalled;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationCount GetApplicationCount;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationKeyByIndex GetApplicationKeyByIndex;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationKeyByProcessId GetApplicationKeyByProcessId;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LaunchApplication LaunchApplication;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LaunchTemplateApplication LaunchTemplateApplication;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LaunchApplicationFromMimeType LaunchApplicationFromMimeType;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LaunchDashboardOverlay LaunchDashboardOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CancelApplicationLaunch CancelApplicationLaunch;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IdentifyApplication IdentifyApplication;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationProcessId GetApplicationProcessId;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationsErrorNameFromEnum GetApplicationsErrorNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationPropertyString GetApplicationPropertyString;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationPropertyBool GetApplicationPropertyBool;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationPropertyUint64 GetApplicationPropertyUint64;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetApplicationAutoLaunch SetApplicationAutoLaunch;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationAutoLaunch GetApplicationAutoLaunch;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetDefaultApplicationForMimeType SetDefaultApplicationForMimeType;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDefaultApplicationForMimeType GetDefaultApplicationForMimeType;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationSupportedMimeTypes GetApplicationSupportedMimeTypes;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationsThatSupportMimeType GetApplicationsThatSupportMimeType;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetApplicationLaunchArguments GetApplicationLaunchArguments;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetStartingApplication GetStartingApplication;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSceneApplicationState GetSceneApplicationState;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PerformApplicationPrelaunchCheck PerformApplicationPrelaunchCheck;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSceneApplicationStateNameFromEnum GetSceneApplicationStateNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LaunchInternalProcess LaunchInternalProcess;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCurrentSceneProcessId GetCurrentSceneProcessId;
	}
	public struct IVRChaperone
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ChaperoneCalibrationState _GetCalibrationState();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetPlayAreaSize(ref float pSizeX, ref float pSizeZ);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetPlayAreaRect(ref HmdQuad_t rect);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ReloadInfo();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetSceneColor(HmdColor_t color);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetBoundsColor(ref HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, ref HmdColor_t pOutputCameraColor);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _AreBoundsVisible();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ForceBoundsVisible(bool bForce);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ResetZeroPose(ETrackingUniverseOrigin eTrackingUniverseOrigin);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCalibrationState GetCalibrationState;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPlayAreaSize GetPlayAreaSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPlayAreaRect GetPlayAreaRect;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReloadInfo ReloadInfo;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetSceneColor SetSceneColor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetBoundsColor GetBoundsColor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _AreBoundsVisible AreBoundsVisible;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ForceBoundsVisible ForceBoundsVisible;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ResetZeroPose ResetZeroPose;
	}
	public struct IVRChaperoneSetup
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _CommitWorkingCopy(EChaperoneConfigFile configFile);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _RevertWorkingCopy();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetWorkingPlayAreaSize(ref float pSizeX, ref float pSizeZ);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetWorkingPlayAreaRect(ref HmdQuad_t rect);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetWorkingCollisionBoundsInfo([In][Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetLiveCollisionBoundsInfo([In][Out] HmdQuad_t[] pQuadsBuffer, ref uint punQuadsCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetWorkingPlayAreaSize(float sizeX, float sizeZ);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetWorkingCollisionBoundsInfo([In][Out] HmdQuad_t[] pQuadsBuffer, uint unQuadsCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetWorkingPerimeter([In][Out] HmdVector2_t[] pPointBuffer, uint unPointCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetWorkingSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetWorkingStandingZeroPoseToRawTrackingPose(ref HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ReloadFromDisk(EChaperoneConfigFile configFile);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetLiveSeatedZeroPoseToRawTrackingPose(ref HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ExportLiveToBuffer(StringBuilder pBuffer, ref uint pnBufferLength);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ImportFromBufferToWorking(IntPtr pBuffer, uint nImportFlags);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ShowWorkingSetPreview();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _HideWorkingSetPreview();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _RoomSetupStarting();

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CommitWorkingCopy CommitWorkingCopy;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RevertWorkingCopy RevertWorkingCopy;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetWorkingPlayAreaSize GetWorkingPlayAreaSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetWorkingPlayAreaRect GetWorkingPlayAreaRect;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetWorkingCollisionBoundsInfo GetWorkingCollisionBoundsInfo;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetLiveCollisionBoundsInfo GetLiveCollisionBoundsInfo;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetWorkingSeatedZeroPoseToRawTrackingPose GetWorkingSeatedZeroPoseToRawTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetWorkingStandingZeroPoseToRawTrackingPose GetWorkingStandingZeroPoseToRawTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetWorkingPlayAreaSize SetWorkingPlayAreaSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetWorkingCollisionBoundsInfo SetWorkingCollisionBoundsInfo;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetWorkingPerimeter SetWorkingPerimeter;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetWorkingSeatedZeroPoseToRawTrackingPose SetWorkingSeatedZeroPoseToRawTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetWorkingStandingZeroPoseToRawTrackingPose SetWorkingStandingZeroPoseToRawTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReloadFromDisk ReloadFromDisk;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetLiveSeatedZeroPoseToRawTrackingPose GetLiveSeatedZeroPoseToRawTrackingPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ExportLiveToBuffer ExportLiveToBuffer;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ImportFromBufferToWorking ImportFromBufferToWorking;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowWorkingSetPreview ShowWorkingSetPreview;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HideWorkingSetPreview HideWorkingSetPreview;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RoomSetupStarting RoomSetupStarting;
	}
	public struct IVRCompositor
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetTrackingSpace(ETrackingUniverseOrigin eOrigin);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackingUniverseOrigin _GetTrackingSpace();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _WaitGetPoses([In][Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In][Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _GetLastPoses([In][Out] TrackedDevicePose_t[] pRenderPoseArray, uint unRenderPoseArrayCount, [In][Out] TrackedDevicePose_t[] pGamePoseArray, uint unGamePoseArrayCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _GetLastPoseForTrackedDeviceIndex(uint unDeviceIndex, ref TrackedDevicePose_t pOutputPose, ref TrackedDevicePose_t pOutputGamePose);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _Submit(EVREye eEye, ref Texture_t pTexture, ref VRTextureBounds_t pBounds, EVRSubmitFlags nSubmitFlags);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ClearLastSubmittedFrame();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _PostPresentHandoff();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetFrameTiming(ref Compositor_FrameTiming pTiming, uint unFramesAgo);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetFrameTimings([In][Out] Compositor_FrameTiming[] pTiming, uint nFrames);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate float _GetFrameTimeRemaining();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetCumulativeStats(ref Compositor_CumulativeStats pStats, uint nStatsSizeInBytes);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _FadeToColor(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate HmdColor_t _GetCurrentFadeColor(bool bBackground);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _FadeGrid(float fSeconds, bool bFadeIn);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate float _GetCurrentGridAlpha();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _SetSkyboxOverride([In][Out] Texture_t[] pTextures, uint unTextureCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ClearSkyboxOverride();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _CompositorBringToFront();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _CompositorGoToBack();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _CompositorQuit();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsFullscreen();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetCurrentSceneFocusProcess();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetLastFrameRenderer();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _CanRenderScene();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ShowMirrorWindow();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _HideMirrorWindow();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsMirrorWindowVisible();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _CompositorDumpImages();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ShouldAppRenderWithLowResources();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ForceInterleavedReprojectionOn(bool bOverride);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ForceReconnectProcess();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SuspendRendering(bool bSuspend);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _GetMirrorTextureD3D11(EVREye eEye, IntPtr pD3D11DeviceOrResource, ref IntPtr ppD3D11ShaderResourceView);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ReleaseMirrorTextureD3D11(IntPtr pD3D11ShaderResourceView);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _GetMirrorTextureGL(EVREye eEye, ref uint pglTextureId, IntPtr pglSharedTextureHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ReleaseSharedGLTexture(uint glTextureId, IntPtr glSharedTextureHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _LockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _UnlockGLSharedTextureForAccess(IntPtr glSharedTextureHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetVulkanInstanceExtensionsRequired(StringBuilder pchValue, uint unBufferSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetVulkanDeviceExtensionsRequired(IntPtr pPhysicalDevice, StringBuilder pchValue, uint unBufferSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _SubmitExplicitTimingData();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsMotionSmoothingEnabled();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsMotionSmoothingSupported();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsCurrentSceneFocusAppLoading();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _SetStageOverride_Async(IntPtr pchRenderModelPath, ref HmdMatrix34_t pTransform, ref Compositor_StageRenderSettings pRenderSettings, uint nSizeOfRenderSettings);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ClearStageOverride();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetCompositorBenchmarkResults(ref Compositor_BenchmarkResults pBenchmarkResults, uint nSizeOfBenchmarkResults);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _GetLastPosePredictionIDs(ref uint pRenderPosePredictionID, ref uint pGamePosePredictionID);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRCompositorError _GetPosesForFrame(uint unPosePredictionID, [In][Out] TrackedDevicePose_t[] pPoseArray, uint unPoseArrayCount);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetTrackingSpace SetTrackingSpace;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetTrackingSpace GetTrackingSpace;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _WaitGetPoses WaitGetPoses;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetLastPoses GetLastPoses;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetLastPoseForTrackedDeviceIndex GetLastPoseForTrackedDeviceIndex;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Submit Submit;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ClearLastSubmittedFrame ClearLastSubmittedFrame;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PostPresentHandoff PostPresentHandoff;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetFrameTiming GetFrameTiming;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetFrameTimings GetFrameTimings;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetFrameTimeRemaining GetFrameTimeRemaining;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCumulativeStats GetCumulativeStats;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _FadeToColor FadeToColor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCurrentFadeColor GetCurrentFadeColor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _FadeGrid FadeGrid;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCurrentGridAlpha GetCurrentGridAlpha;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetSkyboxOverride SetSkyboxOverride;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ClearSkyboxOverride ClearSkyboxOverride;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CompositorBringToFront CompositorBringToFront;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CompositorGoToBack CompositorGoToBack;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CompositorQuit CompositorQuit;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsFullscreen IsFullscreen;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCurrentSceneFocusProcess GetCurrentSceneFocusProcess;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetLastFrameRenderer GetLastFrameRenderer;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CanRenderScene CanRenderScene;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowMirrorWindow ShowMirrorWindow;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HideMirrorWindow HideMirrorWindow;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsMirrorWindowVisible IsMirrorWindowVisible;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CompositorDumpImages CompositorDumpImages;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShouldAppRenderWithLowResources ShouldAppRenderWithLowResources;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ForceInterleavedReprojectionOn ForceInterleavedReprojectionOn;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ForceReconnectProcess ForceReconnectProcess;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SuspendRendering SuspendRendering;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetMirrorTextureD3D11 GetMirrorTextureD3D11;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseMirrorTextureD3D11 ReleaseMirrorTextureD3D11;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetMirrorTextureGL GetMirrorTextureGL;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseSharedGLTexture ReleaseSharedGLTexture;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LockGLSharedTextureForAccess LockGLSharedTextureForAccess;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _UnlockGLSharedTextureForAccess UnlockGLSharedTextureForAccess;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetVulkanInstanceExtensionsRequired GetVulkanInstanceExtensionsRequired;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetVulkanDeviceExtensionsRequired GetVulkanDeviceExtensionsRequired;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetExplicitTimingMode SetExplicitTimingMode;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SubmitExplicitTimingData SubmitExplicitTimingData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsMotionSmoothingEnabled IsMotionSmoothingEnabled;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsMotionSmoothingSupported IsMotionSmoothingSupported;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsCurrentSceneFocusAppLoading IsCurrentSceneFocusAppLoading;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetStageOverride_Async SetStageOverride_Async;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ClearStageOverride ClearStageOverride;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetCompositorBenchmarkResults GetCompositorBenchmarkResults;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetLastPosePredictionIDs GetLastPosePredictionIDs;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPosesForFrame GetPosesForFrame;
	}
	public struct IVROverlay
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _FindOverlay(IntPtr pchOverlayKey, ref ulong pOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _CreateOverlay(IntPtr pchOverlayKey, IntPtr pchOverlayName, ref ulong pOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _DestroyOverlay(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetOverlayKey(ulong ulOverlayHandle, StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetOverlayName(ulong ulOverlayHandle, StringBuilder pchValue, uint unBufferSize, ref EVROverlayError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayName(ulong ulOverlayHandle, IntPtr pchName);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayImageData(ulong ulOverlayHandle, IntPtr pvBuffer, uint unBufferSize, ref uint punWidth, ref uint punHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetOverlayErrorNameFromEnum(EVROverlayError error);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayRenderingPid(ulong ulOverlayHandle, uint unPID);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetOverlayRenderingPid(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, bool bEnabled);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayFlag(ulong ulOverlayHandle, VROverlayFlags eOverlayFlag, ref bool pbEnabled);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayFlags(ulong ulOverlayHandle, ref uint pFlags);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayColor(ulong ulOverlayHandle, float fRed, float fGreen, float fBlue);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayColor(ulong ulOverlayHandle, ref float pfRed, ref float pfGreen, ref float pfBlue);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayAlpha(ulong ulOverlayHandle, float fAlpha);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayAlpha(ulong ulOverlayHandle, ref float pfAlpha);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTexelAspect(ulong ulOverlayHandle, float fTexelAspect);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTexelAspect(ulong ulOverlayHandle, ref float pfTexelAspect);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlaySortOrder(ulong ulOverlayHandle, uint unSortOrder);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlaySortOrder(ulong ulOverlayHandle, ref uint punSortOrder);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayWidthInMeters(ulong ulOverlayHandle, float fWidthInMeters);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayWidthInMeters(ulong ulOverlayHandle, ref float pfWidthInMeters);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayCurvature(ulong ulOverlayHandle, float fCurvature);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayCurvature(ulong ulOverlayHandle, ref float pfCurvature);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTextureColorSpace(ulong ulOverlayHandle, EColorSpace eTextureColorSpace);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTextureColorSpace(ulong ulOverlayHandle, ref EColorSpace peTextureColorSpace);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTextureBounds(ulong ulOverlayHandle, ref VRTextureBounds_t pOverlayTextureBounds);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTransformAbsolute(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTransformAbsolute(ulong ulOverlayHandle, ref ETrackingUniverseOrigin peTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, uint unTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceRelative(ulong ulOverlayHandle, ref uint punTrackedDevice, ref HmdMatrix34_t pmatTrackedDeviceToOverlayTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, uint unDeviceIndex, IntPtr pchComponentName);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTransformTrackedDeviceComponent(ulong ulOverlayHandle, ref uint punDeviceIndex, StringBuilder pchComponentName, uint unComponentNameSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ref ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTransformCursor(ulong ulCursorOverlayHandle, ref HmdVector2_t pvHotspot);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTransformCursor(ulong ulOverlayHandle, ref HmdVector2_t pvHotspot);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _ShowOverlay(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _HideOverlay(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsOverlayVisible(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetTransformForOverlayCoordinates(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _PollNextOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pEvent, uint uncbVREvent);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayInputMethod(ulong ulOverlayHandle, ref VROverlayInputMethod peInputMethod);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayInputMethod(ulong ulOverlayHandle, VROverlayInputMethod eInputMethod);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _ComputeOverlayIntersection(ulong ulOverlayHandle, ref VROverlayIntersectionParams_t pParams, ref VROverlayIntersectionResults_t pResults);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsHoverTargetOverlay(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayIntersectionMask(ulong ulOverlayHandle, ref VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, uint unNumMaskPrimitives, uint unPrimitiveSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _TriggerLaserMouseHapticVibration(ulong ulOverlayHandle, float fDurationSeconds, float fFrequency, float fAmplitude);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayCursor(ulong ulOverlayHandle, ulong ulCursorHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayCursorPositionOverride(ulong ulOverlayHandle, ref HmdVector2_t pvCursor);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _ClearOverlayCursorPositionOverride(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayTexture(ulong ulOverlayHandle, ref Texture_t pTexture);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _ClearOverlayTexture(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayRaw(ulong ulOverlayHandle, IntPtr pvBuffer, uint unWidth, uint unHeight, uint unBytesPerPixel);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetOverlayFromFile(ulong ulOverlayHandle, IntPtr pchFilePath);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTexture(ulong ulOverlayHandle, ref IntPtr pNativeTextureHandle, IntPtr pNativeTextureRef, ref uint pWidth, ref uint pHeight, ref uint pNativeFormat, ref ETextureType pAPIType, ref EColorSpace pColorSpace, ref VRTextureBounds_t pTextureBounds);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _ReleaseNativeOverlayHandle(ulong ulOverlayHandle, IntPtr pNativeTextureHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetOverlayTextureSize(ulong ulOverlayHandle, ref uint pWidth, ref uint pHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _CreateDashboardOverlay(IntPtr pchOverlayKey, IntPtr pchOverlayFriendlyName, ref ulong pMainHandle, ref ulong pThumbnailHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsDashboardVisible();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsActiveDashboardOverlay(ulong ulOverlayHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _SetDashboardOverlaySceneProcess(ulong ulOverlayHandle, uint unProcessId);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _GetDashboardOverlaySceneProcess(ulong ulOverlayHandle, ref uint punProcessId);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _ShowDashboard(IntPtr pchOverlayToShow);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetPrimaryDashboardDevice();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _ShowKeyboard(int eInputMode, int eLineInputMode, uint unFlags, IntPtr pchDescription, uint unCharMax, IntPtr pchExistingText, ulong uUserValue);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _ShowKeyboardForOverlay(ulong ulOverlayHandle, int eInputMode, int eLineInputMode, uint unFlags, IntPtr pchDescription, uint unCharMax, IntPtr pchExistingText, ulong uUserValue);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetKeyboardText(StringBuilder pchText, uint cchText);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _HideKeyboard();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetKeyboardTransformAbsolute(ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToKeyboardTransform);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetKeyboardPositionForOverlay(ulong ulOverlayHandle, HmdRect2_t avoidRect);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate VRMessageOverlayResponse _ShowMessageOverlay(IntPtr pchText, IntPtr pchCaption, IntPtr pchButton0Text, IntPtr pchButton1Text, IntPtr pchButton2Text, IntPtr pchButton3Text);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _CloseMessageOverlay();

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _FindOverlay FindOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CreateOverlay CreateOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _DestroyOverlay DestroyOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayKey GetOverlayKey;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayName GetOverlayName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayName SetOverlayName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayImageData GetOverlayImageData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayErrorNameFromEnum GetOverlayErrorNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayRenderingPid SetOverlayRenderingPid;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayRenderingPid GetOverlayRenderingPid;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayFlag SetOverlayFlag;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayFlag GetOverlayFlag;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayFlags GetOverlayFlags;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayColor SetOverlayColor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayColor GetOverlayColor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayAlpha SetOverlayAlpha;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayAlpha GetOverlayAlpha;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTexelAspect SetOverlayTexelAspect;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTexelAspect GetOverlayTexelAspect;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlaySortOrder SetOverlaySortOrder;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlaySortOrder GetOverlaySortOrder;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayWidthInMeters SetOverlayWidthInMeters;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayWidthInMeters GetOverlayWidthInMeters;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayCurvature SetOverlayCurvature;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayCurvature GetOverlayCurvature;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTextureColorSpace SetOverlayTextureColorSpace;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTextureColorSpace GetOverlayTextureColorSpace;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTextureBounds SetOverlayTextureBounds;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTextureBounds GetOverlayTextureBounds;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTransformType GetOverlayTransformType;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTransformAbsolute SetOverlayTransformAbsolute;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTransformAbsolute GetOverlayTransformAbsolute;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTransformTrackedDeviceRelative SetOverlayTransformTrackedDeviceRelative;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTransformTrackedDeviceRelative GetOverlayTransformTrackedDeviceRelative;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTransformTrackedDeviceComponent SetOverlayTransformTrackedDeviceComponent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTransformOverlayRelative GetOverlayTransformOverlayRelative;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTransformOverlayRelative SetOverlayTransformOverlayRelative;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTransformCursor SetOverlayTransformCursor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTransformCursor GetOverlayTransformCursor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowOverlay ShowOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HideOverlay HideOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsOverlayVisible IsOverlayVisible;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetTransformForOverlayCoordinates GetTransformForOverlayCoordinates;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PollNextOverlayEvent PollNextOverlayEvent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayInputMethod GetOverlayInputMethod;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayInputMethod SetOverlayInputMethod;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayMouseScale GetOverlayMouseScale;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayMouseScale SetOverlayMouseScale;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ComputeOverlayIntersection ComputeOverlayIntersection;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsHoverTargetOverlay IsHoverTargetOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayIntersectionMask SetOverlayIntersectionMask;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _TriggerLaserMouseHapticVibration TriggerLaserMouseHapticVibration;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayCursor SetOverlayCursor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayCursorPositionOverride SetOverlayCursorPositionOverride;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ClearOverlayCursorPositionOverride ClearOverlayCursorPositionOverride;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayTexture SetOverlayTexture;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ClearOverlayTexture ClearOverlayTexture;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayRaw SetOverlayRaw;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetOverlayFromFile SetOverlayFromFile;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTexture GetOverlayTexture;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseNativeOverlayHandle ReleaseNativeOverlayHandle;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOverlayTextureSize GetOverlayTextureSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CreateDashboardOverlay CreateDashboardOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsDashboardVisible IsDashboardVisible;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsActiveDashboardOverlay IsActiveDashboardOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetDashboardOverlaySceneProcess SetDashboardOverlaySceneProcess;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDashboardOverlaySceneProcess GetDashboardOverlaySceneProcess;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowDashboard ShowDashboard;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPrimaryDashboardDevice GetPrimaryDashboardDevice;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowKeyboard ShowKeyboard;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowKeyboardForOverlay ShowKeyboardForOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetKeyboardText GetKeyboardText;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HideKeyboard HideKeyboard;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetKeyboardTransformAbsolute SetKeyboardTransformAbsolute;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetKeyboardPositionForOverlay SetKeyboardPositionForOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowMessageOverlay ShowMessageOverlay;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CloseMessageOverlay CloseMessageOverlay;
	}
	public struct IVROverlayView
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _AcquireOverlayView(ulong ulOverlayHandle, ref VRNativeDevice_t pNativeDevice, ref VROverlayView_t pOverlayView, uint unOverlayViewSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVROverlayError _ReleaseOverlayView(ref VROverlayView_t pOverlayView);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _PostOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pvrEvent);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsViewingPermitted(ulong ulOverlayHandle);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _AcquireOverlayView AcquireOverlayView;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseOverlayView ReleaseOverlayView;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PostOverlayEvent PostOverlayEvent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsViewingPermitted IsViewingPermitted;
	}
	public struct IVRHeadsetView
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetHeadsetViewSize(uint nWidth, uint nHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetHeadsetViewSize(ref uint pnWidth, ref uint pnHeight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetHeadsetViewMode(uint eHeadsetViewMode);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetHeadsetViewMode();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetHeadsetViewCropped(bool bCropped);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetHeadsetViewCropped();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate float _GetHeadsetViewAspectRatio();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetHeadsetViewBlendRange(float flStartPct, float flEndPct);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetHeadsetViewBlendRange(ref float pStartPct, ref float pEndPct);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetHeadsetViewSize SetHeadsetViewSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetHeadsetViewSize GetHeadsetViewSize;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetHeadsetViewMode SetHeadsetViewMode;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetHeadsetViewMode GetHeadsetViewMode;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetHeadsetViewCropped SetHeadsetViewCropped;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetHeadsetViewCropped GetHeadsetViewCropped;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetHeadsetViewAspectRatio GetHeadsetViewAspectRatio;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetHeadsetViewBlendRange SetHeadsetViewBlendRange;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetHeadsetViewBlendRange GetHeadsetViewBlendRange;
	}
	public struct IVRRenderModels
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRRenderModelError _LoadRenderModel_Async(IntPtr pchRenderModelName, ref IntPtr ppRenderModel);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _FreeRenderModel(IntPtr pRenderModel);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRRenderModelError _LoadTexture_Async(int textureId, ref IntPtr ppTexture);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _FreeTexture(IntPtr pTexture);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRRenderModelError _LoadTextureD3D11_Async(int textureId, IntPtr pD3D11Device, ref IntPtr ppD3D11Texture2D);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRRenderModelError _LoadIntoTextureD3D11_Async(int textureId, IntPtr pDstTexture);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _FreeTextureD3D11(IntPtr pD3D11Texture2D);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetRenderModelName(uint unRenderModelIndex, StringBuilder pchRenderModelName, uint unRenderModelNameLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetRenderModelCount();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetComponentCount(IntPtr pchRenderModelName);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetComponentName(IntPtr pchRenderModelName, uint unComponentIndex, StringBuilder pchComponentName, uint unComponentNameLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ulong _GetComponentButtonMask(IntPtr pchRenderModelName, IntPtr pchComponentName);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetComponentRenderModelName(IntPtr pchRenderModelName, IntPtr pchComponentName, StringBuilder pchComponentRenderModelName, uint unComponentRenderModelNameLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetComponentStateForDevicePath(IntPtr pchRenderModelName, IntPtr pchComponentName, ulong devicePath, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetComponentState(IntPtr pchRenderModelName, IntPtr pchComponentName, ref VRControllerState_t pControllerState, ref RenderModel_ControllerMode_State_t pState, ref RenderModel_ComponentState_t pComponentState);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _RenderModelHasComponent(IntPtr pchRenderModelName, IntPtr pchComponentName);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetRenderModelThumbnailURL(IntPtr pchRenderModelName, StringBuilder pchThumbnailURL, uint unThumbnailURLLen, ref EVRRenderModelError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetRenderModelOriginalPath(IntPtr pchRenderModelName, StringBuilder pchOriginalPath, uint unOriginalPathLen, ref EVRRenderModelError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetRenderModelErrorNameFromEnum(EVRRenderModelError error);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LoadRenderModel_Async LoadRenderModel_Async;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _FreeRenderModel FreeRenderModel;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LoadTexture_Async LoadTexture_Async;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _FreeTexture FreeTexture;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LoadTextureD3D11_Async LoadTextureD3D11_Async;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LoadIntoTextureD3D11_Async LoadIntoTextureD3D11_Async;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _FreeTextureD3D11 FreeTextureD3D11;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRenderModelName GetRenderModelName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRenderModelCount GetRenderModelCount;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetComponentCount GetComponentCount;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetComponentName GetComponentName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetComponentButtonMask GetComponentButtonMask;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetComponentRenderModelName GetComponentRenderModelName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetComponentStateForDevicePath GetComponentStateForDevicePath;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetComponentState GetComponentState;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RenderModelHasComponent RenderModelHasComponent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRenderModelThumbnailURL GetRenderModelThumbnailURL;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRenderModelOriginalPath GetRenderModelOriginalPath;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetRenderModelErrorNameFromEnum GetRenderModelErrorNameFromEnum;
	}
	public struct IVRNotifications
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRNotificationError _CreateNotification(ulong ulOverlayHandle, ulong ulUserValue, EVRNotificationType type, IntPtr pchText, EVRNotificationStyle style, ref NotificationBitmap_t pImage, ref uint pNotificationId);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRNotificationError _RemoveNotification(uint notificationId);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CreateNotification CreateNotification;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RemoveNotification RemoveNotification;
	}
	public struct IVRSettings
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetSettingsErrorNameFromEnum(EVRSettingsError eError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetBool(IntPtr pchSection, IntPtr pchSettingsKey, bool bValue, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetInt32(IntPtr pchSection, IntPtr pchSettingsKey, int nValue, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetFloat(IntPtr pchSection, IntPtr pchSettingsKey, float flValue, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _SetString(IntPtr pchSection, IntPtr pchSettingsKey, IntPtr pchValue, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _GetBool(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate int _GetInt32(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate float _GetFloat(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _GetString(IntPtr pchSection, IntPtr pchSettingsKey, StringBuilder pchValue, uint unValueLen, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _RemoveSection(IntPtr pchSection, ref EVRSettingsError peError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate void _RemoveKeyInSection(IntPtr pchSection, IntPtr pchSettingsKey, ref EVRSettingsError peError);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSettingsErrorNameFromEnum GetSettingsErrorNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetBool SetBool;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetInt32 SetInt32;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetFloat SetFloat;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetString SetString;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetBool GetBool;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetInt32 GetInt32;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetFloat GetFloat;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetString GetString;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RemoveSection RemoveSection;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RemoveKeyInSection RemoveKeyInSection;
	}
	public struct IVRScreenshots
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRScreenshotError _RequestScreenshot(ref uint pOutScreenshotHandle, EVRScreenshotType type, IntPtr pchPreviewFilename, IntPtr pchVRFilename);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRScreenshotError _HookScreenshot([In][Out] EVRScreenshotType[] pSupportedTypes, int numTypes);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRScreenshotType _GetScreenshotPropertyType(uint screenshotHandle, ref EVRScreenshotError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetScreenshotPropertyFilename(uint screenshotHandle, EVRScreenshotPropertyFilenames filenameType, StringBuilder pchFilename, uint cchFilename, ref EVRScreenshotError pError);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRScreenshotError _UpdateScreenshotProgress(uint screenshotHandle, float flProgress);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRScreenshotError _TakeStereoScreenshot(ref uint pOutScreenshotHandle, IntPtr pchPreviewFilename, IntPtr pchVRFilename);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRScreenshotError _SubmitScreenshot(uint screenshotHandle, EVRScreenshotType type, IntPtr pchSourcePreviewFilename, IntPtr pchSourceVRFilename);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _RequestScreenshot RequestScreenshot;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HookScreenshot HookScreenshot;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetScreenshotPropertyType GetScreenshotPropertyType;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetScreenshotPropertyFilename GetScreenshotPropertyFilename;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _UpdateScreenshotProgress UpdateScreenshotProgress;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _TakeStereoScreenshot TakeStereoScreenshot;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SubmitScreenshot SubmitScreenshot;
	}
	public struct IVRResources
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _LoadSharedResource(IntPtr pchResourceName, string pchBuffer, uint unBufferLen);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetResourceFullPath(IntPtr pchResourceName, IntPtr pchResourceTypeDirectory, StringBuilder pchPathBuffer, uint unBufferLen);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _LoadSharedResource LoadSharedResource;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetResourceFullPath GetResourceFullPath;
	}
	public struct IVRDriverManager
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetDriverCount();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _GetDriverName(uint nDriver, StringBuilder pchValue, uint unBufferSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ulong _GetDriverHandle(IntPtr pchDriverName);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsEnabled(uint nDriver);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDriverCount GetDriverCount;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDriverName GetDriverName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDriverHandle GetDriverHandle;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsEnabled IsEnabled;
	}
	public struct IVRInput
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _SetActionManifestPath(IntPtr pchActionManifestPath);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetActionSetHandle(IntPtr pchActionSetName, ref ulong pHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetActionHandle(IntPtr pchActionName, ref ulong pHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetInputSourceHandle(IntPtr pchInputSourcePath, ref ulong pHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _UpdateActionState([In][Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetDigitalActionData(ulong action, ref InputDigitalActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetAnalogActionData(ulong action, ref InputAnalogActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetPoseActionDataRelativeToNow(ulong action, ETrackingUniverseOrigin eOrigin, float fPredictedSecondsFromNow, ref InputPoseActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetPoseActionDataForNextFrame(ulong action, ETrackingUniverseOrigin eOrigin, ref InputPoseActionData_t pActionData, uint unActionDataSize, ulong ulRestrictToDevice);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetSkeletalActionData(ulong action, ref InputSkeletalActionData_t pActionData, uint unActionDataSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetDominantHand(ref ETrackedControllerRole peDominantHand);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _SetDominantHand(ETrackedControllerRole eDominantHand);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetBoneCount(ulong action, ref uint pBoneCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetBoneHierarchy(ulong action, [In][Out] int[] pParentIndices, uint unIndexArayCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetBoneName(ulong action, int nBoneIndex, StringBuilder pchBoneName, uint unNameBufferSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetSkeletalReferenceTransforms(ulong action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalReferencePose eReferencePose, [In][Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetSkeletalTrackingLevel(ulong action, ref EVRSkeletalTrackingLevel pSkeletalTrackingLevel);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetSkeletalBoneData(ulong action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalMotionRange eMotionRange, [In][Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetSkeletalSummaryData(ulong action, EVRSummaryType eSummaryType, ref VRSkeletalSummaryData_t pSkeletalSummaryData);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetSkeletalBoneDataCompressed(ulong action, EVRSkeletalMotionRange eMotionRange, IntPtr pvCompressedData, uint unCompressedSize, ref uint punRequiredCompressedSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _DecompressSkeletalBoneData(IntPtr pvCompressedBuffer, uint unCompressedBufferSize, EVRSkeletalTransformSpace eTransformSpace, [In][Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _TriggerHapticVibrationAction(ulong action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude, ulong ulRestrictToDevice);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetActionOrigins(ulong actionSetHandle, ulong digitalActionHandle, [In][Out] ulong[] originsOut, uint originOutCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetOriginLocalizedName(ulong origin, StringBuilder pchNameArray, uint unNameArraySize, int unStringSectionsToInclude);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetOriginTrackedDeviceInfo(ulong origin, ref InputOriginInfo_t pOriginInfo, uint unOriginInfoSize);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetActionBindingInfo(ulong action, ref InputBindingInfo_t pOriginInfo, uint unBindingInfoSize, uint unBindingInfoCount, ref uint punReturnedBindingInfoCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _ShowActionOrigins(ulong actionSetHandle, ulong ulActionHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _ShowBindingsForActionSet([In][Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount, ulong originToHighlight);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetComponentStateForBinding(IntPtr pchRenderModelName, IntPtr pchComponentName, ref InputBindingInfo_t pOriginInfo, uint unBindingInfoSize, uint unBindingInfoCount, ref RenderModel_ComponentState_t pComponentState);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _IsUsingLegacyInput();

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _OpenBindingUI(IntPtr pchAppKey, ulong ulActionSetHandle, ulong ulDeviceHandle, bool bShowOnDesktop);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRInputError _GetBindingVariant(ulong ulDevicePath, StringBuilder pchVariantArray, uint unVariantArraySize);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetActionManifestPath SetActionManifestPath;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetActionSetHandle GetActionSetHandle;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetActionHandle GetActionHandle;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetInputSourceHandle GetInputSourceHandle;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _UpdateActionState UpdateActionState;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDigitalActionData GetDigitalActionData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetAnalogActionData GetAnalogActionData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPoseActionDataRelativeToNow GetPoseActionDataRelativeToNow;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPoseActionDataForNextFrame GetPoseActionDataForNextFrame;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSkeletalActionData GetSkeletalActionData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetDominantHand GetDominantHand;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _SetDominantHand SetDominantHand;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetBoneCount GetBoneCount;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetBoneHierarchy GetBoneHierarchy;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetBoneName GetBoneName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSkeletalReferenceTransforms GetSkeletalReferenceTransforms;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSkeletalTrackingLevel GetSkeletalTrackingLevel;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSkeletalBoneData GetSkeletalBoneData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSkeletalSummaryData GetSkeletalSummaryData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSkeletalBoneDataCompressed GetSkeletalBoneDataCompressed;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _DecompressSkeletalBoneData DecompressSkeletalBoneData;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _TriggerHapticVibrationAction TriggerHapticVibrationAction;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetActionOrigins GetActionOrigins;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOriginLocalizedName GetOriginLocalizedName;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetOriginTrackedDeviceInfo GetOriginTrackedDeviceInfo;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetActionBindingInfo GetActionBindingInfo;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowActionOrigins ShowActionOrigins;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ShowBindingsForActionSet ShowBindingsForActionSet;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetComponentStateForBinding GetComponentStateForBinding;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _IsUsingLegacyInput IsUsingLegacyInput;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _OpenBindingUI OpenBindingUI;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetBindingVariant GetBindingVariant;
	}
	public struct IVRIOBuffer
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EIOBufferError _Open(IntPtr pchPath, EIOBufferMode mode, uint unElementSize, uint unElements, ref ulong pulBuffer);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EIOBufferError _Close(ulong ulBuffer);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EIOBufferError _Read(ulong ulBuffer, IntPtr pDst, uint unBytes, ref uint punRead);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EIOBufferError _Write(ulong ulBuffer, IntPtr pSrc, uint unBytes);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ulong _PropertyContainer(ulong ulBuffer);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate bool _HasReaders(ulong ulBuffer);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Open Open;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Close Close;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Read Read;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Write Write;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _PropertyContainer PropertyContainer;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HasReaders HasReaders;
	}
	public struct IVRSpatialAnchors
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRSpatialAnchorError _CreateSpatialAnchorFromDescriptor(IntPtr pchDescriptor, ref uint pHandleOut);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRSpatialAnchorError _CreateSpatialAnchorFromPose(uint unDeviceIndex, ETrackingUniverseOrigin eOrigin, ref SpatialAnchorPose_t pPose, ref uint pHandleOut);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRSpatialAnchorError _GetSpatialAnchorPose(uint unHandle, ETrackingUniverseOrigin eOrigin, ref SpatialAnchorPose_t pPoseOut);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRSpatialAnchorError _GetSpatialAnchorDescriptor(uint unHandle, StringBuilder pchDescriptorOut, ref uint punDescriptorBufferLenInOut);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CreateSpatialAnchorFromDescriptor CreateSpatialAnchorFromDescriptor;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _CreateSpatialAnchorFromPose CreateSpatialAnchorFromPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSpatialAnchorPose GetSpatialAnchorPose;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetSpatialAnchorDescriptor GetSpatialAnchorDescriptor;
	}
	public struct IVRDebug
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRDebugError _EmitVrProfilerEvent(IntPtr pchMessage);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRDebugError _BeginVrProfilerEvent(ref ulong pHandleOut);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EVRDebugError _FinishVrProfilerEvent(ulong hHandle, IntPtr pchMessage);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate uint _DriverDebugRequest(uint unDeviceIndex, IntPtr pchRequest, StringBuilder pchResponseBuffer, uint unResponseBufferSize);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _EmitVrProfilerEvent EmitVrProfilerEvent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _BeginVrProfilerEvent BeginVrProfilerEvent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _FinishVrProfilerEvent FinishVrProfilerEvent;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _DriverDebugRequest DriverDebugRequest;
	}
	public struct IVRProperties
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedPropertyError _ReadPropertyBatch(ulong ulContainerHandle, ref PropertyRead_t pBatch, uint unBatchEntryCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedPropertyError _WritePropertyBatch(ulong ulContainerHandle, ref PropertyWrite_t pBatch, uint unBatchEntryCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate IntPtr _GetPropErrorNameFromEnum(ETrackedPropertyError error);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ulong _TrackedDeviceToPropertyContainer(uint nDevice);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReadPropertyBatch ReadPropertyBatch;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _WritePropertyBatch WritePropertyBatch;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _GetPropErrorNameFromEnum GetPropErrorNameFromEnum;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _TrackedDeviceToPropertyContainer TrackedDeviceToPropertyContainer;
	}
	public struct IVRPaths
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedPropertyError _ReadPathBatch(ulong ulRootHandle, ref PathRead_t pBatch, uint unBatchEntryCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedPropertyError _WritePathBatch(ulong ulRootHandle, ref PathWrite_t pBatch, uint unBatchEntryCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedPropertyError _StringToHandle(ref ulong pHandle, IntPtr pchPath);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate ETrackedPropertyError _HandleToString(ulong pHandle, string pchBuffer, uint unBufferSize, ref uint punBufferSizeUsed);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReadPathBatch ReadPathBatch;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _WritePathBatch WritePathBatch;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _StringToHandle StringToHandle;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _HandleToString HandleToString;
	}
	public struct IVRBlockQueue
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _Create(ref ulong pulQueueHandle, IntPtr pchPath, uint unBlockDataSize, uint unBlockHeaderSize, uint unBlockCount);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _Connect(ref ulong pulQueueHandle, IntPtr pchPath);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _Destroy(ulong ulQueueHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _AcquireWriteOnlyBlock(ulong ulQueueHandle, ref ulong pulBlockHandle, ref IntPtr ppvBuffer);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _ReleaseWriteOnlyBlock(ulong ulQueueHandle, ulong ulBlockHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _WaitAndAcquireReadOnlyBlock(ulong ulQueueHandle, ref ulong pulBlockHandle, ref IntPtr ppvBuffer, EBlockQueueReadType eReadType, uint unTimeoutMs);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _AcquireReadOnlyBlock(ulong ulQueueHandle, ref ulong pulBlockHandle, ref IntPtr ppvBuffer, EBlockQueueReadType eReadType);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _ReleaseReadOnlyBlock(ulong ulQueueHandle, ulong ulBlockHandle);

		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate EBlockQueueError _QueueHasReader(ulong ulQueueHandle, ref bool pbHasReaders);

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Create Create;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Connect Connect;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _Destroy Destroy;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _AcquireWriteOnlyBlock AcquireWriteOnlyBlock;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseWriteOnlyBlock ReleaseWriteOnlyBlock;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _WaitAndAcquireReadOnlyBlock WaitAndAcquireReadOnlyBlock;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _AcquireReadOnlyBlock AcquireReadOnlyBlock;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _ReleaseReadOnlyBlock ReleaseReadOnlyBlock;

		[MarshalAs(UnmanagedType.FunctionPtr)]
		internal _QueueHasReader QueueHasReader;
	}
	public class Utils
	{
		private static byte[] buffer = new byte[1024];

		public static IntPtr ToUtf8(string managedString)
		{
			if (managedString == null)
			{
				return IntPtr.Zero;
			}
			int num = Encoding.UTF8.GetByteCount(managedString) + 1;
			if (buffer.Length < num)
			{
				buffer = new byte[num];
			}
			int bytes = Encoding.UTF8.GetBytes(managedString, 0, managedString.Length, buffer, 0);
			buffer[bytes] = 0;
			IntPtr intPtr = Marshal.AllocHGlobal(bytes + 1);
			Marshal.Copy(buffer, 0, intPtr, bytes + 1);
			return intPtr;
		}
	}
	public class CVRSystem
	{
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		internal delegate b

BepInEx/patchers/MoveToGame/Managed/Unity.XR.OpenXR.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
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 AOT;
using Microsoft.CodeAnalysis;
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.Scripting;
using UnityEngine.Serialization;
using UnityEngine.XR.Management;
using UnityEngine.XR.OpenXR.Features;
using UnityEngine.XR.OpenXR.Input;

[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]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
}
namespace UnityEngine.XR.OpenXR
{
	[Serializable]
	public class OpenXRSettings : ScriptableObject
	{
		public enum RenderMode
		{
			MultiPass,
			SinglePassInstanced
		}

		public enum DepthSubmissionMode
		{
			None,
			Depth16Bit,
			Depth24Bit
		}

		[FormerlySerializedAs("extensions")]
		[HideInInspector]
		[SerializeField]
		internal OpenXRFeature[] features = new OpenXRFeature[0];

		[SerializeField]
		private RenderMode m_renderMode = RenderMode.SinglePassInstanced;

		[SerializeField]
		private DepthSubmissionMode m_depthSubmissionMode;

		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 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 static OpenXRSettings ActiveBuildTargetInstance => GetInstance(useActiveBuildTarget: true);

		public static OpenXRSettings Instance => GetInstance(useActiveBuildTarget: false);

		public TFeature GetFeature<TFeature>() 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<TFeature>()
		{
			return GetFeatures(typeof(TFeature));
		}

		public OpenXRFeature[] GetFeatures(Type featureType)
		{
			List<OpenXRFeature> list = new List<OpenXRFeature>();
			OpenXRFeature[] array = features;
			foreach (OpenXRFeature openXRFeature in array)
			{
				if (featureType.IsInstanceOfType(openXRFeature))
				{
					list.Add(openXRFeature);
				}
			}
			return list.ToArray();
		}

		public int GetFeatures<TFeature>(List<TFeature> 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<OpenXRFeature> 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<OpenXRFeature> featuresOut)
		{
			featuresOut.Clear();
			featuresOut.AddRange(features);
			return featuresOut.Count;
		}

		private void ApplyRenderSettings()
		{
			Internal_SetRenderMode(m_renderMode);
			Internal_SetDepthSubmissionMode(m_depthSubmissionMode);
		}

		[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();

		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<OpenXRSettings>();
			}
			return openXRSettings;
		}
	}
	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)
		{
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			if (s_Initialized || Initialize())
			{
				InitializeEvent initializeEvent = default(InitializeEvent);
				initializeEvent.success = success;
				initializeEvent.runtime = OpenXRRuntime.name;
				initializeEvent.runtime_version = OpenXRRuntime.version;
				initializeEvent.plugin_version = OpenXRRuntime.pluginVersion;
				initializeEvent.api_version = OpenXRRuntime.apiVersion;
				initializeEvent.enabled_extensions = (from ext in OpenXRRuntime.GetEnabledExtensions()
					select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray();
				initializeEvent.available_extensions = (from ext in OpenXRRuntime.GetAvailableExtensions()
					select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray();
				initializeEvent.enabled_features = (from f in OpenXRSettings.Instance.features
					where (Object)(object)f != (Object)null && f.enabled
					select ((object)f).GetType().FullName + "_" + f.version).ToArray();
				initializeEvent.failed_features = (from f in OpenXRSettings.Instance.features
					where (Object)(object)f != (Object)null && f.failedInitialization
					select ((object)f).GetType().FullName + "_" + f.version).ToArray();
				InitializeEvent initializeEvent2 = initializeEvent;
				Analytics.SendEvent("openxr_initialize", (object)initializeEvent2, 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
	{
		internal enum LoaderState
		{
			Uninitialized,
			InitializeAttempted,
			Initialized,
			StartAttempted,
			Started,
			StopAttempted,
			Stopped,
			DeinitializeAttempted
		}

		internal delegate void ReceiveNativeEventDelegate(OpenXRFeature.NativeEvent e, ulong payload);

		private const double k_IdlePollingWaitTimeInSeconds = 0.1;

		private static List<XRDisplaySubsystemDescriptor> s_DisplaySubsystemDescriptors = new List<XRDisplaySubsystemDescriptor>();

		private static List<XRInputSubsystemDescriptor> s_InputSubsystemDescriptors = new List<XRInputSubsystemDescriptor>();

		private List<LoaderState> validLoaderInitStates = new List<LoaderState>
		{
			LoaderState.Uninitialized,
			LoaderState.InitializeAttempted
		};

		private List<LoaderState> validLoaderStartStates = new List<LoaderState>
		{
			LoaderState.Initialized,
			LoaderState.StartAttempted,
			LoaderState.Stopped
		};

		private List<LoaderState> validLoaderStopStates = new List<LoaderState>
		{
			LoaderState.StartAttempted,
			LoaderState.Started,
			LoaderState.StopAttempted
		};

		private List<LoaderState> validLoaderDeinitStates = new List<LoaderState>
		{
			LoaderState.InitializeAttempted,
			LoaderState.Initialized,
			LoaderState.Stopped,
			LoaderState.DeinitializeAttempted
		};

		private List<LoaderState> runningStates = new List<LoaderState>
		{
			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 => ((XRLoader)this).GetLoadedSubsystem<XRDisplaySubsystem>();

		internal XRInputSubsystem inputSubsystem
		{
			get
			{
				OpenXRLoaderBase instance = Instance;
				if (instance == null)
				{
					return null;
				}
				return ((XRLoader)instance).GetLoadedSubsystem<XRInputSubsystem>();
			}
		}

		private bool isInitialized
		{
			get
			{
				if (currentLoaderState != 0)
				{
					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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			Instance = this;
			currentLoaderState = LoaderState.InitializeAttempted;
			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;
			}
			SetApplicationInfo();
			RequestOpenXRFeatures();
			RegisterOpenXRCallbacks();
			if ((Object)null != (Object)(object)OpenXRSettings.Instance)
			{
				OpenXRSettings.Instance.ApplySettings();
			}
			if (!CreateSubsystems())
			{
				return false;
			}
			if (OpenXRFeature.requiredFeatureFailed)
			{
				return false;
			}
			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<XRDisplaySubsystemDescriptor, XRDisplaySubsystem>(s_DisplaySubsystemDescriptors, "OpenXR Display");
				if (displaySubsystem == null)
				{
					return false;
				}
			}
			if (inputSubsystem == null)
			{
				this.CreateSubsystem<XRInputSubsystemDescriptor, XRInputSubsystem>(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;
			}
			Internal_BeginSession();
			if (!actionSetsAttached)
			{
				OpenXRInput.AttachActionSets();
				actionSetsAttached = true;
			}
			this.StartSubsystem<XRDisplaySubsystem>();
			XRDisplaySubsystem obj = displaySubsystem;
			if (obj != null && !((IntegratedSubsystem)obj).running)
			{
				return false;
			}
			this.StartSubsystem<XRInputSubsystem>();
			XRInputSubsystem obj2 = inputSubsystem;
			if (obj2 != null && !((IntegratedSubsystem)obj2).running)
			{
				return false;
			}
			OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemStart);
			return true;
		}

		public override bool Stop()
		{
			if (currentLoaderState == LoaderState.Stopped)
			{
				return true;
			}
			if (!validLoaderStopStates.Contains(currentLoaderState))
			{
				return false;
			}
			currentLoaderState = LoaderState.StopAttempted;
			StopInternal();
			currentLoaderState = LoaderState.Stopped;
			return true;
		}

		private void StopInternal()
		{
			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<XRInputSubsystem>();
			}
			if (flag)
			{
				this.StopSubsystem<XRDisplaySubsystem>();
			}
			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<XRInputSubsystem>();
				this.DestroySubsystem<XRDisplaySubsystem>();
				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<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem
		{
			((XRLoaderHelper)this).CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id);
		}

		internal void StartSubsystem<T>() where T : class, ISubsystem
		{
			((XRLoaderHelper)this).StartSubsystem<T>();
		}

		internal void StopSubsystem<T>() where T : class, ISubsystem
		{
			((XRLoaderHelper)this).StopSubsystem<T>();
		}

		internal void DestroySubsystem<T>() where T : class, ISubsystem
		{
			((XRLoaderHelper)this).DestroySubsystem<T>();
		}

		private void SetApplicationInfo()
		{
			byte[] array = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(Application.version));
			if (BitConverter.IsLittleEndian)
			{
				Array.Reverse((Array)array);
			}
			uint applicationVersionHash = BitConverter.ToUInt32(array, 0);
			Internal_SetApplicationInfo(Application.productName, Application.version, applicationVersionHash, Application.unityVersion);
		}

		private byte[] StringToWCHAR_T(string s)
		{
			return ((Environment.OSVersion.Platform == PlatformID.Unix) ? Encoding.UTF32 : Encoding.Unicode).GetBytes(s + "\0");
		}

		private bool LoadOpenXRSymbols()
		{
			string s = "openxr_loader";
			if (!Internal_LoadOpenXRLibrary(StringToWCHAR_T(s)))
			{
				return false;
			}
			return true;
		}

		private void RequestOpenXRFeatures()
		{
			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;
			OpenXRFeature[] features = instance.features;
			foreach (OpenXRFeature openXRFeature in features)
			{
				if ((Object)(object)openXRFeature == (Object)null || !openXRFeature.enabled)
				{
					continue;
				}
				num++;
				stringBuilder.Append("  " + openXRFeature.nameUi + ": Version=" + openXRFeature.version + ", Company=\"" + openXRFeature.company + "\"");
				if (!string.IsNullOrEmpty(openXRFeature.openxrExtensionStrings))
				{
					stringBuilder.Append(", Extensions=\"" + openXRFeature.openxrExtensionStrings + "\"");
					string[] array = openXRFeature.openxrExtensionStrings.Split(new char[1] { ' ' });
					foreach (string text in array)
					{
						if (!string.IsNullOrWhiteSpace(text) && !Internal_RequestEnableExtensionString(text))
						{
							num2++;
							stringBuilder2.Append("  " + text + ": Feature=\"" + openXRFeature.nameUi + "\": Version=" + openXRFeature.version + ", Company=\"" + openXRFeature.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.XrFocused:
				DiagnosticReport.DumpReport("System Startup Completed");
				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", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_RequestEnableExtensionString")]
		[return: MarshalAs(UnmanagedType.U1)]
		internal static extern bool Internal_RequestEnableExtensionString(string extensionString);
	}
	public class OpenXRLoaderNoPreInit : OpenXRLoaderBase
	{
	}
	internal class OpenXRRestarter : MonoBehaviour
	{
		internal Action onAfterRestart;

		internal Action onAfterShutdown;

		internal Action onQuit;

		internal Action onAfterCoroutine;

		private static OpenXRRestarter s_Instance;

		private Coroutine m_Coroutine;

		public bool isRunning => m_Coroutine != null;

		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<OpenXRRestarter>();
					}
					s_Instance = val.GetComponent<OpenXRRestarter>();
				}
				return s_Instance;
			}
		}

		public void ResetCallbacks()
		{
			onAfterRestart = null;
			onAfterShutdown = null;
			onAfterCoroutine = null;
			onQuit = null;
		}

		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));
				}
			}
		}

		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));
				}
			}
		}

		private IEnumerator RestartCoroutine(bool shouldRestart)
		{
			try
			{
				yield return null;
				XRGeneralSettings.Instance.Manager.DeinitializeLoader();
				yield return null;
				onAfterShutdown?.Invoke();
				if (shouldRestart && OpenXRRuntime.ShouldRestart())
				{
					yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
					XRGeneralSettings.Instance.Manager.StartSubsystems();
					if ((Object)(object)XRGeneralSettings.Instance.Manager.activeLoader == (Object)null)
					{
						Debug.LogError((object)"Failure to restart OpenXRLoader after shutdown.");
					}
					onAfterRestart?.Invoke();
				}
				else if (OpenXRRuntime.ShouldQuit())
				{
					onQuit?.Invoke();
					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 event Func<bool> wantsToQuit;

		public static event Func<bool> wantsToRestart;

		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<bool> func)
		{
			if (func == null)
			{
				return true;
			}
			Delegate[] invocationList = func.GetInvocationList();
			for (int i = 0; i < invocationList.Length; i++)
			{
				Func<bool> func2 = (Func<bool>)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")]
		private static extern bool Internal_GetRuntimeName(out IntPtr runtimeNamePtr);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeVersion")]
		private static extern bool Internal_GetRuntimeVersion(out ushort major, out ushort minor, out uint patch);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetAPIVersion")]
		private static extern bool Internal_GetAPIVersion(out ushort major, out ushort minor, out uint patch);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetPluginVersion")]
		private static extern bool Internal_GetPluginVersion(out IntPtr pluginVersionPtr);

		[DllImport("UnityOpenXR", EntryPoint = "unity_ext_IsExtensionEnabled")]
		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")]
		private static extern bool Internal_GetEnabledExtensionNamePtr(uint index, out IntPtr outName);

		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")]
		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")]
		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);
			}
		}
	}
}
namespace UnityEngine.XR.OpenXR.Input
{
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct Haptic
	{
	}
	[Preserve]
	public class HapticControl : InputControl<Haptic>
	{
		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<ButtonControl>("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)
				GetInternalDeviceIdCommand result = default(GetInternalDeviceIdCommand);
				result.baseCommand = new InputDeviceCommand(Type, 12);
				return result;
			}
		}

		private static readonly Dictionary<string, OpenXRInteractionFeature.ActionType> ExpectedControlTypeToActionType = new Dictionary<string, OpenXRInteractionFeature.ActionType>
		{
			["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<string, string> kVirtualControlMap = new Dictionary<string, string>
		{
			["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<HapticControl>("Haptic", (InputDeviceMatcher?)null);
			InputSystem.RegisterLayout<PoseControl>("Pose", (InputDeviceMatcher?)null);
			InputSystem.RegisterLayout<OpenXRDevice>((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<OpenXRHmd>((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()
		{
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected I4, but got Unknown
			List<OpenXRInteractionFeature.ActionMapConfig> list = new List<OpenXRInteractionFeature.ActionMapConfig>();
			foreach (OpenXRInteractionFeature item in from f in OpenXRSettings.Instance.features.OfType<OpenXRInteractionFeature>()
				where f.enabled
				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);
					}
				}
			}
			foreach (OpenXRInteractionFeature.ActionMapConfig item2 in list)
			{
				foreach (OpenXRInteractionFeature.DeviceConfig deviceInfo in item2.deviceInfos)
				{
					string name = ((item2.desiredInteractionProfile == null) ? UserPathToDeviceName(deviceInfo.userPath) : item2.localizedName);
					if (Internal_RegisterDeviceDefinition(deviceInfo.userPath, item2.desiredInteractionProfile, (uint)(int)deviceInfo.characteristics, name, item2.manufacturer, item2.serialNumber) == 0L)
					{
						OpenXRRuntime.LogLastError();
						return;
					}
				}
			}
			Dictionary<string, List<SerializedBinding>> dictionary = new Dictionary<string, List<SerializedBinding>>();
			foreach (OpenXRInteractionFeature.ActionMapConfig item3 in list)
			{
				string localizedName = SanitizeStringForOpenXRPath(item3.localizedName);
				ulong num2 = Internal_CreateActionSet(SanitizeStringForOpenXRPath(item3.name), localizedName, default(SerializedGuid));
				if (num2 == 0L)
				{
					OpenXRRuntime.LogLastError();
					return;
				}
				List<string> list2 = item3.deviceInfos.Select((OpenXRInteractionFeature.DeviceConfig d) => d.userPath).ToList();
				foreach (OpenXRInteractionFeature.ActionConfig action in item3.actions)
				{
					string[] array = action.bindings.Where((OpenXRInteractionFeature.ActionBinding b) => b.userPaths != null).SelectMany((OpenXRInteractionFeature.ActionBinding b) => b.userPaths).Distinct()
						.ToList()
						.Union(list2)
						.ToArray();
					ulong num3 = Internal_CreateAction(num2, SanitizeStringForOpenXRPath(action.name), action.localizedName, (uint)action.type, default(SerializedGuid), array, (uint)array.Length, action.usages?.ToArray(), (uint)(action.usages?.Count ?? 0));
					if (num3 == 0L)
					{
						OpenXRRuntime.LogLastError();
						return;
					}
					foreach (OpenXRInteractionFeature.ActionBinding binding in action.bindings)
					{
						foreach (string item4 in binding.userPaths ?? list2)
						{
							string key = binding.interactionProfileName ?? item3.desiredInteractionProfile;
							if (!dictionary.TryGetValue(key, out var value))
							{
								value = (dictionary[key] = new List<SerializedBinding>());
							}
							value.Add(new SerializedBinding
							{
								actionId = num3,
								path = item4 + binding.interactionPath
							});
						}
					}
				}
			}
			foreach (KeyValuePair<string, List<SerializedBinding>> item5 in dictionary)
			{
				if (!Internal_SuggestBindings(item5.Key, item5.Value.ToArray(), (uint)item5.Value.Count))
				{
					OpenXRRuntime.LogLastError();
				}
			}
			if (!Internal_AttachActionSets())
			{
				OpenXRRuntime.LogLastError();
			}
		}

		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 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);
		}

		internal 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<InputControl> 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).Dispose();
			}
			return 0uL;
		}

		private static uint GetDeviceId(InputDevice inputDevice)
		{
			if (inputDevice == null)
			{
				return 0u;
			}
			GetInternalDeviceIdCommand getInternalDeviceIdCommand = GetInternalDeviceIdCommand.Create();
			if (inputDevice.ExecuteCommand<GetInternalDeviceIdCommand>(ref getInternalDeviceIdCommand) != 0L)
			{
				return getInternalDeviceIdCommand.deviceId;
			}
			return 0u;
		}

		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_SendHapticImpulse")]
		private static extern void Internal_SendHapticImpulse(uint deviceId, ulong actionId, 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", EntryPoint = "OpenXRInputProvider_GetActionIdByControl")]
		private static extern ulong Internal_GetActionId(uint deviceId, string name);

		[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", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_RegisterDeviceDefinition")]
		private static extern ulong Internal_RegisterDeviceDefinition(string userPath, string interactionProfile, 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, 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();
	}
	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<Pose>
	{
		[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<ButtonControl>("isTracked");
			trackingState = ((InputControl)this).GetChildControl<IntegerControl>("trackingState");
			position = ((InputControl)this).GetChildControl<Vector3Control>("position");
			rotation = ((InputControl)this).GetChildControl<QuaternionControl>("rotation");
			velocity = ((InputControl)this).GetChildControl<Vector3Control>("velocity");
			angularVelocity = ((InputControl)this).GetChildControl<Vector3Control>("angularVelocity");
			((InputControl)this).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)
			Pose result = default(Pose);
			result.isTracked = ((InputControl<float>)(object)isTracked).ReadUnprocessedValueFromState(statePtr) > 0.5f;
			result.trackingState = (InputTrackingState)((InputControl<int>)(object)trackingState).ReadUnprocessedValueFromState(statePtr);
			result.position = ((InputControl<Vector3>)(object)position).ReadUnprocessedValueFromState(statePtr);
			result.rotation = ((InputControl<Quaternion>)(object)rotation).ReadUnprocessedValueFromState(statePtr);
			result.velocity = ((InputControl<Vector3>)(object)velocity).ReadUnprocessedValueFromState(statePtr);
			result.angularVelocity = ((InputControl<Vector3>)(object)angularVelocity).ReadUnprocessedValueFromState(statePtr);
			return result;
		}

		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<bool>((InputControl)(object)isTracked, value.isTracked, statePtr);
			InputControlExtensions.WriteValueIntoState<uint>((InputControl)(object)trackingState, (uint)(int)value.trackingState, statePtr);
			((InputControl<Vector3>)(object)position).WriteValueIntoState(value.position, statePtr);
			((InputControl<Quaternion>)(object)rotation).WriteValueIntoState(value.rotation, statePtr);
			((InputControl<Vector3>)(object)velocity).WriteValueIntoState(value.velocity, statePtr);
			((InputControl<Vector3>)(object)angularVelocity).WriteValueIntoState(value.angularVelocity, statePtr);
		}
	}
}
namespace UnityEngine.XR.OpenXR.NativeTypes
{
	internal enum XrEnvironmentBlendMode
	{
		Opaque = 1,
		Additive,
		AlphaBlend
	}
	internal enum XrResult
	{
		Success = 0,
		TimeoutExpored = 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,
		SpwachainRectInvalid = -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,
		AndroidThreadSettingsIdInvalidKHR = -1000003000,
		AndroidThreadSettingsdFailureKHR = -1000003001,
		CreateSpatialAnchorFailedMSFT = -1000039001,
		SecondaryViewConfigurationTypeNotEnabledMSFT = -1000053000,
		MaxResult = int.MaxValue
	}
	internal enum XrViewConfigurationType
	{
		PrimaryMono = 1,
		PrimaryStereo = 2,
		PrimaryQuadVarjo = 1000037000,
		SecondaryMonoFirstPersonObserver = 1000054000,
		SecondaryMonoThirdPersonObserver = 1000145000
	}
	[Flags]
	internal enum XrSpaceLocationFlags
	{
		None = 0,
		OrientationValid = 1,
		PositionValid = 2,
		OrientationTracked = 4,
		PositionTracked = 8
	}
	[Flags]
	internal enum XrViewStateFlags
	{
		None = 0,
		OrientationValid = 1,
		PositionValid = 2,
		OrientationTracked = 4,
		PositionTracked = 8
	}
	[Flags]
	internal enum XrReferenceSpaceType
	{
		View = 1,
		Local = 2,
		Stage = 3,
		UnboundedMsft = 0x3B9B5E70,
		CombinedEyeVarjo = 0x3B9CA2A8
	}
	internal enum XrSessionState
	{
		Unknown,
		Idle,
		Ready,
		Synchronized,
		Visible,
		Focused,
		Stopping,
		LossPending,
		Exiting
	}
	internal struct XrVector2f
	{
		private float x;

		private float y;

		public XrVector2f(float x, float y)
		{
			this.x = x;
			this.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;
		}
	}
	internal struct XrVector3f
	{
		private float x;

		private float y;

		private float z;

		public XrVector3f(float x, float y, float z)
		{
			this.x = x;
			this.y = y;
			this.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;
		}
	}
	internal struct XrQuaternionf
	{
		private float x;

		private float y;

		private float z;

		private float w;

		public XrQuaternionf(float x, float y, float z, float w)
		{
			this.x = 0f - x;
			this.y = 0f - y;
			this.z = z;
			this.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;
		}
	}
	internal struct XrPosef
	{
		private XrQuaternionf orientation;

		private 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);
		}
	}
}
namespace UnityEngine.XR.OpenXR.Features
{
	[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
		}

		[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(int 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 void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> 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<TDescriptor, TSubsystem>(descriptors, id);
			}
		}

		protected void StartSubsystem<T>() where T : class, ISubsystem
		{
			if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null)
			{
				Debug.LogError((object)"StartSubsystem called before loader was initialized");
			}
			else
			{
				OpenXRLoaderBase.Instance.StartSubsystem<T>();
			}
		}

		protected void StopSubsystem<T>() where T : class, ISubsystem
		{
			if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null)
			{
				Debug.LogError((object)"StopSubsystem called before loader was initialized");
			}
			else
			{
				OpenXRLoaderBase.Instance.StopSubsystem<T>();
			}
		}

		protected void DestroySubsystem<T>() where T : class, ISubsystem
		{
			if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null)
			{
				Debug.LogError((object)"DestroySubsystem called before loader was initialized");
			}
			else
			{
				OpenXRLoaderBase.Instance.DestroySubsystem<T>();
			}
		}

		protected virtual void OnEnable()
		{
		}

		protected virtual void OnDisable()
		{
		}

		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);
		}

		[DllImport("UnityOpenXR", EntryPoint = "Internal_PathToString")]
		private static extern bool Internal_PathToStringPtr(ulong pathId, out IntPtr path);

		[DllImport("UnityOpenXR")]
		private static extern bool Internal_StringToPath([MarshalAs(UnmanagedType.LPStr)] string str, out ulong pathId);

		[DllImport("UnityOpenXR")]
		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 = "session_GetSessionState")]
		private static extern void Internal_GetSessionState(out int oldState, out int newState);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetEnvironmentBlendMode")]
		private static extern int Internal_GetEnvironmentBlendMode();

		[DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetAppSpace")]
		private static extern bool Internal_GetAppSpace(out ulong appSpace);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetProcAddressPtr")]
		internal static extern IntPtr Internal_GetProcAddressPtr(bool loaderDefault);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetProcAddressPtrAndLoadStage1")]
		internal static extern void Internal_SetProcAddressPtrAndLoadStage1(IntPtr func);
	}
	[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<string> userPaths;
		}

		[Serializable]
		protected internal class ActionConfig
		{
			public string name;

			public ActionType type;

			public string localizedName;

			public List<ActionBinding> bindings;

			public List<string> usages;
		}

		protected internal class DeviceConfig
		{
			public InputDeviceCharacteristics characteristics;

			public string userPath;
		}

		[Serializable]
		protected internal class ActionMapConfig
		{
			public string name;

			public string localizedName;

			public List<DeviceConfig> deviceInfos;

			public List<ActionConfig> 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";
		}

		private static List<ActionMapConfig> m_CreatedActionMaps;

		protected virtual void RegisterDeviceLayout()
		{
		}

		protected virtual void UnregisterDeviceLayout()
		{
		}

		protected virtual void RegisterActionMapsWithRuntime()
		{
		}

		protected internal override bool OnInstanceCreate(ulong xrSession)
		{
			RegisterDeviceLayout();
			return true;
		}

		internal void CreateActionMaps(List<ActionMapConfig> 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);
		}

		protected internal override void OnEnabledChange()
		{
			base.OnEnabledChange();
		}

		internal static void RegisterLayouts()
		{
			OpenXRFeature[] features = OpenXRSettings.Instance.GetFeatures<OpenXRInteractionFeature>();
			foreach (OpenXRFeature openXRFeature in features)
			{
				if (openXRFeature.enabled)
				{
					((OpenXRInteractionFeature)openXRFeature).RegisterDeviceLayout();
				}
			}
		}
	}
}
namespace UnityEngine.XR.OpenXR.Features.Interactions
{
	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<PoseControl>("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";

		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 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<DeviceConfig>
				{
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)49,
						userPath = "/user/eyes_ext"
					}
				},
				actions = new List<ActionConfig>
				{
					new ActionConfig
					{
						name = "pose",
						localizedName = "Pose",
						type = ActionType.Pose,
						usages = new List<string> { "Device", "gaze" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/gaze_ext/pose",
								interactionProfileName = "/interaction_profiles/ext/eye_gaze_interaction"
							}
						}
					}
				}
			};
			AddActionMap(map);
		}
	}
	public static class EyeTrackingUsages
	{
		public static InputFeatureUsage<Vector3> gazePosition = new InputFeatureUsage<Vector3>("gazePosition");

		public static InputFeatureUsage<Quaternion> gazeRotation = new InputFeatureUsage<Quaternion>("gazeRotation");
	}
	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<ButtonControl>("select");
				grip = ((InputControl)this).GetChildControl<AxisControl>("grip");
				gripPressed = ((InputControl)this).GetChildControl<ButtonControl>("gripPressed");
				menu = ((InputControl)this).GetChildControl<ButtonControl>("menu");
				trigger = ((InputControl)this).GetChildControl<AxisControl>("trigger");
				triggerPressed = ((InputControl)this).GetChildControl<ButtonControl>("triggerPressed");
				trackpad = ((InputControl)this).GetChildControl<Vector2Control>("trackpad");
				trackpadClicked = ((InputControl)this).GetChildControl<ButtonControl>("trackpadClicked");
				trackpadTouched = ((InputControl)this).GetChildControl<ButtonControl>("trackpadTouched");
				pointer = ((InputControl)this).GetChildControl<PoseControl>("pointer");
				pointerPosition = ((InputControl)this).GetChildControl<Vector3Control>("pointerPosition");
				pointerRotation = ((InputControl)this).GetChildControl<QuaternionControl>("pointerRotation");
				devicePose = ((InputControl)this).GetChildControl<PoseControl>("devicePose");
				isTracked = ((InputControl)this).GetChildControl<ButtonControl>("isTracked");
				trackingState = ((InputControl)this).GetChildControl<IntegerControl>("trackingState");
				devicePosition = ((InputControl)this).GetChildControl<Vector3Control>("devicePosition");
				deviceRotation = ((InputControl)this).GetChildControl<QuaternionControl>("deviceRotation");
				haptic = ((InputControl)this).GetChildControl<HapticControl>("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 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<DeviceConfig>
				{
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)356,
						userPath = "/user/hand/left"
					},
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)612,
						userPath = "/user/hand/right"
					}
				},
				actions = new List<ActionConfig>
				{
					new ActionConfig
					{
						name = "grip",
						localizedName = "Grip",
						type = ActionType.Axis1D,
						usages = new List<string> { "Grip" },
						bindings = new List<ActionBinding>
						{
							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<string> { "GripButton" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/squeeze/click",
								interactionProfileName = "/interaction_profiles/htc/vive_controller"
							}
						}
					},
					new ActionConfig
					{
						name = "menu",
						localizedName = "Menu",
						type = ActionType.Binary,
						usages = new List<string> { "MenuButton" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/menu/click",
								interactionProfileName = "/interaction_profiles/htc/vive_controller"
							}
						}
					},
					new ActionConfig
					{
						name = "select",
						localizedName = "Select",
						type = ActionType.Binary,
						usages = new List<string> { "SystemButton" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/system/click",
								interactionProfileName = "/interaction_profiles/htc/vive_controller"
							}
						}
					},
					new ActionConfig
					{
						name = "trigger",
						localizedName = "Trigger",
						type = ActionType.Axis1D,
						usages = new List<string> { "Trigger" },
						bindings = new List<ActionBinding>
						{
							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<string> { "TriggerButton" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/trigger/click",
								interactionProfileName = "/interaction_profiles/htc/vive_controller"
							}
						}
					},
					new ActionConfig
					{
						name = "trackpad",
						localizedName = "Trackpad",
						type = ActionType.Axis2D,
						usages = new List<string> { "Primary2DAxis" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/trackpad",
								interactionProfileName = "/interaction_profiles/htc/vive_controller"
							}
						}
					},
					new ActionConfig
					{
						name = "trackpadTouched",
						localizedName = "Trackpad Touched",
						type = ActionType.Binary,
						usages = new List<string> { "Primary2DAxisTouch" },
						bindings = new List<ActionBinding>
						{
							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<string> { "Primary2DAxisClick" },
						bindings = new List<ActionBinding>
						{
							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<string> { "Device" },
						bindings = new List<ActionBinding>
						{
							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<string> { "Pointer" },
						bindings = new List<ActionBinding>
						{
							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<string> { "Haptic" },
						bindings = new List<ActionBinding>
						{
							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<ButtonControl>("menu");
				select = ((InputControl)this).GetChildControl<ButtonControl>("select");
				devicePose = ((InputControl)this).GetChildControl<PoseControl>("devicePose");
				pointer = ((InputControl)this).GetChildControl<PoseControl>("pointer");
				isTracked = ((InputControl)this).GetChildControl<ButtonControl>("isTracked");
				trackingState = ((InputControl)this).GetChildControl<IntegerControl>("trackingState");
				devicePosition = ((InputControl)this).GetChildControl<Vector3Control>("devicePosition");
				deviceRotation = ((InputControl)this).GetChildControl<QuaternionControl>("deviceRotation");
				pointerPosition = ((InputControl)this).GetChildControl<Vector3Control>("pointerPosition");
				pointerRotation = ((InputControl)this).GetChildControl<QuaternionControl>("pointerRotation");
				haptic = ((InputControl)this).GetChildControl<HapticControl>("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 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<DeviceConfig>
				{
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)356,
						userPath = "/user/hand/left"
					},
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)612,
						userPath = "/user/hand/right"
					}
				},
				actions = new List<ActionConfig>
				{
					new ActionConfig
					{
						name = "select",
						localizedName = "Select",
						type = ActionType.Binary,
						usages = new List<string> { "PrimaryButton" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/select/click",
								interactionProfileName = "/interaction_profiles/khr/simple_controller"
							}
						}
					},
					new ActionConfig
					{
						name = "menu",
						localizedName = "Menu",
						type = ActionType.Binary,
						usages = new List<string> { "MenuButton" },
						bindings = new List<ActionBinding>
						{
							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<string> { "Device" },
						bindings = new List<ActionBinding>
						{
							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<string> { "Pointer" },
						bindings = new List<ActionBinding>
						{
							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<string> { "Haptic" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/output/haptic",
								interactionProfileName = "/interaction_profiles/khr/simple_controller"
							}
						}
					}
				}
			};
			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()
	

BepInEx/patchers/MoveToGame/Managed/Unity.XR.OpenXR.Features.ConformanceAutomation.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine.XR.OpenXR.NativeTypes;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.XR.OpenXR.Features.ConformanceAutomation;

public class ConformanceAutomationFeature : OpenXRFeature
{
	public const string featureId = "com.unity.openxr.feature.conformance";

	private static ulong xrInstance;

	private static ulong xrSession;

	private const string ExtLib = "ConformanceAutomationExt";

	protected internal override bool OnInstanceCreate(ulong instance)
	{
		if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_conformance_automation"))
		{
			Debug.LogError((object)"XR_EXT_conformance_automation is not enabled. Disabling ConformanceAutomationExt");
			return false;
		}
		xrInstance = instance;
		xrSession = 0uL;
		initialize(OpenXRFeature.xrGetInstanceProcAddr, xrInstance);
		return true;
	}

	protected internal override void OnInstanceDestroy(ulong xrInstance)
	{
		((OpenXRFeature)this).OnInstanceDestroy(xrInstance);
		ConformanceAutomationFeature.xrInstance = 0uL;
	}

	protected internal override void OnSessionCreate(ulong xrSessionId)
	{
		xrSession = xrSessionId;
		((OpenXRFeature)this).OnSessionCreate(xrSession);
	}

	protected internal override void OnSessionDestroy(ulong xrSessionId)
	{
		((OpenXRFeature)this).OnSessionDestroy(xrSessionId);
		xrSession = 0uL;
	}

	public static bool ConformanceAutomationSetActive(string interactionProfile, string topLevelPath, bool isActive)
	{
		return xrSetInputDeviceActiveEXT(xrSession, OpenXRFeature.GetCurrentInteractionProfile(interactionProfile), OpenXRFeature.StringToPath(topLevelPath), isActive);
	}

	public static bool ConformanceAutomationSetBool(string topLevelPath, string inputSourcePath, bool state)
	{
		return xrSetInputDeviceStateBoolEXT(xrSession, OpenXRFeature.StringToPath(topLevelPath), OpenXRFeature.StringToPath(inputSourcePath), state);
	}

	public static bool ConformanceAutomationSetFloat(string topLevelPath, string inputSourcePath, float state)
	{
		return xrSetInputDeviceStateFloatEXT(xrSession, OpenXRFeature.StringToPath(topLevelPath), OpenXRFeature.StringToPath(inputSourcePath), state);
	}

	public static bool ConformanceAutomationSetVec2(string topLevelPath, string inputSourcePath, Vector2 state)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		return xrSetInputDeviceStateVector2fEXT(xrSession, OpenXRFeature.StringToPath(topLevelPath), OpenXRFeature.StringToPath(inputSourcePath), new XrVector2f(state));
	}

	public static bool ConformanceAutomationSetPose(string topLevelPath, string inputSourcePath, Vector3 position, Quaternion orientation)
	{
		//IL_0016: 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_0018: Unknown result type (might be due to invalid IL or missing references)
		return xrSetInputDeviceLocationEXT(xrSession, OpenXRFeature.StringToPath(topLevelPath), OpenXRFeature.StringToPath(inputSourcePath), OpenXRFeature.GetCurrentAppSpace(), new XrPosef(position, orientation));
	}

	public static bool ConformanceAutomationSetVelocity(string topLevelPath, string inputSourcePath, bool linearValid, Vector3 linear, bool angularValid, Vector3 angular)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: 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_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		return xrSetInputDeviceVelocityUNITY(xrSession, OpenXRFeature.StringToPath(topLevelPath), OpenXRFeature.StringToPath(inputSourcePath), linearValid, new XrVector3f(linear), angularValid, new XrVector3f(-1f * angular));
	}

	[DllImport("ConformanceAutomationExt", EntryPoint = "script_initialize")]
	private static extern void initialize(IntPtr xrGetInstanceProcAddr, ulong xrInstance);

	[DllImport("ConformanceAutomationExt", EntryPoint = "script_xrSetInputDeviceActiveEXT")]
	private static extern bool xrSetInputDeviceActiveEXT(ulong xrSession, ulong interactionProfile, ulong topLevelPath, bool isActive);

	[DllImport("ConformanceAutomationExt", EntryPoint = "script_xrSetInputDeviceStateBoolEXT")]
	private static extern bool xrSetInputDeviceStateBoolEXT(ulong xrSession, ulong topLevelPath, ulong inputSourcePath, bool state);

	[DllImport("ConformanceAutomationExt", EntryPoint = "script_xrSetInputDeviceStateFloatEXT")]
	private static extern bool xrSetInputDeviceStateFloatEXT(ulong xrSession, ulong topLevelPath, ulong inputSourcePath, float state);

	[DllImport("ConformanceAutomationExt", EntryPoint = "script_xrSetInputDeviceStateVector2fEXT")]
	private static extern bool xrSetInputDeviceStateVector2fEXT(ulong xrSession, ulong topLevelPath, ulong inputSourcePath, XrVector2f state);

	[DllImport("ConformanceAutomationExt", EntryPoint = "script_xrSetInputDeviceLocationEXT")]
	private static extern bool xrSetInputDeviceLocationEXT(ulong xrSession, ulong topLevelPath, ulong inputSourcePath, ulong space, XrPosef pose);

	[DllImport("ConformanceAutomationExt", EntryPoint = "script_xrSetInputDeviceVelocityUNITY")]
	private static extern bool xrSetInputDeviceVelocityUNITY(ulong xrSession, ulong topLevelPath, ulong inputSourcePath, bool linearValid, XrVector3f linear, bool angularValid, XrVector3f angular);
}

BepInEx/patchers/MoveToGame/Managed/Unity.XR.OpenXR.Features.MockRuntime.dll

Decompiled a month ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using AOT;
using UnityEngine.XR.OpenXR.NativeTypes;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests")]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests.Editor")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.XR.OpenXR.Features.Mock;

internal class MockRuntime : OpenXRFeature
{
	public enum ScriptEvent
	{
		Unknown,
		EndFrame,
		HapticImpulse,
		HapticStop
	}

	public delegate void ScriptEventDelegate(ScriptEvent evt, ulong param);

	public delegate XrResult BeforeFunctionDelegate(string functionName);

	public delegate void AfterFunctionDelegate(string functionName, XrResult result);

	private static Dictionary<string, AfterFunctionDelegate> s_AfterFunctionCallbacks;

	private static Dictionary<string, BeforeFunctionDelegate> s_BeforeFunctionCallbacks;

	public const string featureId = "com.unity.openxr.feature.mockruntime";

	public bool ignoreValidationErrors;

	private const string extLib = "mock_runtime";

	public static MockRuntime Instance => OpenXRSettings.Instance.GetFeature<MockRuntime>();

	public static event ScriptEventDelegate onScriptEvent;

	[MonoPInvokeCallback(typeof(ScriptEventDelegate))]
	private static void ReceiveScriptEvent(ScriptEvent evt, ulong param)
	{
		MockRuntime.onScriptEvent?.Invoke(evt, param);
	}

	[MonoPInvokeCallback(typeof(BeforeFunctionDelegate))]
	private static XrResult BeforeFunctionCallback(string function)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		return (XrResult)(((??)GetBeforeFunctionCallback(function)?.Invoke(function)) ?? 0);
	}

	[MonoPInvokeCallback(typeof(BeforeFunctionDelegate))]
	private static void AfterFunctionCallback(string function, XrResult result)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		GetAfterFunctionCallback(function)?.Invoke(function, result);
	}

	public static void SetFunctionCallback(string function, BeforeFunctionDelegate beforeCallback, AfterFunctionDelegate afterCallback)
	{
		if (beforeCallback != null)
		{
			if (s_BeforeFunctionCallbacks == null)
			{
				s_BeforeFunctionCallbacks = new Dictionary<string, BeforeFunctionDelegate>();
			}
			s_BeforeFunctionCallbacks[function] = beforeCallback;
		}
		else if (s_BeforeFunctionCallbacks != null)
		{
			s_BeforeFunctionCallbacks.Remove(function);
			if (s_BeforeFunctionCallbacks.Count == 0)
			{
				s_BeforeFunctionCallbacks = null;
			}
		}
		if (afterCallback != null)
		{
			if (s_AfterFunctionCallbacks == null)
			{
				s_AfterFunctionCallbacks = new Dictionary<string, AfterFunctionDelegate>();
			}
			s_AfterFunctionCallbacks[function] = afterCallback;
		}
		else if (s_AfterFunctionCallbacks != null)
		{
			s_AfterFunctionCallbacks.Remove(function);
			if (s_AfterFunctionCallbacks.Count == 0)
			{
				s_AfterFunctionCallbacks = null;
			}
		}
		MockRuntime_RegisterFunctionCallbacks((s_BeforeFunctionCallbacks != null) ? new BeforeFunctionDelegate(BeforeFunctionCallback) : null, (s_AfterFunctionCallbacks != null) ? new AfterFunctionDelegate(AfterFunctionCallback) : null);
	}

	public static void SetFunctionCallback(string function, BeforeFunctionDelegate beforeCallback)
	{
		SetFunctionCallback(function, beforeCallback, GetAfterFunctionCallback(function));
	}

	public static void SetFunctionCallback(string function, AfterFunctionDelegate afterCallback)
	{
		SetFunctionCallback(function, GetBeforeFunctionCallback(function), afterCallback);
	}

	public static BeforeFunctionDelegate GetBeforeFunctionCallback(string function)
	{
		if (s_BeforeFunctionCallbacks == null)
		{
			return null;
		}
		if (!s_BeforeFunctionCallbacks.TryGetValue(function, out var value))
		{
			return null;
		}
		return value;
	}

	public static AfterFunctionDelegate GetAfterFunctionCallback(string function)
	{
		if (s_AfterFunctionCallbacks == null)
		{
			return null;
		}
		if (!s_AfterFunctionCallbacks.TryGetValue(function, out var value))
		{
			return null;
		}
		return value;
	}

	public static void ClearFunctionCallbacks()
	{
		s_BeforeFunctionCallbacks = null;
		s_AfterFunctionCallbacks = null;
		MockRuntime_RegisterFunctionCallbacks(null, null);
	}

	public static void ResetDefaults()
	{
		MockRuntime.onScriptEvent = null;
		ClearFunctionCallbacks();
	}

	protected internal override void OnInstanceDestroy(ulong instance)
	{
		ClearFunctionCallbacks();
	}

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_SetView")]
	public static extern void SetViewPose(XrViewConfigurationType viewConfigurationType, int viewIndex, Vector3 position, Quaternion orientation, Vector4 fov);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_SetViewState")]
	public static extern void SetViewState(XrViewConfigurationType viewConfigurationType, XrViewStateFlags viewStateFlags);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_SetReferenceSpace")]
	public static extern void SetSpace(XrReferenceSpaceType referenceSpace, Vector3 position, Quaternion orientation, XrSpaceLocationFlags locationFlags);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_SetActionSpace")]
	public static extern void SetSpace(ulong actionHandle, Vector3 position, Quaternion orientation, XrSpaceLocationFlags locationFlags);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_RegisterScriptEventCallback")]
	private static extern XrResult Internal_RegisterScriptEventCallback(ScriptEventDelegate callback);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_TransitionToState")]
	private static extern bool Internal_TransitionToState(XrSessionState state, bool forceTransition);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_GetSessionState")]
	private static extern XrSessionState Internal_GetSessionState();

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_RequestExitSession")]
	public static extern void RequestExitSession();

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_CauseInstanceLoss")]
	public static extern void CauseInstanceLoss();

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_SetEnvironmentBlendMode")]
	public static extern void SetEnvironmentBlendMode(XrEnvironmentBlendMode environmentBlendMode);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_SetReferenceSpaceBounds")]
	internal static extern void SetReferenceSpaceBounds(XrReferenceSpaceType referenceSpace, Vector2 bounds);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_GetEndFrameStats")]
	internal static extern void GetEndFrameStats(out int primaryLayerCount, out int secondaryLayerCount);

	[DllImport("mock_runtime", EntryPoint = "MockRuntime_ActivateSecondaryView")]
	internal static extern void ActivateSecondaryView(XrViewConfigurationType viewConfigurationType, bool activate);

	[DllImport("mock_runtime")]
	private static extern void MockRuntime_RegisterFunctionCallbacks(BeforeFunctionDelegate hookBefore, AfterFunctionDelegate hookAfter);
}

BepInEx/patchers/MoveToGame/Managed/Unity.XR.OpenXR.Features.OculusQuestSupport.dll

Decompiled a month ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.XR.OpenXR.Features.OculusQuestSupport;

public class OculusQuestFeature : OpenXRFeature
{
	public const string featureId = "com.unity.openxr.feature.oculusquest";
}

BepInEx/patchers/MoveToGame/Managed/Unity.XR.OpenXR.Features.RuntimeDebugger.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine.Events;
using UnityEngine.Networking.PlayerConnection;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.XR.OpenXR.Features.RuntimeDebugger;

public class RuntimeDebuggerOpenXRFeature : OpenXRFeature
{
	internal static readonly Guid kEditorToPlayerRequestDebuggerOutput = new Guid("B3E6DED1-C6C7-411C-BE58-86031A0877E7");

	internal static readonly Guid kPlayerToEditorSendDebuggerOutput = new Guid("B3E6DED1-C6C7-411C-BE58-86031A0877E8");

	public uint cacheSize = 1048576u;

	public uint perThreadCacheSize = 51200u;

	private const string Library = "openxr_runtime_debugger";

	protected override IntPtr HookGetInstanceProcAddr(IntPtr func)
	{
		PlayerConnection.instance.Register(kEditorToPlayerRequestDebuggerOutput, (UnityAction<MessageEventArgs>)RecvMsg);
		Native_StartDataAccess();
		Native_EndDataAccess();
		return Native_HookGetInstanceProcAddr(func, cacheSize, perThreadCacheSize);
	}

	internal void RecvMsg(MessageEventArgs args)
	{
		Native_StartDataAccess();
		Native_GetDataForRead(out var ptr, out var size);
		Native_GetDataForRead(out var ptr2, out var size2);
		byte[] array = new byte[size + size2];
		Marshal.Copy(ptr, array, 0, (int)size);
		if (size2 != 0)
		{
			Marshal.Copy(ptr2, array, (int)size, (int)size2);
		}
		Native_EndDataAccess();
		PlayerConnection.instance.Send(kPlayerToEditorSendDebuggerOutput, array);
	}

	[DllImport("openxr_runtime_debugger", EntryPoint = "HookXrInstanceProcAddr")]
	private static extern IntPtr Native_HookGetInstanceProcAddr(IntPtr func, uint cacheSize, uint perThreadCacheSize);

	[DllImport("openxr_runtime_debugger", EntryPoint = "GetDataForRead")]
	private static extern bool Native_GetDataForRead(out IntPtr ptr, out uint size);

	[DllImport("openxr_runtime_debugger", EntryPoint = "StartDataAccess")]
	private static extern void Native_StartDataAccess();

	[DllImport("openxr_runtime_debugger", EntryPoint = "EndDataAccess")]
	private static extern void Native_EndDataAccess();
}

BepInEx/plugins/BombRushCyberFunk_VR.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using Costura;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reptile;
using Rewired;
using Rewired.Data;
using Rewired.Data.Mapping;
using Rewired.Utils.Classes.Data;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityVRPlugin.VRInput;
using UnityVRPlugin.patches;
using UnityVR_Bepinex;
using UnityVR_Bepinex.assets;
using UnityVR_Bepinex.cam;
using UnityVR_Bepinex.input;
using UnityVR_Bepinex.ui;
using Valve.VR;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("BombRushCyberFunk_VR")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("UnityVRPlugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+82356d50b34a4f7453ba88b967132e5ebc8586c7")]
[assembly: AssemblyProduct("BombRushCyberFunk_VR")]
[assembly: AssemblyTitle("BombRushCyberFunk_VR")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
internal class <Module>
{
	static <Module>()
	{
		AssemblyLoader.Attach();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace UnityVRPlugin
{
	[BepInPlugin("BombRushCyberFunk_VR", "BombRushCyberFunk_VR", "1.0.0")]
	public class GamePlugin : BaseUnityPlugin
	{
		public bool isPluginInitiated = false;

		public static Harmony harmonyInstance;

		public static ConfigEntry<bool> firstPerson;

		public static ConfigEntry<bool> fullImmersive;

		public static bool inputListenerDestroyed;

		private void Awake()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin BombRushCyberFunk_VR is loaded!");
			((BaseUnityPlugin)this).Logger.LogInfo((object)Application.productName);
			if (Application.productName == "Bomb Rush Cyberfunk")
			{
				Plugin val = new GameObject("PluginInit").AddComponent<Plugin>();
				Object.DontDestroyOnLoad((Object)(object)((Component)val).gameObject);
			}
		}

		private void Update()
		{
			if (!isPluginInitiated && Plugin.init)
			{
				initConfig();
				harmonyInstance = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
				isPluginInitiated = true;
			}
			if (!inputListenerDestroyed && (Object)(object)InputListener.listener != (Object)null)
			{
				Object.Destroy((Object)(object)InputListener.listener);
				inputListenerDestroyed = true;
			}
		}

		private void initConfig()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			firstPerson = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "firstPerson", false, new ConfigDescription("First person mode with VR hands and VR controller support", (AcceptableValueBase)null, Array.Empty<object>()));
			fullImmersive = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "fullImmersive", false, new ConfigDescription("!! Requieres firstPerson = true !! First person mode with full ingame head movements, need strong VR legs", (AcceptableValueBase)null, Array.Empty<object>()));
			GamePatches gamePatches = new GameObject("GamePatches").AddComponent<GamePatches>();
			Object.DontDestroyOnLoad((Object)(object)gamePatches);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "BombRushCyberFunk_VR";

		public const string PLUGIN_NAME = "BombRushCyberFunk_VR";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace UnityVRPlugin.VRInput
{
	internal class AxisInput : BaseInput
	{
		protected SteamVR_Action_Single MyAxisAction;

		protected int MyAxisID;

		internal override string BindingString => ((SteamVR_Action_In<SteamVR_Action_Single_Source_Map, SteamVR_Action_Single_Source>)(object)MyAxisAction).localizedOriginName;

		internal override bool IsBound => ((SteamVR_Action)MyAxisAction).activeBinding;

		internal AxisInput(SteamVR_Action_Single AxisAction, int AxisID)
		{
			MyAxisAction = AxisAction;
			MyAxisID = AxisID;
		}

		internal override void UpdateValues(CustomController vrController)
		{
			vrController.SetAxisValueById(MyAxisID, MyAxisAction.axis);
		}
	}
	internal abstract class BaseInput
	{
		internal abstract bool IsBound { get; }

		internal abstract string BindingString { get; }

		internal abstract void UpdateValues(CustomController vrControllers);
	}
	internal class ButtonInput : BaseInput
	{
		protected SteamVR_Action_Boolean buttonAction;

		protected int buttonID;

		internal override string BindingString => ((SteamVR_Action_In<SteamVR_Action_Boolean_Source_Map, SteamVR_Action_Boolean_Source>)(object)buttonAction).localizedOriginName;

		internal override bool IsBound => ((SteamVR_Action)buttonAction).activeBinding;

		internal ButtonInput(SteamVR_Action_Boolean buttonAction, int buttonID)
		{
			this.buttonAction = buttonAction;
			this.buttonID = buttonID;
		}

		internal override void UpdateValues(CustomController vrController)
		{
			vrController.SetButtonValueById(buttonID, buttonAction.state);
		}
	}
	internal class HoldableButtonInput : ButtonInput
	{
		private SteamVR_Action_Boolean holdableButtonAction;

		internal HoldableButtonInput(SteamVR_Action_Boolean buttonAction, int buttonID, SteamVR_Action_Boolean holdableButtonAction)
			: base(buttonAction, buttonID)
		{
			this.holdableButtonAction = holdableButtonAction;
		}

		internal override void UpdateValues(CustomController vrController)
		{
			vrController.SetButtonValueById(buttonID, buttonAction.state || (holdableButtonAction.state && Time.realtimeSinceStartup - ((SteamVR_Action_In<SteamVR_Action_Boolean_Source_Map, SteamVR_Action_Boolean_Source>)(object)holdableButtonAction).changedTime > 0.4f));
		}
	}
	internal class ReleaseButtonInput : ButtonInput
	{
		private bool canRelease = false;

		internal ReleaseButtonInput(SteamVR_Action_Boolean buttonAction, int buttonID)
			: base(buttonAction, buttonID)
		{
		}

		internal override void UpdateValues(CustomController vrController)
		{
			bool flag = false;
			if (buttonAction.state)
			{
				canRelease = Time.realtimeSinceStartup - ((SteamVR_Action_In<SteamVR_Action_Boolean_Source_Map, SteamVR_Action_Boolean_Source>)(object)buttonAction).changedTime < 0.4f;
			}
			else
			{
				flag = canRelease && Time.realtimeSinceStartup - ((SteamVR_Action_In<SteamVR_Action_Boolean_Source_Map, SteamVR_Action_Boolean_Source>)(object)buttonAction).changedTime < 0.1f;
			}
			vrController.SetButtonValueById(buttonID, flag);
		}
	}
	internal class SimulatedVectorInput : VectorInput
	{
		private SteamVR_Action_Boolean upButton;

		private SteamVR_Action_Boolean rightButton;

		private SteamVR_Action_Boolean downButton;

		private SteamVR_Action_Boolean leftButton;

		internal SimulatedVectorInput(SteamVR_Action_Vector2 vectorAction, int xAxisID, int yAxisID, SteamVR_Action_Boolean upButton, SteamVR_Action_Boolean rightButton, SteamVR_Action_Boolean downButton, SteamVR_Action_Boolean leftButton)
			: base(vectorAction, xAxisID, yAxisID)
		{
			this.upButton = upButton;
			this.rightButton = rightButton;
			this.downButton = downButton;
			this.leftButton = leftButton;
		}

		internal override void UpdateValues(CustomController vrController)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = Vector2.zero;
			if ((SteamVR_Action)(object)vectorAction != (SteamVR_Action)null)
			{
				val = vectorAction.axis;
			}
			if ((SteamVR_Action)(object)upButton != (SteamVR_Action)null && upButton.state)
			{
				val.y += 1f;
			}
			if ((SteamVR_Action)(object)rightButton != (SteamVR_Action)null && rightButton.state)
			{
				val.x += 1f;
			}
			if ((SteamVR_Action)(object)downButton != (SteamVR_Action)null && downButton.state)
			{
				val.y -= 1f;
			}
			if ((SteamVR_Action)(object)leftButton != (SteamVR_Action)null && leftButton.state)
			{
				val.x -= 1f;
			}
			vrController.SetAxisValueById(xAxisID, val.x);
			vrController.SetAxisValueById(yAxisID, val.y);
		}
	}
	internal class VectorInput : BaseInput
	{
		protected SteamVR_Action_Vector2 vectorAction;

		protected int xAxisID;

		protected int yAxisID;

		internal override string BindingString => ((SteamVR_Action_In<SteamVR_Action_Vector2_Source_Map, SteamVR_Action_Vector2_Source>)(object)vectorAction).localizedOriginName;

		internal override bool IsBound => ((SteamVR_Action)vectorAction).activeBinding;

		internal VectorInput(SteamVR_Action_Vector2 vectorAction, int xAxisID, int yAxisID)
		{
			this.vectorAction = vectorAction;
			this.xAxisID = xAxisID;
			this.yAxisID = yAxisID;
		}

		internal override void UpdateValues(CustomController vrController)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			vrController.SetAxisValueById(xAxisID, vectorAction.axis.x);
			vrController.SetAxisValueById(yAxisID, vectorAction.axis.y);
		}
	}
	internal static class RewiredAddons
	{
		internal static CustomController CreateRewiredController()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Expected O, but got Unknown
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Expected O, but got Unknown
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Expected O, but got Unknown
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Expected O, but got Unknown
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Expected O, but got Unknown
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Expected O, but got Unknown
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Expected O, but got Unknown
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Expected O, but got Unknown
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Expected O, but got Unknown
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Expected O, but got Unknown
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Expected O, but got Unknown
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Invalid comparison between Unknown and I4
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e6: Invalid comparison between Unknown and I4
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			HardwareControllerMap_Game val = new HardwareControllerMap_Game("VRControllers", (ControllerElementIdentifier[])(object)new ControllerElementIdentifier[19]
			{
				new ControllerElementIdentifier(0, "default_LeftJoystickX", "", "", (ControllerElementType)0, true),
				new ControllerElementIdentifier(1, "default_LeftJoystickY", "", "", (ControllerElementType)0, true),
				new ControllerElementIdentifier(2, "default_RightJoystickX", "", "", (ControllerElementType)0, true),
				new ControllerElementIdentifier(3, "default_RightJoystickY", "", "", (ControllerElementType)0, true),
				new ControllerElementIdentifier(4, "default_LeftTrigger", "", "", (ControllerElementType)0, true),
				new ControllerElementIdentifier(5, "default_RightTrigger", "", "", (ControllerElementType)0, true),
				new ControllerElementIdentifier(6, "default_ButtonA", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(7, "default_ButtonB", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(8, "default_ButtonX", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(9, "default_ButtonY", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(10, "default_LeftGrip", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(11, "default_RightGrip", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(12, "default_ClickLeftJoystick", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(13, "default_ClickRightJoystick", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(14, "virtualDPadUP", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(15, "virtualDPadDown", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(16, "virtualDPadLeft", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(17, "virtualDPadRight", "", "", (ControllerElementType)1, true),
				new ControllerElementIdentifier(18, "virtualDPadDownDance", "", "", (ControllerElementType)1, true)
			}, new int[0], new int[0], (AxisCalibrationData[])(object)new AxisCalibrationData[6]
			{
				new AxisCalibrationData(true, 0.1f, 0f, -1f, 1f, false, true),
				new AxisCalibrationData(true, 0.1f, 0f, -1f, 1f, false, true),
				new AxisCalibrationData(true, 0.1f, 0f, -1f, 1f, false, true),
				new AxisCalibrationData(true, 0.1f, 0f, -1f, 1f, false, true),
				new AxisCalibrationData(true, 0.1f, 0f, 0f, 1f, false, true),
				new AxisCalibrationData(true, 0.1f, 0f, 0f, 1f, false, true)
			}, (AxisRange[])(object)new AxisRange[6]
			{
				default(AxisRange),
				default(AxisRange),
				default(AxisRange),
				default(AxisRange),
				(AxisRange)1,
				(AxisRange)1
			}, (HardwareAxisInfo[])(object)new HardwareAxisInfo[6]
			{
				new HardwareAxisInfo((AxisCoordinateMode)0, false, 0f, (SpecialAxisType)0),
				new HardwareAxisInfo((AxisCoordinateMode)0, false, 0f, (SpecialAxisType)0),
				new HardwareAxisInfo((AxisCoordinateMode)0, false, 0f, (SpecialAxisType)0),
				new HardwareAxisInfo((AxisCoordinateMode)0, false, 0f, (SpecialAxisType)0),
				new HardwareAxisInfo((AxisCoordinateMode)0, false, 0f, (SpecialAxisType)0),
				new HardwareAxisInfo((AxisCoordinateMode)0, false, 0f, (SpecialAxisType)0)
			}, (HardwareButtonInfo[])(object)new HardwareButtonInfo[0], (CompoundElement[])null);
			ReInput.UserData.AddCustomController();
			CustomController_Editor val2 = ReInput.UserData.customControllers.Last();
			val2.name = "VRControllers";
			Enumerator<int, ControllerElementIdentifier> enumerator = val.elementIdentifiers.Values.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					ControllerElementIdentifier current = enumerator.Current;
					if ((int)current.elementType == 0)
					{
						val2.AddAxis();
						val2.elementIdentifiers.RemoveAt(val2.elementIdentifiers.Count - 1);
						val2.elementIdentifiers.Add(current);
						Axis val3 = val2.axes.Last();
						((Element)val3).name = current.name;
						((Element)val3).elementIdentifierId = current.id;
						val3.deadZone = val.hwAxisCalibrationData[val2.axisCount - 1].deadZone;
						val3.zero = 0f;
						val3.min = val.hwAxisCalibrationData[val2.axisCount - 1].min;
						val3.max = val.hwAxisCalibrationData[val2.axisCount - 1].max;
						val3.invert = val.hwAxisCalibrationData[val2.axisCount - 1].invert;
						val3.axisInfo = val.hwAxisInfo[val2.axisCount - 1];
						val3.range = val.hwAxisRanges[val2.axisCount - 1];
					}
					else if ((int)current.elementType == 1)
					{
						val2.AddButton();
						val2.elementIdentifiers.RemoveAt(val2.elementIdentifiers.Count - 1);
						val2.elementIdentifiers.Add(current);
						Button val4 = val2.buttons.Last();
						((Element)val4).name = current.name;
						((Element)val4).elementIdentifierId = current.id;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			CustomController val5 = ReInput.controllers.CreateCustomController(val2.id);
			val5.INWFpUKrpjHVSASerjOUKheBAAJbb = false;
			return val5;
		}

		internal static Dictionary<int, CustomControllerMap> CreateGameplayMaps(int controllerID)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Expected O, but got Unknown
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Expected O, but got Unknown
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Expected O, but got Unknown
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Expected O, but got Unknown
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Expected O, but got Unknown
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Expected O, but got Unknown
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Expected O, but got Unknown
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Expected O, but got Unknown
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Expected O, but got Unknown
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Expected O, but got Unknown
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Expected O, but got Unknown
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Expected O, but got Unknown
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Expected O, but got Unknown
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Expected O, but got Unknown
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Expected O, but got Unknown
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Expected O, but got Unknown
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Expected O, but got Unknown
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Expected O, but got Unknown
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Expected O, but got Unknown
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Expected O, but got Unknown
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Expected O, but got Unknown
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Expected O, but got Unknown
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Expected O, but got Unknown
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Expected O, but got Unknown
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Expected O, but got Unknown
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Expected O, but got Unknown
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Expected O, but got Unknown
			List<ActionElementMap> actionElementMaps = new List<ActionElementMap>
			{
				new ActionElementMap(5, (ControllerElementType)0, 0, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(6, (ControllerElementType)0, 1, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(13, (ControllerElementType)0, 2, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(21, (ControllerElementType)1, 14, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(17, (ControllerElementType)1, 18, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(57, (ControllerElementType)1, 16, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(29, (ControllerElementType)1, 17, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(7, (ControllerElementType)1, 6, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(65, (ControllerElementType)1, 7, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(15, (ControllerElementType)1, 8, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(12, (ControllerElementType)1, 9, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(18, (ControllerElementType)1, 10, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(8, (ControllerElementType)1, 11, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(11, (ControllerElementType)0, 4, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(10, (ControllerElementType)0, 5, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(4, (ControllerElementType)1, 12, (Pole)0, (AxisRange)1, false)
			};
			List<ActionElementMap> actionElementMaps2 = new List<ActionElementMap>
			{
				new ActionElementMap(0, (ControllerElementType)0, 0, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(1, (ControllerElementType)0, 1, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(13, (ControllerElementType)0, 2, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(14, (ControllerElementType)0, 3, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(1, (ControllerElementType)1, 14, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(0, (ControllerElementType)1, 15, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(0, (ControllerElementType)1, 16, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(1, (ControllerElementType)1, 17, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(2, (ControllerElementType)1, 6, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(3, (ControllerElementType)1, 7, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(64, (ControllerElementType)1, 8, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(48, (ControllerElementType)1, 9, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(67, (ControllerElementType)1, 10, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(67, (ControllerElementType)1, 11, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(45, (ControllerElementType)0, 4, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(47, (ControllerElementType)0, 5, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(4, (ControllerElementType)1, 12, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(4, (ControllerElementType)1, 13, (Pole)0, (AxisRange)1, false)
			};
			List<ActionElementMap> actionElementMaps3 = new List<ActionElementMap>
			{
				new ActionElementMap(54, (ControllerElementType)1, 7, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(4, (ControllerElementType)1, 13, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(5, (ControllerElementType)0, 0, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(6, (ControllerElementType)0, 1, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(13, (ControllerElementType)0, 2, (Pole)0, (AxisRange)0, false),
				new ActionElementMap(14, (ControllerElementType)0, 3, (Pole)0, (AxisRange)0, false)
			};
			List<ActionElementMap> actionElementMaps4 = new List<ActionElementMap>
			{
				new ActionElementMap(19, (ControllerElementType)1, 6, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(20, (ControllerElementType)1, 7, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(59, (ControllerElementType)1, 8, (Pole)0, (AxisRange)1, false),
				new ActionElementMap(56, (ControllerElementType)1, 15, (Pole)0, (AxisRange)1, false)
			};
			List<ActionElementMap> list = new List<ActionElementMap>();
			Dictionary<int, CustomControllerMap> dictionary = new Dictionary<int, CustomControllerMap>();
			dictionary.Add(0, CreateCustomMap("VRControllersGameplay0", 0, controllerID, actionElementMaps));
			dictionary.Add(1, CreateCustomMap("VRControllersUI", 1, controllerID, actionElementMaps2));
			dictionary.Add(4, CreateCustomMap("VRControllersgraffiti", 4, controllerID, actionElementMaps3));
			dictionary.Add(6, CreateCustomMap("VRControllersgraffiti", 6, controllerID, actionElementMaps4));
			return dictionary;
		}

		private static CustomControllerMap CreateCustomMap(string mapName, int categoryId, int controllerId, List<ActionElementMap> actionElementMaps)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Invalid comparison between Unknown and I4
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			ReInput.UserData.CreateCustomControllerMap(categoryId, controllerId, 0);
			ControllerMap_Editor val = ReInput.UserData.customControllerMaps.Last();
			val.name = mapName;
			foreach (ActionElementMap actionElementMap2 in actionElementMaps)
			{
				val.AddActionElementMap();
				ActionElementMap actionElementMap = val.GetActionElementMap(val.ActionElementMaps.Count() - 1);
				actionElementMap.actionId = actionElementMap2.actionId;
				actionElementMap.wMLuAtALYahUqbpkWgPVSPwPblZL(actionElementMap2.elementType);
				actionElementMap.elementIdentifierId = actionElementMap2.elementIdentifierId;
				actionElementMap.axisContribution = actionElementMap2.axisContribution;
				if ((int)actionElementMap2.elementType == 0)
				{
					actionElementMap.axisRange = actionElementMap2.axisRange;
				}
				actionElementMap.invert = actionElementMap2.invert;
			}
			return ReInput.UserData.NZnDxVQLTylWuKontBsWrRhUJsyL(categoryId, controllerId, 0);
		}
	}
	public class VRInputs : MonoBehaviour
	{
		public static bool ControllersAlreadyInit;

		public static bool _hotKey;

		private static CustomController vrControllers;

		public static Dictionary<int, CustomControllerMap> vrControllersMaps;

		private static bool initializedMainPlayer;

		private static BaseInput[] inputs;

		internal static int ControllerID => ((Controller)vrControllers).id;

		private void Awake()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			VRInputManager.OnClickRightJoystick += ClickRightJoystick;
			SteamVR_Actions._default.ClickRightJoystick.AddOnStateUpListener(new StateUpHandler(ClickRightJoystickUp), (SteamVR_Input_Sources)0);
			Init();
		}

		private void Update()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			if (!initializedMainPlayer)
			{
				Player val = null;
				val = ReInput.players.GetPlayer(0);
				if (AddVRController(val))
				{
					initializedMainPlayer = true;
					Debug.LogWarning((object)"VRController successfully added");
				}
			}
			if (!GamePlugin.firstPerson.Value)
			{
				return;
			}
			if (_hotKey)
			{
				if (SteamVR_Actions._default.LeftJoystick.GetAxis((SteamVR_Input_Sources)1).x > 0.5f)
				{
					vrControllers.SetButtonValueById(17, true);
				}
				else
				{
					vrControllers.SetButtonValueById(17, false);
				}
				if (SteamVR_Actions._default.LeftJoystick.GetAxis((SteamVR_Input_Sources)1).x < -0.5f)
				{
					vrControllers.SetButtonValueById(16, true);
				}
				else
				{
					vrControllers.SetButtonValueById(16, false);
				}
				if (SteamVR_Actions._default.LeftJoystick.GetAxis((SteamVR_Input_Sources)1).y > 0.5f)
				{
					vrControllers.SetButtonValueById(14, true);
				}
				else
				{
					vrControllers.SetButtonValueById(14, false);
				}
				if (SteamVR_Actions._default.LeftJoystick.GetAxis((SteamVR_Input_Sources)1).y < -0.5f)
				{
					vrControllers.SetButtonValueById(15, true);
				}
				else
				{
					vrControllers.SetButtonValueById(15, false);
				}
				if (SteamVR_Actions._default.ClickLeftJoystick.GetStateDown((SteamVR_Input_Sources)0))
				{
					vrControllers.SetButtonValueById(18, true);
				}
				else
				{
					vrControllers.SetButtonValueById(18, false);
				}
			}
			else
			{
				vrControllers.SetButtonValueById(14, false);
				vrControllers.SetButtonValueById(15, false);
				vrControllers.SetButtonValueById(16, false);
				vrControllers.SetButtonValueById(17, false);
				vrControllers.SetButtonValueById(18, false);
			}
		}

		internal static void Init()
		{
			if (!ControllersAlreadyInit)
			{
				ReInput.InputSourceUpdateEvent += UpdateVRInputs;
				SetupControllerInputs();
				ControllersAlreadyInit = true;
			}
		}

		private static void SetupControllerInputs()
		{
			vrControllers = RewiredAddons.CreateRewiredController();
			vrControllersMaps = RewiredAddons.CreateGameplayMaps(((Controller)vrControllers).id);
			inputs = new BaseInput[12]
			{
				new VectorInput(SteamVR_Actions.default_LeftJoystick, 0, 1),
				new VectorInput(SteamVR_Actions.default_RightJoystick, 2, 3),
				new AxisInput(SteamVR_Actions.default_LeftTrigger, 4),
				new AxisInput(SteamVR_Actions.default_RightTrigger, 5),
				new ButtonInput(SteamVR_Actions.default_ButtonA, 6),
				new ButtonInput(SteamVR_Actions.default_ButtonB, 7),
				new ButtonInput(SteamVR_Actions.default_ButtonX, 8),
				new ButtonInput(SteamVR_Actions.default_ButtonY, 9),
				new ButtonInput(SteamVR_Actions.default_LeftGrip, 10),
				new ButtonInput(SteamVR_Actions.default_RightGrip, 11),
				new ButtonInput(SteamVR_Actions.default_ClickLeftJoystick, 12),
				new ButtonInput(SteamVR_Actions.default_ClickRightJoystick, 13)
			};
		}

		internal static bool AddVRController(Player inputPlayer)
		{
			if (!inputPlayer.controllers.ContainsController((Controller)(object)vrControllers))
			{
				inputPlayer.controllers.AddController((Controller)(object)vrControllers, false);
				((Controller)vrControllers).enabled = true;
			}
			if (inputPlayer.controllers.maps.GetAllMaps((ControllerType)20).ToList().Count < 1)
			{
				if (inputPlayer.controllers.maps.GetMap((ControllerType)20, ((Controller)vrControllers).id, 0, 0) == null)
				{
					KeyValuePair<int, CustomControllerMap>[] array = vrControllersMaps.ToArray();
					foreach (KeyValuePair<int, CustomControllerMap> keyValuePair in array)
					{
						inputPlayer.controllers.maps.AddMap((Controller)(object)vrControllers, (ControllerMap)(object)keyValuePair.Value);
					}
				}
				((ControllerMap)vrControllersMaps[1]).enabled = true;
			}
			return inputPlayer.controllers.ContainsController((Controller)(object)vrControllers) && inputPlayer.controllers.maps.GetAllMaps((ControllerType)20).ToList().Count >= 1;
		}

		private static void UpdateVRInputs()
		{
			BaseInput[] array = inputs;
			foreach (BaseInput baseInput in array)
			{
				baseInput.UpdateValues(vrControllers);
			}
		}

		public static void VibrateVRController(float intensity, SteamVR_Input_Sources source)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			SteamVR_Actions._default.Haptic.Execute(0f, Time.deltaTime, 1f / 60f, intensity, source);
		}

		private void ClickRightJoystick(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource)
		{
			_hotKey = true;
		}

		private void ClickRightJoystickUp(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource)
		{
			_hotKey = false;
		}

		public static void LogAllGameActions(Player player)
		{
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Invalid comparison between Unknown and I4
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Invalid comparison between Unknown and I4
			Debug.LogWarning((object)"LogAllGameActions started");
			foreach (Joystick joystick in player.controllers.Joysticks)
			{
				foreach (JoystickMap map in player.controllers.maps.GetMaps<JoystickMap>(((Controller)joystick).id))
				{
					Debug.LogWarning((object)("MAP CATEGORY " + ((ControllerMap)map).categoryId));
					foreach (ActionElementMap buttonMap in ((ControllerMap)map).ButtonMaps)
					{
						Debug.LogWarning((object)(buttonMap.elementIdentifierName + " is assigned to Button " + buttonMap.elementIndex + " with the Action " + ReInput.mapping.GetAction(buttonMap.actionId).name + " with actionId " + buttonMap.actionId));
					}
					foreach (ActionElementMap axisMap in ((ControllerMapWithAxes)map).AxisMaps)
					{
						Debug.LogWarning((object)(axisMap.elementIdentifierName + " is assigned to Axis " + axisMap.elementIndex + " with the Action " + ReInput.mapping.GetAction(axisMap.actionId).name + " with actionId " + axisMap.actionId));
					}
					foreach (ActionElementMap allMap in ((ControllerMap)map).AllMaps)
					{
						if ((int)allMap.elementType == 0)
						{
							Debug.LogWarning((object)(allMap.elementIdentifierName + " is assigned to Axis " + allMap.elementIndex + " with the Action " + ReInput.mapping.GetAction(allMap.actionId).name + " with actionId " + allMap.actionId));
						}
						else if ((int)allMap.elementType == 1)
						{
							Debug.LogWarning((object)(allMap.elementIdentifierName + " is assigned to Button " + allMap.elementIndex + " with the Action " + ReInput.mapping.GetAction(allMap.actionId).name + " with actionId " + allMap.actionId));
						}
					}
				}
			}
			Debug.LogWarning((object)"LogAllGameActions ended");
		}
	}
}
namespace UnityVRPlugin.patches
{
	public class GamePatches : MonoBehaviour
	{
		[HarmonyPatch]
		[HarmonyPatch(typeof(OutfitSwitchMenu), "StartMenu")]
		public static class OutfitSwitchMenuStartMenu
		{
			private static void Postfix(OutfitSwitchMenu __instance, CharacterVisual characterVisual)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				((Component)characterVisual.head).transform.localScale = playerHeadScale;
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(GraffitiGame), "InitVisual")]
		public static class GraffitiGameStartGraffitiMode
		{
			private static void Postfix(GraffitiGame __instance)
			{
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				CharacterVisual value = Traverse.Create((object)__instance).Field("characterPuppet").GetValue<CharacterVisual>();
				if ((Object)(object)value != (Object)null)
				{
					((Component)value.head).transform.localScale = playerHeadScale;
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(Player), "StartGraffitiMode")]
		public static class PlayerStartGraffitiMode
		{
			private static void Postfix(Player __instance)
			{
				inGraffitiMode = true;
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(Player), "EndGraffitiMode")]
		public static class PlayerEndGraffitiMode
		{
			private static void Postfix(Player __instance)
			{
				inGraffitiMode = false;
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(RewiredMappingHandler), "AddSavedControllerMapToPlayer")]
		public static class RewiredMappingHandlerAddSavedControllerMapToPlayer
		{
			private static bool Prefix(RewiredMappingHandler __instance)
			{
				if (GamePlugin.firstPerson.Value)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(Player), "HealthBarUpdate")]
		public static class PlayerHealthBarUpdate
		{
			private static void Postfix(Player __instance)
			{
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				GameplayUI value = Traverse.Create((object)__instance).Field("ui").GetValue<GameplayUI>();
				if ((Object)(object)value != (Object)null)
				{
					((Component)value.healthBarGroup).transform.localPosition = healthBarLocalPos;
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(VRCamFix), "updateActiveCamera")]
		public static class VRCamFixUpdateActiveCamera
		{
			private static void Prefix(VRCamFix __instance, ref GameObject target)
			{
				if (Object.op_Implicit((Object)(object)WorldHandler.instance) && Traverse.Create((object)WorldHandler.instance.GetCurrentPlayer()).Field("inGraffitiGame").GetValue<bool>())
				{
					target = null;
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(GraffitiGame), "InitVisual")]
		public static class GraffitiGameInitVisual
		{
			private static void Postfix(GraffitiGame __instance)
			{
				//IL_0016: 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_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				((Component)__instance).gameObject.transform.position = new Vector3(((Component)CanvasFix._UICamera).transform.position.x, ((Component)CanvasFix._UICamera).transform.position.y, ((Component)CanvasFix._UICamera).transform.position.z + 9.9f);
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(EffectsUI), "ShowBarsOfColor")]
		public static class EffectsUIShowBarsOfColor
		{
			private static void Postfix(EffectsUI __instance)
			{
				((Component)Traverse.Create((object)__instance).Field("topBar").GetValue<RectTransform>()).gameObject.SetActive(false);
				((Component)Traverse.Create((object)__instance).Field("bottomBar").GetValue<RectTransform>()).gameObject.SetActive(false);
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(DialogueUI), "StartDialogue")]
		public static class DialogueUIStartDialogue
		{
			private static void Postfix(DialogueUI __instance)
			{
				((Component)Traverse.Create((object)Traverse.Create((object)__instance).Field("effectsUI").GetValue<EffectsUI>()).Field("bottomBar").GetValue<RectTransform>()).gameObject.SetActive(true);
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(DialogueUI), "EndDialogue")]
		public static class DialogueUIEndDialogue
		{
			private static void Postfix(DialogueUI __instance)
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Invalid comparison between Unknown and I4
				DialogueBehaviour value = Traverse.Create((object)__instance).Field("currentDialogue").GetValue<DialogueBehaviour>();
				EffectsUI value2 = Traverse.Create((object)__instance).Field("effectsUI").GetValue<EffectsUI>();
				if (value != null && (int)value.showBars == 1 && (Object)(object)value2 != (Object)null)
				{
					((Component)Traverse.Create((object)value2).Field("bottomBar").GetValue<RectTransform>()).gameObject.SetActive(false);
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(RewiredMappingHandler), "EnableControllerMap")]
		public static class RewiredMappingHandlerEnableControllerMap
		{
			private static void Postfix(RewiredMappingHandler __instance, int controllerMapCategoryID)
			{
				if (GamePlugin.firstPerson.Value && VRInputs.vrControllersMaps.ContainsKey(controllerMapCategoryID))
				{
					((ControllerMap)VRInputs.vrControllersMaps[controllerMapCategoryID]).enabled = true;
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(RewiredMappingHandler), "DisableControllerMap")]
		public static class RewiredMappingHandlerDisableControllerMap
		{
			private static void Postfix(RewiredMappingHandler __instance, int controllerMapCategoryID)
			{
				if (GamePlugin.firstPerson.Value && VRInputs.vrControllersMaps.ContainsKey(controllerMapCategoryID))
				{
					((ControllerMap)VRInputs.vrControllersMaps[controllerMapCategoryID]).enabled = false;
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(RewiredMappingHandler), "DisableAllControllerInputMaps")]
		public static class RewiredMappingHandlerDisableAllControllerInputMaps
		{
			private static void Postfix(RewiredMappingHandler __instance)
			{
				if (!GamePlugin.firstPerson.Value)
				{
					return;
				}
				foreach (KeyValuePair<int, CustomControllerMap> vrControllersMap in VRInputs.vrControllersMaps)
				{
					((ControllerMap)vrControllersMap.Value).enabled = false;
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(Player), "SetCharacter")]
		public static class PlayerSetCharacter
		{
			public static void Postfix(Player __instance, Characters setChar, int setOutfit = 0)
			{
				if (GamePlugin.firstPerson.Value)
				{
					CharacterVisual value = Traverse.Create((object)__instance).Field("characterVisual").GetValue<CharacterVisual>();
					ApplyIk(value);
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(CharacterVisual), "SetMoveStyleVisualAnim")]
		public static class CharacterVisualSetMoveStyleVisualAnim
		{
			public static void Postfix(CharacterVisual __instance, Player player, MoveStyle setMoveStyle, GameObject specialSkateboard = null)
			{
				if (GamePlugin.firstPerson.Value)
				{
					ApplyIk(__instance);
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(CharacterVisual), "SetPhone")]
		public static class CharacterVisualSetPhone
		{
			public static void Postfix(CharacterVisual __instance, bool set)
			{
				if (GamePlugin.firstPerson.Value)
				{
					ApplyIk(__instance);
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(CharacterVisual), "SetSpraycan")]
		public static class CharacterVisualSetSpraycan
		{
			public static void Postfix(CharacterVisual __instance, bool set, Characters c = -1)
			{
				if (GamePlugin.firstPerson.Value)
				{
					ApplyIk(__instance);
				}
			}
		}

		[HarmonyPatch]
		[HarmonyPatch(typeof(GameInput), "IsPlayerControllerJoystick")]
		public static class GameInputIsPlayerControllerJoystick
		{
			public static void Postfix(ref bool __result)
			{
				if (GamePlugin.firstPerson.Value)
				{
					__result = true;
				}
			}
		}

		public float holdTimeThreshold = 1f;

		private float buttonHeldTime = 0f;

		public static GameObject playerHead = null;

		public static Vector3 playerHeadScale = Vector3.one;

		public static Vector3 playerHeadOffset = new Vector3(0f, 0.25f, 0.15f);

		public static Vector3 healthBarLocalPos = new Vector3(-400f, 400f, 0f);

		public static bool inGraffitiMode = false;

		private void Awake()
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			SceneManager.sceneLoaded += OnSceneLoaded;
			if (GamePlugin.firstPerson.Value)
			{
				((Component)this).gameObject.AddComponent<VRInputs>();
				VRCamFix.attachPosition = true;
				VRCamFix.attachPositionOffset = playerHeadOffset;
				if (GamePlugin.fullImmersive.Value)
				{
					VRCamFix.attachRotation = true;
					VRCamFix.attachRotationOffset = Quaternion.Euler(new Vector3(0f, 0f, 90f));
				}
				AssetLoader.InitAssetLoader();
				VRInputManager.initInput();
				VRInputManager.Setup();
				((Component)VRInputManager.RightHand.gameObject.transform.Find("vr_glove_right_model_slim(Clone)")).gameObject.SetActive(false);
				((Component)VRInputManager.LeftHand.gameObject.transform.Find("vr_glove_left_model_slim(Clone)")).gameObject.SetActive(false);
			}
		}

		private void Update()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object.op_Implicit((Object)(object)SequenceHandler.instance) && SequenceHandler.instance.IsInSequence()) || inGraffitiMode)
			{
				VRCamFix.decoupledPitch = false;
				VRHandler.vrCamera.clearFlags = (CameraClearFlags)1;
				VRCamFix.attachToOtherGameObj = false;
				if ((Object)(object)playerHead != (Object)null)
				{
					playerHead.transform.localScale = playerHeadScale;
				}
			}
			else if (GamePlugin.firstPerson.Value)
			{
				VRCamFix.decoupledPitch = false;
				VRCamFix.attachToOtherGameObj = true;
				if ((Object)(object)playerHead != (Object)null)
				{
					playerHead.transform.localScale = Vector3.zero;
				}
			}
			else
			{
				VRCamFix.decoupledPitch = true;
				VRCamFix.attachToOtherGameObj = false;
			}
			if (UnityInput.Current.GetKeyDown((KeyCode)282))
			{
				VRCamFix.willNeedResetHeadSetPos = true;
			}
			if ((Object)(object)Core.Instance != (Object)null && Core.Instance.GameInput != null && Core.Instance.GameInput.GetButtonHeld(4, 0))
			{
				buttonHeldTime += Time.deltaTime;
				if (buttonHeldTime >= holdTimeThreshold)
				{
					VRCamFix.willNeedResetHeadSetPos = true;
					buttonHeldTime = 0f;
				}
			}
			else
			{
				buttonHeldTime = 0f;
			}
			SetFirstPersonObj();
		}

		private void LateUpdate()
		{
			if (((Object)VRHandler.targetObject).name.Contains("gameplayCamera"))
			{
				VRHandler.vrCamera.clearFlags = (CameraClearFlags)1;
			}
		}

		public static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			playerHead = null;
		}

		public void SetFirstPersonObj()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			if (GamePlugin.firstPerson.Value && (Object)(object)WorldHandler.instance != (Object)null && (Object)(object)playerHead == (Object)null)
			{
				Player currentPlayer = WorldHandler.instance.GetCurrentPlayer();
				playerHead = ((Component)Traverse.Create((object)currentPlayer).Field("characterVisual").GetValue<CharacterVisual>()
					.head).gameObject;
				playerHeadScale = playerHead.transform.localScale;
			}
			if ((Object)(object)playerHead != (Object)null)
			{
				VRCamFix.gameObjToAttachVRCam = playerHead;
			}
		}

		public static void ApplyIk(CharacterVisual characterVisual)
		{
			Transform parent = ((Component)characterVisual).gameObject.transform.parent;
			if ((Object)(object)parent == (Object)null)
			{
				return;
			}
			parent = parent.parent;
			if (!((Object)(object)parent == (Object)null))
			{
				if ((Object)(object)VRInputManager.RightHand != (Object)null && (Object)(object)VRInputManager.LeftHand != (Object)null && !Traverse.Create((object)((Component)parent).GetComponent<Player>()).Field("isAI").GetValue<bool>())
				{
					characterVisual.handIKTargetL = VRInputManager.LeftHand.gameObject.transform;
					characterVisual.handIKTargetR = VRInputManager.RightHand.gameObject.transform;
					characterVisual.handIKActiveL = true;
					characterVisual.handIKActiveR = true;
				}
				else if ((Object)(object)parent.Find("IKL") != (Object)null)
				{
					characterVisual.handIKTargetL = parent.Find("IKL");
					characterVisual.handIKTargetR = parent.Find("IKR");
					characterVisual.handIKActiveL = true;
					characterVisual.handIKActiveR = true;
				}
			}
		}
	}
}
namespace Costura
{
	[CompilerGenerated]
	internal static class AssemblyLoader
	{
		private static object nullCacheLock = new object();

		private static Dictionary<string, bool> nullCache = new Dictionary<string, bool>();

		private static Dictionary<string, string> assemblyNames = new Dictionary<string, string>();

		private static Dictionary<string, string> symbolNames = new Dictionary<string, string>();

		private static int isAttached;

		private static string CultureToString(CultureInfo culture)
		{
			if (culture == null)
			{
				return "";
			}
			return culture.Name;
		}

		private static Assembly ReadExistingAssembly(AssemblyName name)
		{
			AppDomain currentDomain = AppDomain.CurrentDomain;
			Assembly[] assemblies = currentDomain.GetAssemblies();
			Assembly[] array = assemblies;
			foreach (Assembly assembly in array)
			{
				AssemblyName name2 = assembly.GetName();
				if (string.Equals(name2.Name, name.Name, StringComparison.InvariantCultureIgnoreCase) && string.Equals(CultureToString(name2.CultureInfo), CultureToString(name.CultureInfo), StringComparison.InvariantCultureIgnoreCase))
				{
					return assembly;
				}
			}
			return null;
		}

		private static void CopyTo(Stream source, Stream destination)
		{
			byte[] array = new byte[81920];
			int count;
			while ((count = source.Read(array, 0, array.Length)) != 0)
			{
				destination.Write(array, 0, count);
			}
		}

		private static Stream LoadStream(string fullName)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			if (fullName.EndsWith(".compressed"))
			{
				using (Stream stream = executingAssembly.GetManifestResourceStream(fullName))
				{
					using DeflateStream source = new DeflateStream(stream, CompressionMode.Decompress);
					MemoryStream memoryStream = new MemoryStream();
					CopyTo(source, memoryStream);
					memoryStream.Position = 0L;
					return memoryStream;
				}
			}
			return executingAssembly.GetManifestResourceStream(fullName);
		}

		private static Stream LoadStream(Dictionary<string, string> resourceNames, string name)
		{
			if (resourceNames.TryGetValue(name, out var value))
			{
				return LoadStream(value);
			}
			return null;
		}

		private static byte[] ReadStream(Stream stream)
		{
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			return array;
		}

		private static Assembly ReadFromEmbeddedResources(Dictionary<string, string> assemblyNames, Dictionary<string, string> symbolNames, AssemblyName requestedAssemblyName)
		{
			string text = requestedAssemblyName.Name.ToLowerInvariant();
			if (requestedAssemblyName.CultureInfo != null && !string.IsNullOrEmpty(requestedAssemblyName.CultureInfo.Name))
			{
				text = requestedAssemblyName.CultureInfo.Name + "." + text;
			}
			byte[] rawAssembly;
			using (Stream stream = LoadStream(assemblyNames, text))
			{
				if (stream == null)
				{
					return null;
				}
				rawAssembly = ReadStream(stream);
			}
			using (Stream stream2 = LoadStream(symbolNames, text))
			{
				if (stream2 != null)
				{
					byte[] rawSymbolStore = ReadStream(stream2);
					return Assembly.Load(rawAssembly, rawSymbolStore);
				}
			}
			return Assembly.Load(rawAssembly);
		}

		public static Assembly ResolveAssembly(object sender, ResolveEventArgs e)
		{
			lock (nullCacheLock)
			{
				if (nullCache.ContainsKey(e.Name))
				{
					return null;
				}
			}
			AssemblyName assemblyName = new AssemblyName(e.Name);
			Assembly assembly = ReadExistingAssembly(assemblyName);
			if ((object)assembly != null)
			{
				return assembly;
			}
			assembly = ReadFromEmbeddedResources(assemblyNames, symbolNames, assemblyName);
			if ((object)assembly == null)
			{
				lock (nullCacheLock)
				{
					nullCache[e.Name] = true;
				}
				if ((assemblyName.Flags & AssemblyNameFlags.Retargetable) != 0)
				{
					assembly = Assembly.Load(assemblyName);
				}
			}
			return assembly;
		}

		static AssemblyLoader()
		{
			assemblyNames.Add("costura", "costura.costura.dll.compressed");
			symbolNames.Add("costura", "costura.costura.pdb.compressed");
			assemblyNames.Add("unityvr_bepinex_post2020", "costura.unityvr_bepinex_post2020.dll.compressed");
		}

		public static void Attach()
		{
			if (Interlocked.Exchange(ref isAttached, 1) == 1)
			{
				return;
			}
			AppDomain currentDomain = AppDomain.CurrentDomain;
			currentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs e)
			{
				lock (nullCacheLock)
				{
					if (nullCache.ContainsKey(e.Name))
					{
						return null;
					}
				}
				AssemblyName assemblyName = new AssemblyName(e.Name);
				Assembly assembly = ReadExistingAssembly(assemblyName);
				if ((object)assembly != null)
				{
					return assembly;
				}
				assembly = ReadFromEmbeddedResources(assemblyNames, symbolNames, assemblyName);
				if ((object)assembly == null)
				{
					lock (nullCacheLock)
					{
						nullCache[e.Name] = true;
					}
					if ((assemblyName.Flags & AssemblyNameFlags.Retargetable) != 0)
					{
						assembly = Assembly.Load(assemblyName);
					}
				}
				return assembly;
			};
		}
	}
}
internal class BombRushCyberFunk_VR_ProcessedByFody
{
	internal const string FodyVersion = "6.5.5.0";

	internal const string Costura = "5.7.0";
}