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

namespace RootMotion.Demos
{
	// Token: 0x020003FF RID: 1023
	[Token(Token = "0x20003FF")]
	public class SimpleAimingSystem : MonoBehaviour
	{
		// Token: 0x060025C2 RID: 9666 RVA: 0x00057858 File Offset: 0x00055A58
		[Token(Token = "0x60025C2")]
		[Address(RVA = "0x1460AD0", Offset = "0x145FAD0", VA = "0x181460AD0")]
		private void Start()
		{
			AimIK aimIK = this.aim;
			int num = 0;
			aimIK.enabled = num != 0;
			LookAtIK lookAtIK = this.lookAt;
			int num2 = 0;
			lookAtIK.enabled = num2 != 0;
		}

		// Token: 0x060025C3 RID: 9667 RVA: 0x0005788C File Offset: 0x00055A8C
		[Token(Token = "0x60025C3")]
		[Address(RVA = "0x1460510", Offset = "0x145F510", VA = "0x181460510")]
		private void LateUpdate()
		{
			Transform target = this.aim.solver.target;
			int num = 0;
			if (target == num)
			{
				Transform transform = base.transform;
				Debug.LogWarning("AimIK and LookAtIK need to have their 'Target' value assigned.", transform);
			}
			this.Pose();
			this.aim.solver.Update();
			LookAtIK lookAtIK = this.lookAt;
			int num2 = 0;
			if (lookAtIK != num2)
			{
				this.lookAt.solver.Update();
			}
		}

		// Token: 0x060025C4 RID: 9668 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025C4")]
		[Address(RVA = "0x1460860", Offset = "0x145F860", VA = "0x181460860")]
		private void Pose()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025C5 RID: 9669 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025C5")]
		[Address(RVA = "0x1460660", Offset = "0x145F660", VA = "0x181460660")]
		private void LimitAimTarget()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025C6 RID: 9670 RVA: 0x0005790C File Offset: 0x00055B0C
		[Token(Token = "0x60025C6")]
		[Address(RVA = "0x1460480", Offset = "0x145F480", VA = "0x181460480")]
		private void DirectCrossFade(string state, float target)
		{
			float @float = this.animator.GetFloat(state);
			float num = Time.deltaTime;
			num = @float;
			float num2 = Mathf.MoveTowards(num, target, 1f);
			this.animator.SetFloat(state, num2);
		}

		// Token: 0x060025C7 RID: 9671 RVA: 0x00057950 File Offset: 0x00055B50
		[Token(Token = "0x60025C7")]
		[Address(RVA = "0x1460B10", Offset = "0x145FB10", VA = "0x181460B10")]
		public SimpleAimingSystem()
		{
		}

		// Token: 0x04002F00 RID: 12032
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002F00")]
		[Tooltip("AimPoser is a tool that returns an animation name based on direction.")]
		public AimPoser aimPoser;

		// Token: 0x04002F01 RID: 12033
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002F01")]
		[Tooltip("Reference to the AimIK component.")]
		public AimIK aim;

		// Token: 0x04002F02 RID: 12034
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002F02")]
		[Tooltip("Reference to the LookAt component (only used for the head in this instance).")]
		public LookAtIK lookAt;

		// Token: 0x04002F03 RID: 12035
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002F03")]
		[Tooltip("Reference to the Animator component.")]
		public Animator animator;

		// Token: 0x04002F04 RID: 12036
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4002F04")]
		[Tooltip("Time of cross-fading from pose to pose.")]
		public float crossfadeTime = 0.2f;

		// Token: 0x04002F05 RID: 12037
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4002F05")]
		[Tooltip("Will keep the aim target at a distance.")]
		public float minAimDistance = 0.5f;

		// Token: 0x04002F06 RID: 12038
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4002F06")]
		private AimPoser.Pose aimPose;

		// Token: 0x04002F07 RID: 12039
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4002F07")]
		private AimPoser.Pose lastPose;
	}
}
