using System;
using Cpp2IlInjected;
using RootMotion.FinalIK;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x0200042E RID: 1070
	[Token(Token = "0x200042E")]
	public class TouchWalls : MonoBehaviour
	{
		// Token: 0x06002677 RID: 9847 RVA: 0x00058AAC File Offset: 0x00056CAC
		[Token(Token = "0x6002677")]
		[Address(RVA = "0xF611A0", Offset = "0xF601A0", VA = "0x180F611A0")]
		private void Start()
		{
			TouchWalls.EffectorLink[] array = this.effectorLinks;
			int num = 0;
			int length = array.Length;
			if (num < length)
			{
				TouchWalls.EffectorLink effectorLink = array[num];
				InteractionSystem interactionSystem = this.interactionSystem;
				effectorLink.Initiate(interactionSystem);
				num++;
			}
		}

		// Token: 0x06002678 RID: 9848 RVA: 0x00058AF0 File Offset: 0x00056CF0
		[Token(Token = "0x6002678")]
		[Address(RVA = "0xF61050", Offset = "0xF60050", VA = "0x180F61050")]
		private void FixedUpdate()
		{
			TouchWalls.EffectorLink[] array = this.effectorLinks;
			int num = 0;
			if (num < array.Length)
			{
				TouchWalls.EffectorLink effectorLink = array[num];
				InteractionSystem interactionSystem = this.interactionSystem;
				effectorLink.Update(interactionSystem);
				TouchWalls.EffectorLink[] array2 = this.effectorLinks;
				num++;
			}
		}

		// Token: 0x06002679 RID: 9849 RVA: 0x00058B38 File Offset: 0x00056D38
		[Token(Token = "0x6002679")]
		[Address(RVA = "0xF610D0", Offset = "0xF600D0", VA = "0x180F610D0")]
		private void OnDestroy()
		{
			InteractionSystem interactionSystem = this.interactionSystem;
			int num = 0;
			if (interactionSystem != num)
			{
				TouchWalls.EffectorLink[] array = this.effectorLinks;
				int num2 = 0;
				if (num2 < array.Length)
				{
					TouchWalls.EffectorLink effectorLink = array[num2];
					InteractionSystem interactionSystem2 = this.interactionSystem;
					effectorLink.Destroy(interactionSystem2);
					TouchWalls.EffectorLink[] array2 = this.effectorLinks;
					num2++;
				}
			}
		}

		// Token: 0x0600267A RID: 9850 RVA: 0x00058B98 File Offset: 0x00056D98
		[Token(Token = "0x600267A")]
		[Address(RVA = "0x328C40", Offset = "0x327C40", VA = "0x180328C40")]
		public TouchWalls()
		{
		}

		// Token: 0x04003023 RID: 12323
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4003023")]
		public InteractionSystem interactionSystem;

		// Token: 0x04003024 RID: 12324
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003024")]
		public TouchWalls.EffectorLink[] effectorLinks;

		// Token: 0x0200042F RID: 1071
		[Token(Token = "0x200042F")]
		[Serializable]
		public class EffectorLink
		{
			// Token: 0x0600267B RID: 9851 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600267B")]
			[Address(RVA = "0x6C6BE0", Offset = "0x6C5BE0", VA = "0x1806C6BE0")]
			public void Initiate(InteractionSystem interactionSystem)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x0600267C RID: 9852 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600267C")]
			[Address(RVA = "0x6C6AC0", Offset = "0x6C5AC0", VA = "0x1806C6AC0")]
			private bool FindWalls(Vector3 direction)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x0600267D RID: 9853 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600267D")]
			[Address(RVA = "0x6C72D0", Offset = "0x6C62D0", VA = "0x1806C72D0")]
			public void Update(InteractionSystem interactionSystem)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x0600267E RID: 9854 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600267E")]
			[Address(RVA = "0x6C7160", Offset = "0x6C6160", VA = "0x1806C7160")]
			private void StopTouch(InteractionSystem interactionSystem)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x0600267F RID: 9855 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600267F")]
			[Address(RVA = "0x6C7060", Offset = "0x6C6060", VA = "0x1806C7060")]
			private void OnInteractionStart(FullBodyBipedEffector effectorType, InteractionObject interactionObject)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002680 RID: 9856 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002680")]
			[Address(RVA = "0x6C6FE0", Offset = "0x6C5FE0", VA = "0x1806C6FE0")]
			private void OnInteractionResume(FullBodyBipedEffector effectorType, InteractionObject interactionObject)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002681 RID: 9857 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002681")]
			[Address(RVA = "0x6C70E0", Offset = "0x6C60E0", VA = "0x1806C70E0")]
			private void OnInteractionStop(FullBodyBipedEffector effectorType, InteractionObject interactionObject)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002682 RID: 9858 RVA: 0x00058BAC File Offset: 0x00056DAC
			[Token(Token = "0x6002682")]
			[Address(RVA = "0x6C68D0", Offset = "0x6C58D0", VA = "0x1806C68D0")]
			public void Destroy(InteractionSystem interactionSystem)
			{
				if (this.initiated)
				{
					InteractionSystem.InteractionDelegate onInteractionStart = interactionSystem.OnInteractionStart;
					InteractionSystem.InteractionDelegate interactionDelegate = new InteractionSystem.InteractionDelegate(this.OnInteractionStart);
					Delegate @delegate = Delegate.Remove(onInteractionStart, interactionDelegate);
					int num = 0;
					if (@delegate == 0 || @delegate != 0)
					{
						interactionSystem.OnInteractionStart = num;
						InteractionSystem.InteractionDelegate onInteractionResume = interactionSystem.OnInteractionResume;
						InteractionSystem.InteractionDelegate interactionDelegate2 = new InteractionSystem.InteractionDelegate(this.OnInteractionResume);
						Delegate delegate2 = Delegate.Remove(onInteractionResume, interactionDelegate2);
						if (delegate2 == 0 || delegate2 != 0)
						{
							interactionSystem.OnInteractionResume = delegate2;
							InteractionSystem.InteractionDelegate onInteractionStop = interactionSystem.OnInteractionStop;
							InteractionSystem.InteractionDelegate interactionDelegate3 = new InteractionSystem.InteractionDelegate(this.OnInteractionStop);
							Delegate delegate3 = Delegate.Remove(onInteractionStop, interactionDelegate3);
							if (delegate3 == 0 || delegate3 != 0)
							{
								interactionSystem.OnInteractionStop = delegate3;
								return;
							}
						}
					}
					throw new InvalidCastException();
				}
			}

			// Token: 0x06002683 RID: 9859 RVA: 0x00058C68 File Offset: 0x00056E68
			[Token(Token = "0x6002683")]
			[Address(RVA = "0x6C7AF0", Offset = "0x6C6AF0", VA = "0x1806C7AF0")]
			public EffectorLink()
			{
			}

			// Token: 0x04003025 RID: 12325
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4003025")]
			public bool enabled = true;

			// Token: 0x04003026 RID: 12326
			[FieldOffset(Offset = "0x14")]
			[Token(Token = "0x4003026")]
			public FullBodyBipedEffector effectorType;

			// Token: 0x04003027 RID: 12327
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x4003027")]
			public InteractionObject interactionObject;

			// Token: 0x04003028 RID: 12328
			[FieldOffset(Offset = "0x20")]
			[Token(Token = "0x4003028")]
			public Transform spherecastFrom;

			// Token: 0x04003029 RID: 12329
			[FieldOffset(Offset = "0x28")]
			[Token(Token = "0x4003029")]
			public float spherecastRadius = 0.1f;

			// Token: 0x0400302A RID: 12330
			[FieldOffset(Offset = "0x2C")]
			[Token(Token = "0x400302A")]
			public float minDistance = 0.3f;

			// Token: 0x0400302B RID: 12331
			[FieldOffset(Offset = "0x30")]
			[Token(Token = "0x400302B")]
			public LayerMask touchLayers;

			// Token: 0x0400302C RID: 12332
			[FieldOffset(Offset = "0x34")]
			[Token(Token = "0x400302C")]
			public float lerpSpeed = 10f;

			// Token: 0x0400302D RID: 12333
			[FieldOffset(Offset = "0x38")]
			[Token(Token = "0x400302D")]
			public float minSwitchTime = 0.2f;

			// Token: 0x0400302E RID: 12334
			[FieldOffset(Offset = "0x3C")]
			[Token(Token = "0x400302E")]
			public float releaseDistance = 0.4f;

			// Token: 0x0400302F RID: 12335
			[FieldOffset(Offset = "0x40")]
			[Token(Token = "0x400302F")]
			public bool sliding;

			// Token: 0x04003030 RID: 12336
			[FieldOffset(Offset = "0x44")]
			[Token(Token = "0x4003030")]
			private Vector3 raycastDirectionLocal;

			// Token: 0x04003031 RID: 12337
			[FieldOffset(Offset = "0x50")]
			[Token(Token = "0x4003031")]
			private float raycastDistance;

			// Token: 0x04003032 RID: 12338
			[FieldOffset(Offset = "0x54")]
			[Token(Token = "0x4003032")]
			private bool inTouch;

			// Token: 0x04003033 RID: 12339
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x4003033")]
			private RaycastHit hit;

			// Token: 0x04003034 RID: 12340
			[FieldOffset(Offset = "0x84")]
			[Token(Token = "0x4003034")]
			private Vector3 targetPosition;

			// Token: 0x04003035 RID: 12341
			[FieldOffset(Offset = "0x90")]
			[Token(Token = "0x4003035")]
			private Quaternion targetRotation;

			// Token: 0x04003036 RID: 12342
			[FieldOffset(Offset = "0xA0")]
			[Token(Token = "0x4003036")]
			private bool initiated;

			// Token: 0x04003037 RID: 12343
			[FieldOffset(Offset = "0xA4")]
			[Token(Token = "0x4003037")]
			private float nextSwitchTime;

			// Token: 0x04003038 RID: 12344
			[FieldOffset(Offset = "0xA8")]
			[Token(Token = "0x4003038")]
			private float speedF;
		}
	}
}
