using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x02000487 RID: 1159
	[Token(Token = "0x2000487")]
	public class ShoulderRotator : MonoBehaviour
	{
		// Token: 0x06002912 RID: 10514 RVA: 0x0005A3BC File Offset: 0x000585BC
		[Token(Token = "0x6002912")]
		[Address(RVA = "0x11F23B0", Offset = "0x11F11B0", VA = "0x1811F23B0")]
		private void Start()
		{
			FullBodyBipedIK component = base.GetComponent<FullBodyBipedIK>();
			this.ik = component;
			IKSolverFullBodyBiped solver = this.ik.solver;
			IKSolver.UpdateDelegate onPostUpdate = solver.OnPostUpdate;
			IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.RotateShoulders);
			Delegate @delegate = Delegate.Combine(onPostUpdate, updateDelegate);
			int num = 0;
			if (@delegate == 0 || @delegate != 0)
			{
				solver.OnPostUpdate = num;
				throw new NullReferenceException();
			}
			throw new InvalidCastException();
		}

		// Token: 0x06002913 RID: 10515 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002913")]
		[Address(RVA = "0x11F22B0", Offset = "0x11F10B0", VA = "0x1811F22B0")]
		private void RotateShoulders()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002914 RID: 10516 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002914")]
		[Address(RVA = "0x11F1DB0", Offset = "0x11F0BB0", VA = "0x1811F1DB0")]
		private void RotateShoulder(FullBodyBipedChain chain, float weight, float offset)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002915 RID: 10517 RVA: 0x0005A420 File Offset: 0x00058620
		[Token(Token = "0x6002915")]
		[Address(RVA = "0x11F1C50", Offset = "0x11F0A50", VA = "0x1811F1C50")]
		private IKMapping.BoneMap GetParentBoneMap(FullBodyBipedChain chain)
		{
			IKMappingLimb limbMapping = this.ik.solver.GetLimbMapping(chain);
			int num = 0;
			return limbMapping.GetBoneMap((IKMappingLimb.BoneMapType)num);
		}

		// Token: 0x06002916 RID: 10518 RVA: 0x0005A450 File Offset: 0x00058650
		[Token(Token = "0x6002916")]
		[Address(RVA = "0x11F1C90", Offset = "0x11F0A90", VA = "0x1811F1C90")]
		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.RotateShoulders);
				Delegate @delegate = Delegate.Remove(onPostUpdate, updateDelegate);
				int num2 = 0;
				if (@delegate != 0 && @delegate == 0)
				{
					throw new InvalidCastException();
				}
				solver.OnPostUpdate = num2;
			}
		}

		// Token: 0x06002917 RID: 10519 RVA: 0x0005A4BC File Offset: 0x000586BC
		[Token(Token = "0x6002917")]
		[Address(RVA = "0x11F24B0", Offset = "0x11F12B0", VA = "0x1811F24B0")]
		public ShoulderRotator()
		{
		}

		// Token: 0x04003261 RID: 12897
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4003261")]
		[Tooltip("Weight of shoulder rotation")]
		public float weight = 1.5f;

		// Token: 0x04003262 RID: 12898
		[FieldOffset(Offset = "0x1C")]
		[Token(Token = "0x4003262")]
		[Tooltip("The greater the offset, the sooner the shoulder will start rotating")]
		public float offset = 0.2f;

		// Token: 0x04003263 RID: 12899
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003263")]
		private FullBodyBipedIK ik;

		// Token: 0x04003264 RID: 12900
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003264")]
		private bool skip;
	}
}
