using System;
using Cpp2IlInjected;
using UnityEngine;

namespace Obi.CrossPlatformInput
{
	// Token: 0x02000554 RID: 1364
	[Token(Token = "0x2000554")]
	public class TiltInput : MonoBehaviour
	{
		// Token: 0x06002F62 RID: 12130 RVA: 0x00067A84 File Offset: 0x00065C84
		[Token(Token = "0x6002F62")]
		[Address(RVA = "0xF5DFE0", Offset = "0xF5CFE0", VA = "0x180F5DFE0")]
		private void OnEnable()
		{
			TiltInput.AxisMapping axisMapping = this.mapping;
			if (axisMapping.type == TiltInput.AxisMapping.MappingType.NamedAxis)
			{
				CrossPlatformInputManager.VirtualAxis virtualAxis = new CrossPlatformInputManager.VirtualAxis(axisMapping.axisName);
				this.m_SteerAxis = virtualAxis;
				CrossPlatformInputManager.RegisterVirtualAxis(this.m_SteerAxis);
			}
		}

		// Token: 0x06002F63 RID: 12131 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002F63")]
		[Address(RVA = "0xF5E0A0", Offset = "0xF5D0A0", VA = "0x180F5E0A0")]
		private void Update()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002F64 RID: 12132 RVA: 0x00067AC8 File Offset: 0x00065CC8
		[Token(Token = "0x6002F64")]
		[Address(RVA = "0xF5DFC0", Offset = "0xF5CFC0", VA = "0x180F5DFC0")]
		private void OnDisable()
		{
			this.m_SteerAxis.Remove();
		}

		// Token: 0x06002F65 RID: 12133 RVA: 0x00067AE8 File Offset: 0x00065CE8
		[Token(Token = "0x6002F65")]
		[Address(RVA = "0xF5E2F0", Offset = "0xF5D2F0", VA = "0x180F5E2F0")]
		public TiltInput()
		{
		}

		// Token: 0x040037C0 RID: 14272
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x40037C0")]
		public TiltInput.AxisMapping mapping;

		// Token: 0x040037C1 RID: 14273
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x40037C1")]
		public TiltInput.AxisOptions tiltAroundAxis;

		// Token: 0x040037C2 RID: 14274
		[FieldOffset(Offset = "0x24")]
		[Token(Token = "0x40037C2")]
		public float fullTiltAngle = 25f;

		// Token: 0x040037C3 RID: 14275
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x40037C3")]
		public float centreAngleOffset;

		// Token: 0x040037C4 RID: 14276
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x40037C4")]
		private CrossPlatformInputManager.VirtualAxis m_SteerAxis;

		// Token: 0x02000555 RID: 1365
		[Token(Token = "0x2000555")]
		public enum AxisOptions
		{
			// Token: 0x040037C6 RID: 14278
			[Token(Token = "0x40037C6")]
			ForwardAxis,
			// Token: 0x040037C7 RID: 14279
			[Token(Token = "0x40037C7")]
			SidewaysAxis
		}

		// Token: 0x02000556 RID: 1366
		[Token(Token = "0x2000556")]
		[Serializable]
		public class AxisMapping
		{
			// Token: 0x06002F66 RID: 12134 RVA: 0x00067B08 File Offset: 0x00065D08
			[Token(Token = "0x6002F66")]
			[Address(RVA = "0x36ABD0", Offset = "0x369BD0", VA = "0x18036ABD0")]
			public AxisMapping()
			{
			}

			// Token: 0x040037C8 RID: 14280
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x40037C8")]
			public TiltInput.AxisMapping.MappingType type;

			// Token: 0x040037C9 RID: 14281
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x40037C9")]
			public string axisName;

			// Token: 0x02000557 RID: 1367
			[Token(Token = "0x2000557")]
			public enum MappingType
			{
				// Token: 0x040037CB RID: 14283
				[Token(Token = "0x40037CB")]
				NamedAxis,
				// Token: 0x040037CC RID: 14284
				[Token(Token = "0x40037CC")]
				MousePositionX,
				// Token: 0x040037CD RID: 14285
				[Token(Token = "0x40037CD")]
				MousePositionY,
				// Token: 0x040037CE RID: 14286
				[Token(Token = "0x40037CE")]
				MousePositionZ
			}
		}
	}
}
