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

namespace RootMotion.Demos
{
	// Token: 0x02000410 RID: 1040
	[Token(Token = "0x2000410")]
	public class FBBIKSettings : MonoBehaviour
	{
		// Token: 0x06002606 RID: 9734 RVA: 0x00057EC0 File Offset: 0x000560C0
		[Token(Token = "0x6002606")]
		[Address(RVA = "0xD136C0", Offset = "0xD126C0", VA = "0x180D136C0")]
		public void UpdateSettings()
		{
			FullBodyBipedIK fullBodyBipedIK = this.ik;
			int num = 0;
			if (!(fullBodyBipedIK == num))
			{
				FullBodyBipedIK fullBodyBipedIK2 = this.ik;
				FBBIKSettings.Limb limb = this.leftArm;
				IKSolverFullBodyBiped solver = fullBodyBipedIK2.solver;
				int num2 = 0;
				limb.Apply((FullBodyBipedChain)num2, solver);
				FullBodyBipedIK fullBodyBipedIK3 = this.ik;
				FBBIKSettings.Limb limb2 = this.rightArm;
				IKSolverFullBodyBiped solver2 = fullBodyBipedIK3.solver;
				limb2.Apply(FullBodyBipedChain.RightArm, solver2);
				FullBodyBipedIK fullBodyBipedIK4 = this.ik;
				FBBIKSettings.Limb limb3 = this.leftLeg;
				IKSolverFullBodyBiped solver3 = fullBodyBipedIK4.solver;
				limb3.Apply(FullBodyBipedChain.LeftLeg, solver3);
				FullBodyBipedIK fullBodyBipedIK5 = this.ik;
				FBBIKSettings.Limb limb4 = this.rightLeg;
				IKSolverFullBodyBiped solver4 = fullBodyBipedIK5.solver;
				limb4.Apply(FullBodyBipedChain.RightLeg, solver4);
				FBIKChain fbikchain = this.ik.solver.chain[0];
				float num3 = this.rootPin;
				fbikchain.pin = num3;
				IKEffector bodyEffector = this.ik.solver.bodyEffector;
				bool flag = this.bodyEffectChildNodes;
				bodyEffector.effectChildNodes = flag;
			}
		}

		// Token: 0x06002607 RID: 9735 RVA: 0x00057FC4 File Offset: 0x000561C4
		[Token(Token = "0x6002607")]
		[Address(RVA = "0xD13630", Offset = "0xD12630", VA = "0x180D13630")]
		private void Start()
		{
			Debug.Log("FBBIKSettings is deprecated, you can now edit all the settings from the custom inspector of the FullBodyBipedIK component.");
			this.UpdateSettings();
			if (this.disableAfterStart)
			{
				int num = 0;
				base.enabled = num != 0;
				return;
			}
		}

		// Token: 0x06002608 RID: 9736 RVA: 0x00057FF4 File Offset: 0x000561F4
		[Token(Token = "0x6002608")]
		[Address(RVA = "0xD13840", Offset = "0xD12840", VA = "0x180D13840")]
		private void Update()
		{
			this.UpdateSettings();
		}

		// Token: 0x06002609 RID: 9737 RVA: 0x00058008 File Offset: 0x00056208
		[Token(Token = "0x6002609")]
		[Address(RVA = "0xD13850", Offset = "0xD12850", VA = "0x180D13850")]
		public FBBIKSettings()
		{
		}

		// Token: 0x04002F88 RID: 12168
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002F88")]
		public FullBodyBipedIK ik;

		// Token: 0x04002F89 RID: 12169
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002F89")]
		public bool disableAfterStart;

		// Token: 0x04002F8A RID: 12170
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002F8A")]
		public FBBIKSettings.Limb leftArm;

		// Token: 0x04002F8B RID: 12171
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002F8B")]
		public FBBIKSettings.Limb rightArm;

		// Token: 0x04002F8C RID: 12172
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4002F8C")]
		public FBBIKSettings.Limb leftLeg;

		// Token: 0x04002F8D RID: 12173
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4002F8D")]
		public FBBIKSettings.Limb rightLeg;

		// Token: 0x04002F8E RID: 12174
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4002F8E")]
		public float rootPin;

		// Token: 0x04002F8F RID: 12175
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4002F8F")]
		public bool bodyEffectChildNodes = true;

		// Token: 0x02000411 RID: 1041
		[Token(Token = "0x2000411")]
		[Serializable]
		public class Limb
		{
			// Token: 0x0600260A RID: 9738 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600260A")]
			[Address(RVA = "0x19BD6D0", Offset = "0x19BC6D0", VA = "0x1819BD6D0")]
			public void Apply(FullBodyBipedChain chain, IKSolverFullBodyBiped solver)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x0600260B RID: 9739 RVA: 0x00058024 File Offset: 0x00056224
			[Token(Token = "0x600260B")]
			[Address(RVA = "0x19BD750", Offset = "0x19BC750", VA = "0x1819BD750")]
			public Limb()
			{
			}

			// Token: 0x04002F90 RID: 12176
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4002F90")]
			public FBIKChain.Smoothing reachSmoothing;

			// Token: 0x04002F91 RID: 12177
			[FieldOffset(Offset = "0x14")]
			[Token(Token = "0x4002F91")]
			public float maintainRelativePositionWeight;

			// Token: 0x04002F92 RID: 12178
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x4002F92")]
			public float mappingWeight = 1f;
		}
	}
}
