using System;
using System.Xml.Schema;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion
{
	// Token: 0x020003F9 RID: 1017
	[Token(Token = "0x20003F9")]
	public class SolverManager : MonoBehaviour
	{
		// Token: 0x0600259F RID: 9631 RVA: 0x000574E4 File Offset: 0x000556E4
		[Token(Token = "0x600259F")]
		[Address(RVA = "0x1461CC0", Offset = "0x1460CC0", VA = "0x181461CC0")]
		public void Disable()
		{
			Transform transform = base.transform;
			Debug.Log("IK.Disable() is deprecated. Use enabled = false instead", transform);
			int num = 0;
			base.enabled = num != 0;
		}

		// Token: 0x060025A0 RID: 9632 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025A0")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "4")]
		protected virtual void InitiateSolver()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025A1 RID: 9633 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025A1")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "5")]
		protected virtual void UpdateSolver()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025A2 RID: 9634 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025A2")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "6")]
		protected virtual void FixTransforms()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025A3 RID: 9635 RVA: 0x0005750C File Offset: 0x0005570C
		[Token(Token = "0x60025A3")]
		[Address(RVA = "0x1462040", Offset = "0x1461040", VA = "0x181462040")]
		private void OnDisable()
		{
			if (Application.isPlaying && !this.componentInitiated)
			{
				Transform transform = base.transform;
				this.FindAnimatorRecursive(transform, true);
				this.InitiateSolver();
				this.componentInitiated = true;
			}
		}

		// Token: 0x060025A4 RID: 9636 RVA: 0x00057548 File Offset: 0x00055748
		[Token(Token = "0x60025A4")]
		[Address(RVA = "0x1461FA0", Offset = "0x1460FA0", VA = "0x181461FA0")]
		private void Start()
		{
			if (!this.componentInitiated)
			{
				Transform transform = base.transform;
				this.FindAnimatorRecursive(transform, true);
				this.InitiateSolver();
				this.componentInitiated = true;
			}
		}

		// Token: 0x17000219 RID: 537
		// (get) Token: 0x060025A5 RID: 9637 RVA: 0x0005757C File Offset: 0x0005577C
		[Token(Token = "0x17000219")]
		private bool animatePhysics
		{
			[Token(Token = "0x60025A5")]
			[Address(RVA = "0x1462120", Offset = "0x1461120", VA = "0x181462120")]
			get
			{
				Animator animator = this.animator;
				int num = 0;
				if (animator != num)
				{
					return this.animator.updateMode == AnimatorUpdateMode.AnimatePhysics;
				}
				Animation animation = this.legacy;
				int num2 = 0;
				bool flag = animation != num2;
				if (!flag)
				{
					return flag;
				}
				return this.legacy.animatePhysics;
			}
		}

		// Token: 0x060025A6 RID: 9638 RVA: 0x000575D8 File Offset: 0x000557D8
		[Token(Token = "0x60025A6")]
		[Address(RVA = "0x1461FA0", Offset = "0x1460FA0", VA = "0x181461FA0")]
		private void Initiate()
		{
			if (!this.componentInitiated)
			{
				Transform transform = base.transform;
				this.FindAnimatorRecursive(transform, true);
				this.InitiateSolver();
				this.componentInitiated = true;
			}
		}

		// Token: 0x060025A7 RID: 9639 RVA: 0x0005760C File Offset: 0x0005580C
		[Token(Token = "0x60025A7")]
		[Address(RVA = "0x14620E0", Offset = "0x14610E0", VA = "0x1814620E0")]
		private void Update()
		{
			if (!this.skipSolverUpdate)
			{
				bool animatePhysics = this.animatePhysics;
				if (!animatePhysics && this.fixTransforms != animatePhysics)
				{
					XmlSchemaType xmlType = base.XmlType;
					return;
				}
			}
		}

		// Token: 0x060025A8 RID: 9640 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025A8")]
		[Address(RVA = "0x1461D50", Offset = "0x1460D50", VA = "0x181461D50")]
		private void FindAnimatorRecursive(Transform t, bool findInChildren)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x1700021A RID: 538
		// (get) Token: 0x060025A9 RID: 9641 RVA: 0x00057640 File Offset: 0x00055840
		[Token(Token = "0x1700021A")]
		private bool isAnimated
		{
			[Token(Token = "0x60025A9")]
			[Address(RVA = "0x1462200", Offset = "0x1461200", VA = "0x181462200")]
			get
			{
				Animator animator = this.animator;
				int num = 0;
				if (animator != num)
				{
					return true;
				}
				Animation animation = this.legacy;
				int num2 = 0;
				return animation != num2;
			}
		}

		// Token: 0x060025AA RID: 9642 RVA: 0x00057674 File Offset: 0x00055874
		[Token(Token = "0x60025AA")]
		[Address(RVA = "0x1461F50", Offset = "0x1460F50", VA = "0x181461F50")]
		private void FixedUpdate()
		{
			if (this.skipSolverUpdate)
			{
				this.skipSolverUpdate = false;
			}
			this.updateFrame = true;
			if (this.animatePhysics && this.fixTransforms)
			{
				XmlSchemaType xmlType = base.XmlType;
				return;
			}
		}

		// Token: 0x060025AB RID: 9643 RVA: 0x000576B4 File Offset: 0x000558B4
		[Token(Token = "0x60025AB")]
		[Address(RVA = "0x1461FF0", Offset = "0x1460FF0", VA = "0x181461FF0")]
		private void LateUpdate()
		{
			if (!this.skipSolverUpdate && (!this.animatePhysics || this.updateFrame))
			{
				this.updateFrame = false;
				XmlSchemaType xmlType = base.XmlType;
				return;
			}
		}

		// Token: 0x060025AC RID: 9644 RVA: 0x000576EC File Offset: 0x000558EC
		[Token(Token = "0x60025AC")]
		[Address(RVA = "0x14620A0", Offset = "0x14610A0", VA = "0x1814620A0")]
		public void UpdateSolverExternal()
		{
			if (base.enabled)
			{
				this.skipSolverUpdate = true;
				XmlSchemaType xmlType = base.XmlType;
				return;
			}
		}

		// Token: 0x060025AD RID: 9645 RVA: 0x00057714 File Offset: 0x00055914
		[Token(Token = "0x60025AD")]
		[Address(RVA = "0x50F420", Offset = "0x50E420", VA = "0x18050F420")]
		public SolverManager()
		{
		}

		// Token: 0x04002EF6 RID: 12022
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002EF6")]
		[Tooltip("If true, will fix all the Transforms used by the solver to their initial state in each Update. This prevents potential problems with unanimated bones and animator culling with a small cost of performance. Not recommended for CCD and FABRIK solvers.")]
		public bool fixTransforms = true;

		// Token: 0x04002EF7 RID: 12023
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002EF7")]
		private Animator animator;

		// Token: 0x04002EF8 RID: 12024
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002EF8")]
		private Animation legacy;

		// Token: 0x04002EF9 RID: 12025
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002EF9")]
		private bool updateFrame;

		// Token: 0x04002EFA RID: 12026
		[FieldOffset(Offset = "0x31")]
		[Token(Token = "0x4002EFA")]
		private bool componentInitiated;

		// Token: 0x04002EFB RID: 12027
		[FieldOffset(Offset = "0x32")]
		[Token(Token = "0x4002EFB")]
		private bool skipSolverUpdate;
	}
}
