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

namespace RootMotion.Demos
{
	// Token: 0x020003BC RID: 956
	[Token(Token = "0x20003BC")]
	public class FBIKHandsOnProp : MonoBehaviour
	{
		// Token: 0x06002349 RID: 9033 RVA: 0x00050E78 File Offset: 0x0004F078
		[Token(Token = "0x6002349")]
		[Address(RVA = "0x4BB7F0", Offset = "0x4BA5F0", VA = "0x1804BB7F0")]
		private void Awake()
		{
			IKSolverFullBodyBiped solver = this.ik.solver;
			IKSolver.UpdateDelegate onPreRead = solver.OnPreRead;
			IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.OnPreRead);
			Delegate @delegate = Delegate.Combine(onPreRead, updateDelegate);
			int num = 0;
			if (@delegate == 0 || @delegate != 0)
			{
				solver.OnPreRead = num;
				throw new NullReferenceException();
			}
			throw new InvalidCastException();
		}

		// Token: 0x0600234A RID: 9034 RVA: 0x00050ECC File Offset: 0x0004F0CC
		[Token(Token = "0x600234A")]
		[Address(RVA = "0x4BC0E0", Offset = "0x4BAEE0", VA = "0x1804BC0E0")]
		private void OnPreRead()
		{
			FullBodyBipedIK fullBodyBipedIK = this.ik;
			if (!this.leftHanded)
			{
				IKEffector rightHandEffector = fullBodyBipedIK.solver.rightHandEffector;
				IKEffector leftHandEffector = this.ik.solver.leftHandEffector;
			}
			IKEffector leftHandEffector2 = fullBodyBipedIK.solver.leftHandEffector;
			IKEffector rightHandEffector2 = this.ik.solver.rightHandEffector;
			this.HandsOnProp(leftHandEffector2, rightHandEffector2);
		}

		// Token: 0x0600234B RID: 9035 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600234B")]
		[Address(RVA = "0x4BB8E0", Offset = "0x4BA6E0", VA = "0x1804BB8E0")]
		private void HandsOnProp(IKEffector mainHand, IKEffector otherHand)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600234C RID: 9036 RVA: 0x00050F34 File Offset: 0x0004F134
		[Token(Token = "0x600234C")]
		[Address(RVA = "0x4BBFB0", Offset = "0x4BADB0", VA = "0x1804BBFB0")]
		private void OnDestroy()
		{
			FullBodyBipedIK fullBodyBipedIK = this.ik;
			int num = 0;
			if (fullBodyBipedIK != num)
			{
				IKSolverFullBodyBiped solver = this.ik.solver;
				IKSolver.UpdateDelegate onPreRead = solver.OnPreRead;
				IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.OnPreRead);
				Delegate @delegate = Delegate.Remove(onPreRead, updateDelegate);
				int num2 = 0;
				if (@delegate != 0 && @delegate == 0)
				{
					throw new InvalidCastException();
				}
				solver.OnPreRead = num2;
			}
		}

		// Token: 0x0600234D RID: 9037 RVA: 0x00050FA0 File Offset: 0x0004F1A0
		[Token(Token = "0x600234D")]
		[Address(RVA = "0x3088F0", Offset = "0x3076F0", VA = "0x1803088F0")]
		public FBIKHandsOnProp()
		{
		}

		// Token: 0x04002CB4 RID: 11444
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002CB4")]
		public FullBodyBipedIK ik;

		// Token: 0x04002CB5 RID: 11445
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002CB5")]
		public bool leftHanded;
	}
}
