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

namespace RootMotion.Demos
{
	// Token: 0x020003D9 RID: 985
	[Token(Token = "0x20003D9")]
	public class TwoHandedProp : MonoBehaviour
	{
		// Token: 0x060023BE RID: 9150 RVA: 0x00051A84 File Offset: 0x0004FC84
		[Token(Token = "0x60023BE")]
		[Address(RVA = "0x75B400", Offset = "0x75A200", VA = "0x18075B400")]
		private void Start()
		{
			FullBodyBipedIK component = base.GetComponent<FullBodyBipedIK>();
			this.ik = component;
			IKSolverFullBodyBiped solver = this.ik.solver;
			IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.AfterFBBIK);
			Delegate @delegate = Delegate.Combine(updateDelegate, updateDelegate);
			int num = 0;
			if (@delegate == 0 || @delegate != 0)
			{
				solver.OnPostUpdate = num;
				this.ik.solver.leftHandEffector.positionWeight = 1f;
				this.ik.solver.rightHandEffector.positionWeight = 1f;
				Transform target = this.ik.solver.rightHandEffector.target;
				int num2 = 0;
				if (target == num2)
				{
					Debug.LogError("Right Hand Effector needs a Target in this demo.");
				}
				return;
			}
			throw new InvalidCastException();
		}

		// Token: 0x060023BF RID: 9151 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60023BF")]
		[Address(RVA = "0x75AFD0", Offset = "0x759DD0", VA = "0x18075AFD0")]
		private void LateUpdate()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060023C0 RID: 9152 RVA: 0x00051B44 File Offset: 0x0004FD44
		[Token(Token = "0x60023C0")]
		[Address(RVA = "0x75AED0", Offset = "0x759CD0", VA = "0x18075AED0")]
		private void AfterFBBIK()
		{
			Transform bone = this.ik.solver.leftHandEffector.bone;
			Quaternion rotation = this.ik.solver.leftHandEffector.rotation;
			bone.rotation = rotation;
			Transform bone2 = this.ik.solver.rightHandEffector.bone;
			Quaternion rotation2 = this.ik.solver.rightHandEffector.rotation;
			bone2.rotation = rotation2;
		}

		// Token: 0x060023C1 RID: 9153 RVA: 0x00051BC0 File Offset: 0x0004FDC0
		[Token(Token = "0x60023C1")]
		[Address(RVA = "0x75B2E0", Offset = "0x75A0E0", VA = "0x18075B2E0")]
		private void OnDestroy()
		{
			FullBodyBipedIK fullBodyBipedIK = this.ik;
			int num = 0;
			if (fullBodyBipedIK != num)
			{
				IKSolverFullBodyBiped solver = this.ik.solver;
				IKSolver.UpdateDelegate onPostUpdate = solver.OnPostUpdate;
				IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.AfterFBBIK);
				Delegate @delegate = Delegate.Remove(onPostUpdate, updateDelegate);
				int num2 = 0;
				if (@delegate != 0 && @delegate == 0)
				{
					throw new InvalidCastException();
				}
				solver.OnPostUpdate = num2;
			}
		}

		// Token: 0x060023C2 RID: 9154 RVA: 0x00051C2C File Offset: 0x0004FE2C
		[Token(Token = "0x60023C2")]
		[Address(RVA = "0x3088F0", Offset = "0x3076F0", VA = "0x1803088F0")]
		public TwoHandedProp()
		{
		}

		// Token: 0x04002D52 RID: 11602
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002D52")]
		[Tooltip("The left hand target parented to the right hand.")]
		public Transform leftHandTarget;

		// Token: 0x04002D53 RID: 11603
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002D53")]
		private FullBodyBipedIK ik;

		// Token: 0x04002D54 RID: 11604
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002D54")]
		private Vector3 targetPosRelativeToRight;

		// Token: 0x04002D55 RID: 11605
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4002D55")]
		private Quaternion targetRotRelativeToRight;
	}
}
