using System;
using Cpp2IlInjected;
using UnityEngine;

namespace Obi.CrossPlatformInput
{
	// Token: 0x020004FC RID: 1276
	[Token(Token = "0x20004FC")]
	public class TiltInput : MonoBehaviour
	{
		// Token: 0x06002C99 RID: 11417 RVA: 0x000607F0 File Offset: 0x0005E9F0
		[Token(Token = "0x6002C99")]
		[Address(RVA = "0x1300970", Offset = "0x12FF770", VA = "0x181300970")]
		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: 0x06002C9A RID: 11418 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002C9A")]
		[Address(RVA = "0x1300A30", Offset = "0x12FF830", VA = "0x181300A30")]
		private void Update()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002C9B RID: 11419 RVA: 0x00060834 File Offset: 0x0005EA34
		[Token(Token = "0x6002C9B")]
		[Address(RVA = "0x1300950", Offset = "0x12FF750", VA = "0x181300950")]
		private void OnDisable()
		{
			this.m_SteerAxis.Remove();
		}

		// Token: 0x06002C9C RID: 11420 RVA: 0x00060854 File Offset: 0x0005EA54
		[Token(Token = "0x6002C9C")]
		[Address(RVA = "0x1300C80", Offset = "0x12FFA80", VA = "0x181300C80")]
		public TiltInput()
		{
		}

		// Token: 0x040034D6 RID: 13526
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x40034D6")]
		public TiltInput.AxisMapping mapping;

		// Token: 0x040034D7 RID: 13527
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x40034D7")]
		public TiltInput.AxisOptions tiltAroundAxis;

		// Token: 0x040034D8 RID: 13528
		[FieldOffset(Offset = "0x24")]
		[Token(Token = "0x40034D8")]
		public float fullTiltAngle = 25f;

		// Token: 0x040034D9 RID: 13529
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x40034D9")]
		public float centreAngleOffset;

		// Token: 0x040034DA RID: 13530
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x40034DA")]
		private CrossPlatformInputManager.VirtualAxis m_SteerAxis;

		// Token: 0x020004FD RID: 1277
		[Token(Token = "0x20004FD")]
		public enum AxisOptions
		{
			// Token: 0x040034DC RID: 13532
			[Token(Token = "0x40034DC")]
			ForwardAxis,
			// Token: 0x040034DD RID: 13533
			[Token(Token = "0x40034DD")]
			SidewaysAxis
		}

		// Token: 0x020004FE RID: 1278
		[Token(Token = "0x20004FE")]
		[Serializable]
		public class AxisMapping
		{
			// Token: 0x06002C9D RID: 11421 RVA: 0x00060874 File Offset: 0x0005EA74
			[Token(Token = "0x6002C9D")]
			[Address(RVA = "0x3D8B20", Offset = "0x3D7920", VA = "0x1803D8B20")]
			public AxisMapping()
			{
			}

			// Token: 0x040034DE RID: 13534
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x40034DE")]
			public TiltInput.AxisMapping.MappingType type;

			// Token: 0x040034DF RID: 13535
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x40034DF")]
			public string axisName;

			// Token: 0x020004FF RID: 1279
			[Token(Token = "0x20004FF")]
			public enum MappingType
			{
				// Token: 0x040034E1 RID: 13537
				[Token(Token = "0x40034E1")]
				NamedAxis,
				// Token: 0x040034E2 RID: 13538
				[Token(Token = "0x40034E2")]
				MousePositionX,
				// Token: 0x040034E3 RID: 13539
				[Token(Token = "0x40034E3")]
				MousePositionY,
				// Token: 0x040034E4 RID: 13540
				[Token(Token = "0x40034E4")]
				MousePositionZ
			}
		}
	}
}
