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

namespace RootMotion.Demos
{
	// Token: 0x020003D6 RID: 982
	[Token(Token = "0x20003D6")]
	public class TouchWalls : MonoBehaviour
	{
		// Token: 0x060023AE RID: 9134 RVA: 0x00051854 File Offset: 0x0004FA54
		[Token(Token = "0x60023AE")]
		[Address(RVA = "0x1303370", Offset = "0x1302170", VA = "0x181303370")]
		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: 0x060023AF RID: 9135 RVA: 0x00051898 File Offset: 0x0004FA98
		[Token(Token = "0x60023AF")]
		[Address(RVA = "0x1303220", Offset = "0x1302020", VA = "0x181303220")]
		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: 0x060023B0 RID: 9136 RVA: 0x000518E0 File Offset: 0x0004FAE0
		[Token(Token = "0x60023B0")]
		[Address(RVA = "0x13032A0", Offset = "0x13020A0", VA = "0x1813032A0")]
		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: 0x060023B1 RID: 9137 RVA: 0x00051940 File Offset: 0x0004FB40
		[Token(Token = "0x60023B1")]
		[Address(RVA = "0x3088F0", Offset = "0x3076F0", VA = "0x1803088F0")]
		public TouchWalls()
		{
		}

		// Token: 0x04002D39 RID: 11577
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002D39")]
		public InteractionSystem interactionSystem;

		// Token: 0x04002D3A RID: 11578
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002D3A")]
		public TouchWalls.EffectorLink[] effectorLinks;

		// Token: 0x020003D7 RID: 983
		[Token(Token = "0x20003D7")]
		[Serializable]
		public class EffectorLink
		{
			// Token: 0x060023B2 RID: 9138 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60023B2")]
			[Address(RVA = "0x69D140", Offset = "0x69BF40", VA = "0x18069D140")]
			public void Initiate(InteractionSystem interactionSystem)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060023B3 RID: 9139 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60023B3")]
			[Address(RVA = "0x69D020", Offset = "0x69BE20", VA = "0x18069D020")]
			private bool FindWalls(Vector3 direction)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060023B4 RID: 9140 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60023B4")]
			[Address(RVA = "0x69D830", Offset = "0x69C630", VA = "0x18069D830")]
			public void Update(InteractionSystem interactionSystem)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060023B5 RID: 9141 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60023B5")]
			[Address(RVA = "0x69D6C0", Offset = "0x69C4C0", VA = "0x18069D6C0")]
			private void StopTouch(InteractionSystem interactionSystem)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060023B6 RID: 9142 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60023B6")]
			[Address(RVA = "0x69D5C0", Offset = "0x69C3C0", VA = "0x18069D5C0")]
			private void OnInteractionStart(FullBodyBipedEffector effectorType, InteractionObject interactionObject)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060023B7 RID: 9143 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60023B7")]
			[Address(RVA = "0x69D540", Offset = "0x69C340", VA = "0x18069D540")]
			private void OnInteractionResume(FullBodyBipedEffector effectorType, InteractionObject interactionObject)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060023B8 RID: 9144 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60023B8")]
			[Address(RVA = "0x69D640", Offset = "0x69C440", VA = "0x18069D640")]
			private void OnInteractionStop(FullBodyBipedEffector effectorType, InteractionObject interactionObject)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060023B9 RID: 9145 RVA: 0x00051954 File Offset: 0x0004FB54
			[Token(Token = "0x60023B9")]
			[Address(RVA = "0x69CE30", Offset = "0x69BC30", VA = "0x18069CE30")]
			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: 0x060023BA RID: 9146 RVA: 0x00051A10 File Offset: 0x0004FC10
			[Token(Token = "0x60023BA")]
			[Address(RVA = "0x69E050", Offset = "0x69CE50", VA = "0x18069E050")]
			public EffectorLink()
			{
			}

			// Token: 0x04002D3B RID: 11579
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4002D3B")]
			public bool enabled = true;

			// Token: 0x04002D3C RID: 11580
			[FieldOffset(Offset = "0x14")]
			[Token(Token = "0x4002D3C")]
			public FullBodyBipedEffector effectorType;

			// Token: 0x04002D3D RID: 11581
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x4002D3D")]
			public InteractionObject interactionObject;

			// Token: 0x04002D3E RID: 11582
			[FieldOffset(Offset = "0x20")]
			[Token(Token = "0x4002D3E")]
			public Transform spherecastFrom;

			// Token: 0x04002D3F RID: 11583
			[FieldOffset(Offset = "0x28")]
			[Token(Token = "0x4002D3F")]
			public float spherecastRadius = 0.1f;

			// Token: 0x04002D40 RID: 11584
			[FieldOffset(Offset = "0x2C")]
			[Token(Token = "0x4002D40")]
			public float minDistance = 0.3f;

			// Token: 0x04002D41 RID: 11585
			[FieldOffset(Offset = "0x30")]
			[Token(Token = "0x4002D41")]
			public LayerMask touchLayers;

			// Token: 0x04002D42 RID: 11586
			[FieldOffset(Offset = "0x34")]
			[Token(Token = "0x4002D42")]
			public float lerpSpeed = 10f;

			// Token: 0x04002D43 RID: 11587
			[FieldOffset(Offset = "0x38")]
			[Token(Token = "0x4002D43")]
			public float minSwitchTime = 0.2f;

			// Token: 0x04002D44 RID: 11588
			[FieldOffset(Offset = "0x3C")]
			[Token(Token = "0x4002D44")]
			public float releaseDistance = 0.4f;

			// Token: 0x04002D45 RID: 11589
			[FieldOffset(Offset = "0x40")]
			[Token(Token = "0x4002D45")]
			public bool sliding;

			// Token: 0x04002D46 RID: 11590
			[FieldOffset(Offset = "0x44")]
			[Token(Token = "0x4002D46")]
			private Vector3 raycastDirectionLocal;

			// Token: 0x04002D47 RID: 11591
			[FieldOffset(Offset = "0x50")]
			[Token(Token = "0x4002D47")]
			private float raycastDistance;

			// Token: 0x04002D48 RID: 11592
			[FieldOffset(Offset = "0x54")]
			[Token(Token = "0x4002D48")]
			private bool inTouch;

			// Token: 0x04002D49 RID: 11593
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x4002D49")]
			private RaycastHit hit;

			// Token: 0x04002D4A RID: 11594
			[FieldOffset(Offset = "0x84")]
			[Token(Token = "0x4002D4A")]
			private Vector3 targetPosition;

			// Token: 0x04002D4B RID: 11595
			[FieldOffset(Offset = "0x90")]
			[Token(Token = "0x4002D4B")]
			private Quaternion targetRotation;

			// Token: 0x04002D4C RID: 11596
			[FieldOffset(Offset = "0xA0")]
			[Token(Token = "0x4002D4C")]
			private bool initiated;

			// Token: 0x04002D4D RID: 11597
			[FieldOffset(Offset = "0xA4")]
			[Token(Token = "0x4002D4D")]
			private float nextSwitchTime;

			// Token: 0x04002D4E RID: 11598
			[FieldOffset(Offset = "0xA8")]
			[Token(Token = "0x4002D4E")]
			private float speedF;
		}
	}
}
