using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion
{
	// Token: 0x020003A1 RID: 929
	[Token(Token = "0x20003A1")]
	public class SolverManager : MonoBehaviour
	{
		// Token: 0x060022D6 RID: 8918 RVA: 0x00050248 File Offset: 0x0004E448
		[Token(Token = "0x60022D6")]
		[Address(RVA = "0x11F3D10", Offset = "0x11F2B10", VA = "0x1811F3D10")]
		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: 0x060022D7 RID: 8919 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60022D7")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "4")]
		protected virtual void InitiateSolver()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060022D8 RID: 8920 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60022D8")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "5")]
		protected virtual void UpdateSolver()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060022D9 RID: 8921 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60022D9")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "6")]
		protected virtual void FixTransforms()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060022DA RID: 8922 RVA: 0x00050270 File Offset: 0x0004E470
		[Token(Token = "0x60022DA")]
		[Address(RVA = "0x11F4090", Offset = "0x11F2E90", VA = "0x1811F4090")]
		private void OnDisable()
		{
			if (Application.isPlaying && !this.componentInitiated)
			{
				Transform transform = base.transform;
				this.FindAnimatorRecursive(transform, true);
				this.InitiateSolver();
				this.componentInitiated = true;
			}
		}

		// Token: 0x060022DB RID: 8923 RVA: 0x000502AC File Offset: 0x0004E4AC
		[Token(Token = "0x60022DB")]
		[Address(RVA = "0x11F3FF0", Offset = "0x11F2DF0", VA = "0x1811F3FF0")]
		private void Start()
		{
			if (!this.componentInitiated)
			{
				Transform transform = base.transform;
				this.FindAnimatorRecursive(transform, true);
				this.InitiateSolver();
				this.componentInitiated = true;
			}
		}

		// Token: 0x170001F4 RID: 500
		// (get) Token: 0x060022DC RID: 8924 RVA: 0x000502E0 File Offset: 0x0004E4E0
		[Token(Token = "0x170001F4")]
		private bool animatePhysics
		{
			[Token(Token = "0x60022DC")]
			[Address(RVA = "0x11F4170", Offset = "0x11F2F70", VA = "0x1811F4170")]
			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: 0x060022DD RID: 8925 RVA: 0x0005033C File Offset: 0x0004E53C
		[Token(Token = "0x60022DD")]
		[Address(RVA = "0x11F3FF0", Offset = "0x11F2DF0", VA = "0x1811F3FF0")]
		private void Initiate()
		{
			if (!this.componentInitiated)
			{
				Transform transform = base.transform;
				this.FindAnimatorRecursive(transform, true);
				this.InitiateSolver();
				this.componentInitiated = true;
			}
		}

		// Token: 0x060022DE RID: 8926 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60022DE")]
		[Address(RVA = "0x11F4130", Offset = "0x11F2F30", VA = "0x1811F4130")]
		private void Update()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060022DF RID: 8927 RVA: 0x00050370 File Offset: 0x0004E570
		[Token(Token = "0x60022DF")]
		[Address(RVA = "0x11F3DA0", Offset = "0x11F2BA0", VA = "0x1811F3DA0")]
		private void FindAnimatorRecursive(Transform t, bool findInChildren)
		{
			if (!this.isAnimated)
			{
				Animator component = t.GetComponent<Animator>();
				this.animator = component;
				Animation component2 = t.GetComponent<Animation>();
				this.legacy = component2;
				if (!this.isAnimated)
				{
					Animator animator = this.animator;
					int num = 0;
					bool flag = animator == num;
					if (findInChildren != flag)
					{
						Animator componentInChildren = t.GetComponentInChildren<Animator>();
						this.animator = componentInChildren;
					}
					Animation animation = this.legacy;
					int num2 = 0;
					bool flag2 = animation == num2;
					if (findInChildren != flag2)
					{
						Animation componentInChildren2 = t.GetComponentInChildren<Animation>();
						this.legacy = componentInChildren2;
					}
					if (!this.isAnimated)
					{
						Transform parent = t.parent;
						int num3 = 0;
						if (parent != num3)
						{
							Transform parent2 = t.parent;
						}
					}
				}
			}
		}

		// Token: 0x170001F5 RID: 501
		// (get) Token: 0x060022E0 RID: 8928 RVA: 0x00050434 File Offset: 0x0004E634
		[Token(Token = "0x170001F5")]
		private bool isAnimated
		{
			[Token(Token = "0x60022E0")]
			[Address(RVA = "0x11F4250", Offset = "0x11F3050", VA = "0x1811F4250")]
			get
			{
				Animator animator = this.animator;
				int num = 0;
				if (animator != num)
				{
					return true;
				}
				Animation animation = this.legacy;
				int num2 = 0;
				return animation != num2;
			}
		}

		// Token: 0x060022E1 RID: 8929 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60022E1")]
		[Address(RVA = "0x11F3FA0", Offset = "0x11F2DA0", VA = "0x1811F3FA0")]
		private void FixedUpdate()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060022E2 RID: 8930 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60022E2")]
		[Address(RVA = "0x11F4040", Offset = "0x11F2E40", VA = "0x1811F4040")]
		private void LateUpdate()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060022E3 RID: 8931 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60022E3")]
		[Address(RVA = "0x11F40F0", Offset = "0x11F2EF0", VA = "0x1811F40F0")]
		public void UpdateSolverExternal()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060022E4 RID: 8932 RVA: 0x00050468 File Offset: 0x0004E668
		[Token(Token = "0x60022E4")]
		[Address(RVA = "0x434F80", Offset = "0x433D80", VA = "0x180434F80")]
		public SolverManager()
		{
		}

		// Token: 0x04002C0C RID: 11276
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002C0C")]
		[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: 0x04002C0D RID: 11277
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002C0D")]
		private Animator animator;

		// Token: 0x04002C0E RID: 11278
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002C0E")]
		private Animation legacy;

		// Token: 0x04002C0F RID: 11279
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002C0F")]
		private bool updateFrame;

		// Token: 0x04002C10 RID: 11280
		[FieldOffset(Offset = "0x31")]
		[Token(Token = "0x4002C10")]
		private bool componentInitiated;

		// Token: 0x04002C11 RID: 11281
		[FieldOffset(Offset = "0x32")]
		[Token(Token = "0x4002C11")]
		private bool skipSolverUpdate;
	}
}
