Decompiled source of AI2medkit v1.2.1

AI2medkit.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using ToxicGasFramework;
using UnityEngine;
using UnityEngine.AI;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace JerryComponent
{
	public class Syringe : FVRFireArmAttachment
	{
		public enum CartridgeState
		{
			Whole,
			BitOpen,
			Jammed
		}

		public List<Renderer> Rends;

		public CartridgeState CState;

		public int numPowderChunksLeft = 20;

		public AudioEvent AudEvent_Bite;

		public AudioEvent AudEvent_Tap;

		public Transform PowderSpawnPoint;

		public GameObject PowderPrefab;

		public GameObject BitPart;

		public AudioEvent AudEvent_Spit;

		public GameObject Splode;

		[NonSerialized]
		public bool m_isDestroyed;

		[NonSerialized]
		public float m_tickDownToSpit = 0.2f;

		[NonSerialized]
		public bool m_tickingDownToSpit;

		[NonSerialized]
		public float timeSinceSpawn = 1f;

		public PowerupType put;

		public PowerUpIntensity pui;

		public PowerUpDuration pud;

		public AudioEvent AudEvent_DIng;

		public FVRPhysicalObject PenObject;

		public bool isAlreadyInHeadRange = false;

		public bool isUsed = false;

		public KillAfter ka;

		public void SetRenderer(CartridgeState s)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			for (int i = 0; i < Rends.Count; i++)
			{
				if ((int)s == i)
				{
					Rends[i].enabled = true;
				}
				else
				{
					Rends[i].enabled = false;
				}
			}
		}

		public override void Awake()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArmAttachment)this).Awake();
			SetRenderer(CState);
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArmAttachment)this).UpdateInteraction(hand);
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
			{
				float num = Vector3.Angle(-((Component)this).transform.forward, Vector3.up);
			}
			if ((int)CState == 0)
			{
				Vector3 val = ((Component)GM.CurrentPlayerBody.Head).transform.position + ((Component)GM.CurrentPlayerBody.Head).transform.up * -0.2f;
				if (Vector3.Distance(((Component)this).transform.position, val) < 0.15f)
				{
					SM.PlayGenericSound(AudEvent_Bite, ((Component)this).transform.position);
					CState = (CartridgeState)1;
					SetRenderer(CState);
					m_tickingDownToSpit = true;
					m_tickDownToSpit = Random.Range(0.3f, 0.6f);
				}
			}
		}

		public override void FVRUpdate()
		{
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Invalid comparison between Unknown and I4
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).FVRUpdate();
			if (timeSinceSpawn < 1f)
			{
				timeSinceSpawn += Time.deltaTime;
			}
			if (m_tickingDownToSpit)
			{
				m_tickDownToSpit -= Time.deltaTime;
				if (m_tickDownToSpit <= 0f)
				{
					m_tickingDownToSpit = false;
					Vector3 val = ((Component)GM.CurrentPlayerBody.Head).transform.position + ((Component)GM.CurrentPlayerBody.Head).transform.up * -0.2f;
					SM.PlayGenericSound(AudEvent_Spit, val);
					GameObject val2 = Object.Instantiate<GameObject>(BitPart, val, Random.rotation);
					Rigidbody component = val2.GetComponent<Rigidbody>();
					component.velocity = GM.CurrentPlayerBody.Head.forward * Random.Range(2f, 4f) + Random.onUnitSphere;
					component.angularVelocity = Random.onUnitSphere * Random.Range(1f, 5f);
				}
			}
			if ((int)CState == 1)
			{
				float num = Vector3.Angle(-((Component)this).transform.forward, Vector3.up);
				if (num > 120f && numPowderChunksLeft > 0 && timeSinceSpawn > 0.04f)
				{
					numPowderChunksLeft--;
					timeSinceSpawn = 0f;
					Object.Instantiate<GameObject>(PowderPrefab, PowderSpawnPoint.position, Random.rotation);
				}
			}
		}

		private void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Invalid comparison between Unknown and I4
			float num = Vector3.Distance(((Component)this).transform.position, ((Component)GM.CurrentPlayerBody.Head).transform.position + Vector3.up * -0.1f);
			if ((double)num >= 0.19)
			{
				isAlreadyInHeadRange = false;
			}
			if ((double)num < 0.15)
			{
				if (!isAlreadyInHeadRange && (int)CState == 1 && !isUsed)
				{
					PowerUp(((FVRInteractiveObject)PenObject).m_hand);
					Console.Write("Yummy");
					isUsed = true;
				}
				isAlreadyInHeadRange = true;
			}
		}

		public void PowerUp(FVRViveHand hand)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_DIng, ((Component)this).transform.position);
			GM.CurrentSceneSettings.OnPowerupUse(put);
			GM.CurrentPlayerBody.ActivatePower(put, pui, pud, false, false, -1f);
			((Behaviour)ka).enabled = true;
		}
	}
	public class Syringe2 : FVRFireArmAttachment
	{
		public enum CartridgeState
		{
			Whole,
			BitOpen,
			Jammed
		}

		public List<Renderer> Rends;

		public CartridgeState CState;

		public int numPowderChunksLeft = 20;

		public AudioEvent AudEvent_Bite;

		public AudioEvent AudEvent_Tap;

		public Transform PowderSpawnPoint;

		public GameObject PowderPrefab;

		public GameObject BitPart;

		public AudioEvent AudEvent_Spit;

		public GameObject Splode;

		[NonSerialized]
		public bool m_isDestroyed;

		[NonSerialized]
		public float m_tickDownToSpit = 0.2f;

		[NonSerialized]
		public bool m_tickingDownToSpit;

		[NonSerialized]
		public float timeSinceSpawn = 1f;

		public PowerupType put;

		public PowerUpIntensity pui;

		public PowerUpDuration pud;

		public AudioEvent AudEvent_DIng;

		public FVRPhysicalObject PenObject;

		public bool isAlreadyInHeadRange = false;

		public bool isUsed = false;

		public KillAfter ka;

		public Transform needletip;

		public void SetRenderer(CartridgeState s)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			for (int i = 0; i < Rends.Count; i++)
			{
				if ((int)s == i)
				{
					Rends[i].enabled = true;
				}
				else
				{
					Rends[i].enabled = false;
				}
			}
		}

		public override void Awake()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArmAttachment)this).Awake();
			SetRenderer(CState);
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArmAttachment)this).UpdateInteraction(hand);
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
			{
				float num = Vector3.Angle(-((Component)this).transform.forward, Vector3.up);
			}
			if ((int)CState == 0)
			{
				Vector3 val = ((Component)GM.CurrentPlayerBody.Head).transform.position + ((Component)GM.CurrentPlayerBody.Head).transform.up * -0.2f;
				if (Vector3.Distance(((Component)this).transform.position, val) < 0.15f)
				{
					SM.PlayGenericSound(AudEvent_Bite, ((Component)this).transform.position);
					CState = (CartridgeState)1;
					SetRenderer(CState);
					m_tickingDownToSpit = true;
					m_tickDownToSpit = Random.Range(0.3f, 0.6f);
				}
			}
		}

		public override void FVRUpdate()
		{
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Invalid comparison between Unknown and I4
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).FVRUpdate();
			if (timeSinceSpawn < 1f)
			{
				timeSinceSpawn += Time.deltaTime;
			}
			if (m_tickingDownToSpit)
			{
				m_tickDownToSpit -= Time.deltaTime;
				if (m_tickDownToSpit <= 0f)
				{
					m_tickingDownToSpit = false;
					Vector3 val = ((Component)GM.CurrentPlayerBody.Head).transform.position + ((Component)GM.CurrentPlayerBody.Head).transform.up * -0.2f;
					SM.PlayGenericSound(AudEvent_Spit, val);
					GameObject val2 = Object.Instantiate<GameObject>(BitPart, val, Random.rotation);
					Rigidbody component = val2.GetComponent<Rigidbody>();
					component.velocity = GM.CurrentPlayerBody.Head.forward * Random.Range(2f, 4f) + Random.onUnitSphere;
					component.angularVelocity = Random.onUnitSphere * Random.Range(1f, 5f);
				}
			}
			if ((int)CState == 1)
			{
				float num = Vector3.Angle(-((Component)this).transform.forward, Vector3.up);
				if (num > 120f && numPowderChunksLeft > 0 && timeSinceSpawn > 0.04f)
				{
					numPowderChunksLeft--;
					timeSinceSpawn = 0f;
					Object.Instantiate<GameObject>(PowderPrefab, PowderSpawnPoint.position, Random.rotation);
				}
			}
		}

		private void Update()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Invalid comparison between Unknown and I4
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Invalid comparison between Unknown and I4
			if ((Object)(object)((FVRInteractiveObject)PenObject).m_hand != (Object)null && ((Object)((FVRInteractiveObject)PenObject).m_hand).name == "Controller (left)")
			{
				float num = Vector3.Distance(needletip.position, ((Component)GM.CurrentPlayerBody.RightHand).transform.position);
				if ((double)num >= 0.07500000298023224)
				{
					isAlreadyInHeadRange = false;
				}
				if ((double)num < 0.05000000074505806)
				{
					if (!isAlreadyInHeadRange && (int)CState == 1 && !isUsed)
					{
						PowerUp(((FVRInteractiveObject)PenObject).m_hand);
						Console.Write("Oof");
						isUsed = true;
					}
					isAlreadyInHeadRange = true;
				}
			}
			if (!((Object)(object)((FVRInteractiveObject)PenObject).m_hand != (Object)null) || !(((Object)((FVRInteractiveObject)PenObject).m_hand).name == "Controller (right)"))
			{
				return;
			}
			float num2 = Vector3.Distance(needletip.position, ((Component)GM.CurrentPlayerBody.LeftHand).transform.position);
			if ((double)num2 >= 0.07500000298023224)
			{
				isAlreadyInHeadRange = false;
			}
			if ((double)num2 < 0.07500000298023224)
			{
				if (!isAlreadyInHeadRange && (int)CState == 1 && !isUsed)
				{
					PowerUp(((FVRInteractiveObject)PenObject).m_hand);
					Console.Write("Oof");
					isUsed = true;
				}
				isAlreadyInHeadRange = true;
			}
		}

		public void PowerUp(FVRViveHand hand)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_DIng, ((Component)this).transform.position);
			GM.CurrentSceneSettings.OnPowerupUse(put);
			GM.CurrentPlayerBody.ActivatePower(put, pui, pud, false, false, -1f);
			((Behaviour)ka).enabled = true;
		}
	}
	public class control_component : MonoBehaviour
	{
		public GameObject Comp;

		public GameObject Comp2;

		public GameObject Rot;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (Rot.transform.localEulerAngles.x >= 45f)
			{
				Comp.SetActive(false);
				Comp2.SetActive(true);
			}
			else
			{
				Comp.SetActive(true);
				Comp2.SetActive(false);
			}
		}
	}
	public class controll_component : MonoBehaviour
	{
		public GameObject Comp;

		public GameObject Rot;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (Rot.transform.localEulerAngles.y > 10f && Rot.transform.localEulerAngles.y < -10f)
			{
				Comp.SetActive(false);
			}
			else
			{
				Comp.SetActive(true);
			}
		}
	}
}
public class CameraController : MonoBehaviour
{
	public GameObject mTarget;

	public Vector3 mDistance;

	public float mSpeed = 5f;

	private void Update()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		((Component)((Component)this).GetComponent<Camera>()).transform.LookAt(mTarget.transform.position);
		((Component)((Component)this).GetComponent<Camera>()).transform.position = ((Component)((Component)this).GetComponent<Camera>()).transform.position + mSpeed * Time.deltaTime * (mTarget.transform.position + mDistance - ((Component)((Component)this).GetComponent<Camera>()).transform.position);
	}
}
public class IdleUpdate : StateMachineBehaviour
{
	private float mIdleRayCast = 0.5f;

	public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().DisablePlant((AvatarIKGoal)0, 2f);
		((Component)animator).GetComponent<MecFootPlacer>().DisablePlant((AvatarIKGoal)1, 2f);
	}

	public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
	{
		FootPlacementData footPlacementData = ((Component)animator).GetComponents<FootPlacementData>()[0];
		FootPlacementData footPlacementData2 = ((Component)animator).GetComponents<FootPlacementData>()[1];
		if ((Object)(object)footPlacementData != (Object)null)
		{
			if (((AnimatorStateInfo)(ref stateInfo)).normalizedTime > 0.25f)
			{
				footPlacementData.mExtraRayDistanceCheck = mIdleRayCast;
			}
			else
			{
				footPlacementData.mExtraRayDistanceCheck = 0f;
			}
		}
		if ((Object)(object)footPlacementData2 != (Object)null)
		{
			if (((AnimatorStateInfo)(ref stateInfo)).normalizedTime > 0.25f)
			{
				footPlacementData2.mExtraRayDistanceCheck = mIdleRayCast;
			}
			else
			{
				footPlacementData2.mExtraRayDistanceCheck = 0f;
			}
		}
	}
}
public class InputController : MonoBehaviour
{
	public float Speed = 4f;

	public float TurnSpeed = 1f;

	public Camera mCam;

	protected Vector3 mLeftVec = new Vector3(-1f, 0f, 0f);

	protected Vector3 mFwdVec = new Vector3(0f, 0f, 1f);

	protected Vector3 mGOFwdVec = new Vector3(0f, 0f, 1f);

	protected Animator mAnim;

	protected float mTimePassed = 0f;

	protected int mMove = Animator.StringToHash("move");

	protected int mSpeed = Animator.StringToHash("speed");

	protected bool mMecFPActive = true;

	protected GUIStyle mStyle;

	private void Start()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		mStyle = new GUIStyle();
		mAnim = ((Component)this).GetComponent<Animator>();
		mStyle.normal.textColor = new Color(0.5f, 0f, 0.75f, 1f);
		mStyle.fontSize = 20;
	}

	private void OnGUI()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		GUI.Label(new Rect(0f, 0f, 100f, 100f), "Use W, A, S, D to move around\nPress R to activate/deactivate Mec Foot Placer\nHold L to run", mStyle);
	}

	private void Update()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_0397: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
		Animator obj = mAnim;
		AnimatorStateInfo currentAnimatorStateInfo = mAnim.GetCurrentAnimatorStateInfo(0);
		float normalizedTime = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime;
		AnimatorStateInfo currentAnimatorStateInfo2 = mAnim.GetCurrentAnimatorStateInfo(0);
		obj.SetFloat("time", normalizedTime - Mathf.Floor(((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).normalizedTime));
		if (!Input.anyKey)
		{
			float @float = mAnim.GetFloat(mSpeed);
			@float -= 1.5f * Time.deltaTime;
			if (@float < 0f)
			{
				@float = 0f;
				mAnim.SetBool(mMove, false);
			}
			mAnim.SetFloat(mSpeed, @float);
			return;
		}
		bool flag = false;
		Vector3 val = ((Component)mCam).transform.rotation * mFwdVec;
		val.y = 0f;
		Vector3 val2 = ((Component)mCam).transform.rotation * mLeftVec;
		val2.y = 0f;
		mGOFwdVec = ((Component)this).gameObject.transform.rotation * new Vector3(0f, 0f, 1f);
		Vector3 val3 = default(Vector3);
		((Vector3)(ref val3))..ctor(0f, 0f, 0f);
		float num = 1f;
		float num2 = 0f;
		if (Input.GetKey((KeyCode)97))
		{
			val3 += val2;
			flag = true;
		}
		if (Input.GetKey((KeyCode)100))
		{
			val3 -= val2;
			flag = true;
		}
		if (Input.GetKey((KeyCode)119))
		{
			val3 += val;
			flag = true;
		}
		if (Input.GetKey((KeyCode)115))
		{
			val3 -= val;
			flag = true;
		}
		if (Input.GetKey((KeyCode)108))
		{
			float float2 = mAnim.GetFloat(mSpeed);
			if (flag)
			{
				float2 += Time.deltaTime;
				if (float2 > 1f)
				{
					float2 = 1f;
				}
			}
			else
			{
				float2 -= 2f * Time.deltaTime;
				if (float2 < 0f)
				{
					float2 = 0f;
				}
			}
			mAnim.SetFloat(mSpeed, float2);
		}
		else
		{
			float float3 = mAnim.GetFloat(mSpeed);
			float3 -= Time.deltaTime;
			if (float3 < 0f)
			{
				float3 = 0f;
			}
			mAnim.SetFloat(mSpeed, float3);
		}
		if (Input.GetKey((KeyCode)281) && mTimePassed > 0.1f)
		{
			Time.timeScale -= 0.1f;
			if (Time.timeScale < 0f)
			{
				Time.timeScale = 0f;
			}
			mTimePassed = 0f;
			Debug.Log((object)Time.timeScale);
		}
		if (Input.GetKey((KeyCode)280) && mTimePassed > 0.1f)
		{
			Time.timeScale += 0.1f;
			mTimePassed = 0f;
			Debug.Log((object)Time.timeScale);
		}
		if (Input.GetKeyDown((KeyCode)114))
		{
			mMecFPActive = !mMecFPActive;
			((Component)this).GetComponent<MecFootPlacer>().SetActive((AvatarIKGoal)0, mMecFPActive);
			((Component)this).GetComponent<MecFootPlacer>().SetActive((AvatarIKGoal)1, mMecFPActive);
		}
		if (flag)
		{
			num = Vector3.Cross(mGOFwdVec, val3).y;
			if (num != 0f)
			{
				num /= Mathf.Abs(num);
			}
			num2 = Vector3.Angle(mGOFwdVec, val3);
			num2 *= TurnSpeed * Time.deltaTime;
			((Component)this).gameObject.transform.Rotate(new Vector3(0f, num, 0f), num2, (Space)0);
			mAnim.SetBool(mMove, true);
		}
		else if (mAnim.GetFloat("speed") <= 0f)
		{
			mAnim.SetBool(mMove, false);
		}
		mTimePassed += Time.deltaTime;
	}
}
public class LocomotionUpdate : StateMachineBehaviour
{
	public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().EnablePlant((AvatarIKGoal)0, 2f);
		((Component)animator).GetComponent<MecFootPlacer>().EnablePlant((AvatarIKGoal)1, 2f);
	}

	public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
	{
		float @float = animator.GetFloat("speed");
		float num = ((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime - Mathf.Floor(((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime);
		float num2 = 0.5f - 0.25f * @float;
		FootPlacementData[] components = ((Component)animator).GetComponents<FootPlacementData>();
		FootPlacementData footPlacementData = null;
		for (byte b = 0; b < components.Length; b++)
		{
			switch (components[b].mFootID)
			{
			case FootPlacementData.LimbID.LEFT_FOOT:
				footPlacementData = components[b];
				if ((double)num > 0.5 && num < 0.5f + num2)
				{
					footPlacementData.mExtraRayDistanceCheck = 0.7f;
				}
				else
				{
					footPlacementData.mExtraRayDistanceCheck = -0.2f;
				}
				break;
			case FootPlacementData.LimbID.RIGHT_FOOT:
				footPlacementData = components[b];
				if (num < num2)
				{
					footPlacementData.mExtraRayDistanceCheck = 0.7f;
				}
				else
				{
					footPlacementData.mExtraRayDistanceCheck = -0.2f;
				}
				break;
			case FootPlacementData.LimbID.LEFT_HAND:
				footPlacementData = components[b];
				break;
			case FootPlacementData.LimbID.RIGHT_HAND:
				footPlacementData = components[b];
				break;
			}
			footPlacementData.mTransitionTime = 0.15f - 0.1f * @float;
		}
	}
}
public class PelvisSet : StateMachineBehaviour
{
	public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().mAdjustPelvisVertically = true;
	}
}
public class PelvisUnset : StateMachineBehaviour
{
	public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().mAdjustPelvisVertically = false;
	}
}
public class FootPlacementData : MonoBehaviour
{
	public enum LimbID
	{
		LEFT_FOOT,
		RIGHT_FOOT,
		LEFT_HAND,
		RIGHT_HAND
	}

	public enum Target
	{
		FOOT,
		TOE,
		HEEL
	}

	public LimbID mFootID = LimbID.LEFT_FOOT;

	public bool mPlantFoot = true;

	public Vector3 mForwardVector = new Vector3(0f, 0f, 1f);

	public Vector3 mIKHintOffset = new Vector3(0f, 0f, 0f);

	public Vector3 mUpVector = new Vector3(0f, 1f, 0f);

	public float mFootOffsetDist = 0.5f;

	public float mFootLength = 0.22f;

	public float mFootHalfWidth = 0.05f;

	public float mFootHeight = 0.1f;

	public float mFootRotationLimit = 45f;

	public float mTransitionTime = 0.2f;

	public float mExtraRayDistanceCheck = 0f;

	public bool mSetExtraRaydistanceCheckAutomatically = false;

	public float mErrorThreshold = 0.05f;

	public float mExtraRayDistanceCheckMin = 0f;

	public float mExtraRayDistanceCheckMax = 2f;

	protected bool mFootPlantIsOnTransition = false;

	protected float mFootPlantBlendSpeed;

	protected Vector3 mTargetPos = new Vector3(0f, 0f, 0f);

	protected Vector3 mTargetToePos = new Vector3(0f, 0f, 0f);

	protected Vector3 mTargetHeelPos = new Vector3(0f, 0f, 0f);

	protected Vector3 mRotatedFwdVec;

	protected Vector3 mRotatedIKHintOffset;

	protected float mTargetFootWeight = 0f;

	protected float mCurrentFootWeight = 0f;

	protected float mGoalBlendSpeed = 0f;

	protected float mPlantBlendFactor = 0f;

	private Vector3 mFootPlantedPos;

	private Quaternion mFootPlantedRot;

	private bool mFootPlanted = false;

	private Vector3 mPreviousFootPos = Vector3.zero;

	public void SetTargetPos(Target target, Vector3 target_pos)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		switch (target)
		{
		case Target.FOOT:
			mTargetPos = target_pos;
			break;
		case Target.TOE:
			mTargetToePos = target_pos;
			break;
		case Target.HEEL:
			mTargetHeelPos = target_pos;
			break;
		}
	}

	public Vector3 GetTargetPos(Target target)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		return (Vector3)(target switch
		{
			Target.FOOT => mTargetPos, 
			Target.TOE => mTargetToePos, 
			Target.HEEL => mTargetHeelPos, 
			_ => Vector3.zero, 
		});
	}

	public void CalculateRotatedFwdVec()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		AvatarIKGoal val = (AvatarIKGoal)0;
		switch (mFootID)
		{
		case LimbID.RIGHT_FOOT:
			val = (AvatarIKGoal)1;
			break;
		case LimbID.LEFT_HAND:
			val = (AvatarIKGoal)2;
			break;
		case LimbID.RIGHT_HAND:
			val = (AvatarIKGoal)3;
			break;
		}
		float num = 0f;
		Quaternion iKRotation = ((Component)this).GetComponent<Animator>().GetIKRotation(val);
		num = ((Quaternion)(ref iKRotation)).eulerAngles.y * (float)Math.PI / 180f;
		Quaternion val2 = default(Quaternion);
		((Quaternion)(ref val2))..ctor(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f));
		if (mFootPlanted && mPlantFoot)
		{
			num = ((Quaternion)(ref mFootPlantedRot)).eulerAngles.y * (float)Math.PI / 180f;
			val2 = Quaternion.Slerp(val2, new Quaternion(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f)), mPlantBlendFactor);
		}
		mRotatedFwdVec = val2 * ((Vector3)(ref mForwardVector)).normalized;
	}

	public Vector3 GetRotatedFwdVec()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		return mRotatedFwdVec;
	}

	public void CalculateRotatedIKHint()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		Quaternion rotation = ((Component)this).transform.rotation;
		float num = ((Quaternion)(ref rotation)).eulerAngles.y * (float)Math.PI / 180f;
		Quaternion val = default(Quaternion);
		((Quaternion)(ref val))..ctor(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f));
		mRotatedIKHintOffset = val * mIKHintOffset;
	}

	public Vector3 GetRotatedIKHint()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		return mRotatedIKHintOffset;
	}

	public void SetTargetFootWeight(float weight)
	{
		mTargetFootWeight = weight;
	}

	public float GetTargetFootWeight()
	{
		return mTargetFootWeight;
	}

	public void SetCurrentFootWeight(float weight)
	{
		mCurrentFootWeight = weight;
	}

	public float GetCurrentFootWeight()
	{
		return mCurrentFootWeight;
	}

	public void SetGoalBlendSpeed(float speed)
	{
		mGoalBlendSpeed = speed;
	}

	public float GetGoalBlendSpeed()
	{
		return mGoalBlendSpeed;
	}

	public float GetPlantBlendFactor()
	{
		return mPlantBlendFactor;
	}

	public void SetPlantBlendFactor(float factor)
	{
		mPlantBlendFactor = factor;
	}

	public void EnablePlantBlend(float blend_speed)
	{
		mFootPlantBlendSpeed = Mathf.Abs(blend_speed);
		mFootPlantIsOnTransition = true;
	}

	public void DisablePlantBlend(float blend_speed)
	{
		mFootPlantBlendSpeed = 0f - Mathf.Abs(blend_speed);
		mFootPlantIsOnTransition = true;
	}

	public float GetFootPlantBlendSpeed()
	{
		return mFootPlantBlendSpeed;
	}

	public void PlantBlendTransitionEnded()
	{
		mFootPlantIsOnTransition = false;
	}

	public bool IsPlantOnTransition()
	{
		return mFootPlantIsOnTransition;
	}

	public void SetFootPlanted(bool planted)
	{
		mFootPlanted = planted;
	}

	public bool GetFootPlanted()
	{
		return mFootPlanted;
	}

	public void SetPlantedPos(Vector3 planted_pos)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		mFootPlantedPos = planted_pos;
	}

	public Vector3 GetPlantedPos()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		return mFootPlantedPos;
	}

	public void SetPlantedRot(Quaternion planted_rot)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		mFootPlantedRot = planted_rot;
	}

	public Quaternion GetPlantedRot()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		return mFootPlantedRot;
	}

	private void Start()
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		Animator component = ((Component)this).GetComponent<Animator>();
		if (!((Object)(object)component == (Object)null))
		{
			HumanBodyBones val = (HumanBodyBones)5;
			switch (mFootID)
			{
			case LimbID.RIGHT_FOOT:
				val = (HumanBodyBones)6;
				break;
			case LimbID.RIGHT_HAND:
				val = (HumanBodyBones)18;
				break;
			case LimbID.LEFT_HAND:
				val = (HumanBodyBones)17;
				break;
			}
			mPreviousFootPos = component.GetBoneTransform(val).position;
		}
	}

	protected bool IsErrorHigh(HumanBodyBones bone, Vector3 current_position, Vector3 previous_pos)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = previous_pos - current_position;
		float magnitude = ((Vector3)(ref val)).magnitude;
		float num = mErrorThreshold;
		if (Time.deltaTime < 0.033f)
		{
			num = mErrorThreshold * 30f * Time.deltaTime;
		}
		if (magnitude > num)
		{
			return true;
		}
		return false;
	}

	private void OnAnimatorIK()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		if (!mSetExtraRaydistanceCheckAutomatically)
		{
			return;
		}
		Animator component = ((Component)this).GetComponent<Animator>();
		if (!((Object)(object)component == (Object)null))
		{
			HumanBodyBones val = (HumanBodyBones)5;
			switch (mFootID)
			{
			case LimbID.RIGHT_FOOT:
				val = (HumanBodyBones)6;
				break;
			case LimbID.RIGHT_HAND:
				val = (HumanBodyBones)18;
				break;
			case LimbID.LEFT_HAND:
				val = (HumanBodyBones)17;
				break;
			}
			if (IsErrorHigh(val, component.GetBoneTransform(val).position, mPreviousFootPos))
			{
				mExtraRayDistanceCheck = mExtraRayDistanceCheckMin;
			}
			else
			{
				mExtraRayDistanceCheck = mExtraRayDistanceCheckMax;
			}
			mPreviousFootPos = component.GetBoneTransform(val).position;
		}
	}
}
public class MecFootPlacer : MonoBehaviour
{
	public bool mAdjustPelvisVertically = false;

	public bool mDampPelvis = false;

	public float mMaxLegLength = 1f;

	public float mMinLegLength = 0.2f;

	public float mPelvisAdjustmentSpeed = 1f;

	public string[] mLayersToIgnore;

	protected FootPlacementData mLeftFoot = null;

	protected FootPlacementData mRightFoot = null;

	protected FootPlacementData mLeftHand = null;

	protected FootPlacementData mRightHand = null;

	protected Animator mAnim;

	protected LayerMask mLayerMask = LayerMask.op_Implicit(-1);

	private const float mEpsilon = 0.005f;

	private float mCurrentRootVertError = 0f;

	private float mTargetRootVertError = 0f;

	private float mCurrentPelvisSpeed = 0f;

	private Vector3 mLeftFootContact_Ontransition_Disable;

	private Vector3 mLeftToeContact_Ontransition_Disable;

	private Vector3 mLeftHeelContact_Ontransition_Disable;

	private Vector3 mRightFootContact_Ontransition_Disable;

	private Vector3 mRightToeContact_Ontransition_Disable;

	private Vector3 mRightHeelContact_Ontransition_Disable;

	private Vector3 mLeftHandContact_Ontransition_Disable;

	private Vector3 mLeftHandToeContact_Ontransition_Disable;

	private Vector3 mLeftHandHeelContact_Ontransition_Disable;

	private Vector3 mRightHandContact_Ontransition_Disable;

	private Vector3 mRightHandToeContact_Ontransition_Disable;

	private Vector3 mRightHandHeelContact_Ontransition_Disable;

	private bool mRootPosLeftRightFoot = false;

	private bool mLeftFootActive = true;

	private bool mRightFootActive = true;

	private bool mLeftHandActive = true;

	private bool mRightHandActive = true;

	public void SetActive(AvatarIKGoal foot_id, bool active)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Invalid comparison between Unknown and I4
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Invalid comparison between Unknown and I4
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Invalid comparison between Unknown and I4
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		if ((int)foot_id == 0)
		{
			if ((Object)(object)mLeftFoot == (Object)null)
			{
				return;
			}
			if (active && !mLeftFootActive)
			{
				ResetIKParams(foot_id);
			}
			mLeftFootActive = active;
		}
		if ((int)foot_id == 1)
		{
			if ((Object)(object)mRightFoot == (Object)null)
			{
				return;
			}
			if (active && !mRightFootActive)
			{
				ResetIKParams(foot_id);
			}
			mRightFootActive = active;
		}
		if ((int)foot_id == 2)
		{
			if ((Object)(object)mRightHand == (Object)null)
			{
				return;
			}
			if (active && !mLeftHandActive)
			{
				ResetIKParams(foot_id);
			}
			mLeftHandActive = active;
		}
		if ((int)foot_id == 3 && !((Object)(object)mRightHand == (Object)null))
		{
			if (active && !mRightHandActive)
			{
				ResetIKParams(foot_id);
			}
			mRightHandActive = active;
		}
	}

	public bool IsActive(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Invalid comparison between Unknown and I4
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Invalid comparison between Unknown and I4
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Invalid comparison between Unknown and I4
		if ((int)foot_id == 0)
		{
			return mLeftFootActive;
		}
		if ((int)foot_id == 1)
		{
			return mRightFootActive;
		}
		if ((int)foot_id == 2)
		{
			return mLeftHandActive;
		}
		if ((int)foot_id == 3)
		{
			return mRightHandActive;
		}
		return false;
	}

	public void SetLayerMask(LayerMask layer_mask)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		mLayerMask = layer_mask;
	}

	public LayerMask GetLayerMask()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		return mLayerMask;
	}

	public float GetPlantBlendWeight(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		default:
			return -1f;
		}
		return footPlacementData.GetPlantBlendFactor();
	}

	public void SetPlantBlendWeight(AvatarIKGoal foot_id, float weight)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		footPlacementData.SetPlantBlendFactor(weight);
	}

	public void EnablePlant(AvatarIKGoal foot_id, float blend_speed)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		footPlacementData.EnablePlantBlend(blend_speed);
	}

	public void DisablePlant(AvatarIKGoal foot_id, float blend_speed)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		footPlacementData.DisablePlantBlend(blend_speed);
	}

	private void ResetIKParams(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Invalid comparison between Unknown and I4
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Invalid comparison between Unknown and I4
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02af: Invalid comparison between Unknown and I4
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_0312: Unknown result type (might be due to invalid IL or missing references)
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_0347: Unknown result type (might be due to invalid IL or missing references)
		//IL_034d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0362: Unknown result type (might be due to invalid IL or missing references)
		//IL_036d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0372: Unknown result type (might be due to invalid IL or missing references)
		//IL_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_0387: Unknown result type (might be due to invalid IL or missing references)
		//IL_038c: Unknown result type (might be due to invalid IL or missing references)
		if ((int)foot_id == 0)
		{
			Vector3 position = mAnim.GetBoneTransform((HumanBodyBones)5).position;
			mLeftFoot.SetTargetFootWeight(0f);
			mLeftFoot.SetCurrentFootWeight(0f);
			mLeftFoot.SetGoalBlendSpeed(0f);
			mLeftFoot.SetFootPlanted(planted: false);
			mLeftFootContact_Ontransition_Disable = position;
			mLeftToeContact_Ontransition_Disable = mLeftFoot.mUpVector * mLeftFoot.mFootOffsetDist + mLeftFoot.GetRotatedFwdVec() * mLeftFoot.mFootLength;
			mLeftHeelContact_Ontransition_Disable = position + new Quaternion(0f, 0.7071f, 0f, 0.7071f) * mLeftFoot.GetRotatedFwdVec() * mLeftFoot.mFootHalfWidth;
		}
		if ((int)foot_id == 1)
		{
			Vector3 position2 = mAnim.GetBoneTransform((HumanBodyBones)6).position;
			mRightFoot.SetTargetFootWeight(0f);
			mRightFoot.SetCurrentFootWeight(0f);
			mRightFoot.SetGoalBlendSpeed(0f);
			mRightFoot.SetFootPlanted(planted: false);
			mRightFootContact_Ontransition_Disable = position2;
			mRightToeContact_Ontransition_Disable = mRightFoot.mUpVector * mRightFoot.mFootOffsetDist + mRightFoot.GetRotatedFwdVec() * mRightFoot.mFootLength;
			mRightHeelContact_Ontransition_Disable = position2 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mRightFoot.GetRotatedFwdVec() * mRightFoot.mFootHalfWidth;
		}
		if ((int)foot_id == 2)
		{
			Vector3 position3 = mAnim.GetBoneTransform((HumanBodyBones)17).position;
			mLeftHand.SetTargetFootWeight(0f);
			mLeftHand.SetCurrentFootWeight(0f);
			mLeftHand.SetGoalBlendSpeed(0f);
			mLeftHand.SetFootPlanted(planted: false);
			mLeftHandContact_Ontransition_Disable = position3;
			mLeftHandToeContact_Ontransition_Disable = mLeftHand.mUpVector * mLeftHand.mFootOffsetDist + mLeftHand.GetRotatedFwdVec() * mLeftHand.mFootLength;
			mLeftHandHeelContact_Ontransition_Disable = position3 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mLeftHand.GetRotatedFwdVec() * mLeftHand.mFootHalfWidth;
		}
		if ((int)foot_id == 3)
		{
			Vector3 position4 = mAnim.GetBoneTransform((HumanBodyBones)18).position;
			mRightHand.SetTargetFootWeight(0f);
			mRightHand.SetCurrentFootWeight(0f);
			mRightHand.SetGoalBlendSpeed(0f);
			mRightHand.SetFootPlanted(planted: false);
			mRightHandContact_Ontransition_Disable = position4;
			mRightHandToeContact_Ontransition_Disable = mRightHand.mUpVector * mRightHand.mFootOffsetDist + mRightHand.GetRotatedFwdVec() * mRightHand.mFootLength;
			mRightHandHeelContact_Ontransition_Disable = position4 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mRightHand.GetRotatedFwdVec() * mRightHand.mFootHalfWidth;
		}
	}

	protected void SetIKWeight(AvatarIKGoal foot_id, float target_weight, float transition_time)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		switch ((int)foot_id)
		{
		case 0:
			if (Mathf.Abs(target_weight - mLeftFoot.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mLeftFoot.SetGoalBlendSpeed((target_weight - mLeftFoot.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mLeftFoot.SetGoalBlendSpeed(0.1f);
					mLeftFoot.SetCurrentFootWeight(target_weight);
				}
			}
			mLeftFoot.SetTargetFootWeight(target_weight);
			break;
		case 1:
			if (Mathf.Abs(target_weight - mRightFoot.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mRightFoot.SetGoalBlendSpeed((target_weight - mRightFoot.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mRightFoot.SetGoalBlendSpeed(0.1f);
					mRightFoot.SetCurrentFootWeight(target_weight);
				}
			}
			mRightFoot.SetTargetFootWeight(target_weight);
			break;
		case 2:
			if (Mathf.Abs(target_weight - mLeftHand.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mLeftHand.SetGoalBlendSpeed((target_weight - mLeftHand.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mLeftHand.SetGoalBlendSpeed(0.1f);
					mLeftHand.SetCurrentFootWeight(target_weight);
				}
			}
			mLeftHand.SetTargetFootWeight(target_weight);
			break;
		case 3:
			if (Mathf.Abs(target_weight - mRightHand.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mRightHand.SetGoalBlendSpeed((target_weight - mRightHand.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mRightHand.SetGoalBlendSpeed(0.1f);
					mRightHand.SetCurrentFootWeight(target_weight);
				}
			}
			mRightHand.SetTargetFootWeight(target_weight);
			break;
		}
	}

	protected void CalculateIKGoalWeights(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		float num = Mathf.Sign(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight());
		footPlacementData.SetCurrentFootWeight(footPlacementData.GetCurrentFootWeight() + footPlacementData.GetGoalBlendSpeed() * Time.deltaTime);
		if (num * Mathf.Sign(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight()) < 1f || Mathf.Abs(footPlacementData.GetCurrentFootWeight() - footPlacementData.GetTargetFootWeight()) < 0.005f)
		{
			footPlacementData.SetCurrentFootWeight(footPlacementData.GetTargetFootWeight());
		}
		else if (footPlacementData.GetCurrentFootWeight() > 1f || footPlacementData.GetCurrentFootWeight() < 0f)
		{
			footPlacementData.SetCurrentFootWeight(Mathf.Clamp(footPlacementData.GetTargetFootWeight(), 0f, 1f));
		}
	}

	protected void CheckForLimits(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		Vector3 zero = Vector3.zero;
		Vector3 rotatedFwdVec = footPlacementData.GetRotatedFwdVec();
		if (Vector3.Angle(rotatedFwdVec, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE)) > footPlacementData.mFootRotationLimit)
		{
			zero = footPlacementData.mUpVector * footPlacementData.mFootLength * Mathf.Tan(footPlacementData.mFootRotationLimit * ((float)Math.PI / 180f));
			if (Vector3.Angle(footPlacementData.mUpVector, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE)) > 90f)
			{
				zero = -zero;
			}
			footPlacementData.SetTargetPos(FootPlacementData.Target.TOE, rotatedFwdVec * footPlacementData.mFootLength + zero);
		}
		Quaternion val = default(Quaternion);
		((Quaternion)(ref val))..ctor(0f, 0.7071f, 0f, 0.7071f);
		if (Vector3.Angle(val * rotatedFwdVec, footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL)) > footPlacementData.mFootRotationLimit)
		{
			zero = footPlacementData.mUpVector * footPlacementData.mFootHalfWidth * Mathf.Tan(footPlacementData.mFootRotationLimit * ((float)Math.PI / 180f));
			if (Vector3.Angle(footPlacementData.mUpVector, footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL)) > 90f)
			{
				zero = -zero;
			}
			footPlacementData.SetTargetPos(FootPlacementData.Target.HEEL, val * rotatedFwdVec * footPlacementData.mFootHalfWidth + zero);
		}
	}

	protected void UpdateFootPlantBlendWeights(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		if (!footPlacementData.IsPlantOnTransition())
		{
			return;
		}
		footPlacementData.SetPlantBlendFactor(footPlacementData.GetPlantBlendFactor() + footPlacementData.GetFootPlantBlendSpeed() * Time.deltaTime);
		if (footPlacementData.GetFootPlantBlendSpeed() > 0f)
		{
			if (footPlacementData.GetPlantBlendFactor() > 1f)
			{
				footPlacementData.SetPlantBlendFactor(1f);
				footPlacementData.PlantBlendTransitionEnded();
			}
		}
		else if (footPlacementData.GetPlantBlendFactor() < 0f)
		{
			footPlacementData.SetPlantBlendFactor(0f);
			footPlacementData.PlantBlendTransitionEnded();
		}
	}

	protected void FindContactPoints(AvatarIKGoal foot_id)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Expected I4, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Expected I4, but got Unknown
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Expected I4, but got Unknown
		//IL_022c: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0269: Unknown result type (might be due to invalid IL or missing references)
		//IL_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Expected I4, but got Unknown
		//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0412: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0426: Unknown result type (might be due to invalid IL or missing references)
		//IL_0431: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_043d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0418: Unknown result type (might be due to invalid IL or missing references)
		//IL_041d: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_0358: Unknown result type (might be due to invalid IL or missing references)
		//IL_0363: Unknown result type (might be due to invalid IL or missing references)
		//IL_0379: Expected I4, but got Unknown
		//IL_0463: Unknown result type (might be due to invalid IL or missing references)
		//IL_0465: Unknown result type (might be due to invalid IL or missing references)
		//IL_0470: Unknown result type (might be due to invalid IL or missing references)
		//IL_0475: Unknown result type (might be due to invalid IL or missing references)
		//IL_047a: Unknown result type (might be due to invalid IL or missing references)
		//IL_047d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0482: Unknown result type (might be due to invalid IL or missing references)
		//IL_0487: Unknown result type (might be due to invalid IL or missing references)
		//IL_048b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0496: Unknown result type (might be due to invalid IL or missing references)
		//IL_049b: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0381: Unknown result type (might be due to invalid IL or missing references)
		//IL_0386: Unknown result type (might be due to invalid IL or missing references)
		//IL_0393: Unknown result type (might be due to invalid IL or missing references)
		//IL_0398: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_0320: Unknown result type (might be due to invalid IL or missing references)
		//IL_061a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0630: Expected I4, but got Unknown
		//IL_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Unknown result type (might be due to invalid IL or missing references)
		//IL_0636: Unknown result type (might be due to invalid IL or missing references)
		//IL_063b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0642: Unknown result type (might be due to invalid IL or missing references)
		//IL_0647: Unknown result type (might be due to invalid IL or missing references)
		//IL_064e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0653: Unknown result type (might be due to invalid IL or missing references)
		//IL_065a: Unknown result type (might be due to invalid IL or missing references)
		//IL_065f: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0672: Unknown result type (might be due to invalid IL or missing references)
		//IL_0675: Unknown result type (might be due to invalid IL or missing references)
		//IL_067a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0685: Unknown result type (might be due to invalid IL or missing references)
		//IL_068a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0691: Unknown result type (might be due to invalid IL or missing references)
		//IL_0665: Unknown result type (might be due to invalid IL or missing references)
		//IL_066a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0591: Unknown result type (might be due to invalid IL or missing references)
		//IL_0595: Unknown result type (might be due to invalid IL or missing references)
		//IL_059a: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bb: Expected I4, but got Unknown
		//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05da: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0505: Unknown result type (might be due to invalid IL or missing references)
		//IL_0510: Unknown result type (might be due to invalid IL or missing references)
		//IL_0515: Unknown result type (might be due to invalid IL or missing references)
		//IL_051a: Unknown result type (might be due to invalid IL or missing references)
		//IL_051d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0522: Unknown result type (might be due to invalid IL or missing references)
		//IL_0527: Unknown result type (might be due to invalid IL or missing references)
		//IL_052b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0536: Unknown result type (might be due to invalid IL or missing references)
		//IL_053b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0541: Unknown result type (might be due to invalid IL or missing references)
		//IL_0546: Unknown result type (might be due to invalid IL or missing references)
		//IL_0562: Unknown result type (might be due to invalid IL or missing references)
		//IL_0608: Unknown result type (might be due to invalid IL or missing references)
		//IL_060d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0577: Unknown result type (might be due to invalid IL or missing references)
		//IL_057b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0586: Unknown result type (might be due to invalid IL or missing references)
		//IL_058b: Unknown result type (might be due to invalid IL or missing references)
		Vector3 iKPosition = mAnim.GetIKPosition(foot_id);
		bool flag = true;
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		RaycastHit val = default(RaycastHit);
		if (Physics.Raycast(iKPosition + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootHeight + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)))
		{
			SetIKWeight(foot_id, 1f, footPlacementData.mTransitionTime);
			Vector3 val2 = ((RaycastHit)(ref val)).point;
			if (footPlacementData.mPlantFoot && footPlacementData.GetFootPlanted() && Physics.Raycast(footPlacementData.GetPlantedPos() + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootHeight + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)))
			{
				val2 = Vector3.Lerp(val2, ((RaycastHit)(ref val)).point, footPlacementData.GetPlantBlendFactor());
			}
			footPlacementData.SetTargetPos(FootPlacementData.Target.FOOT, val2);
			switch ((int)foot_id)
			{
			case 0:
				mLeftFootContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT);
				break;
			case 1:
				mRightFootContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT);
				break;
			case 2:
				mLeftHandContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT);
				break;
			case 3:
				mRightHandContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT);
				break;
			}
			flag = true;
		}
		else
		{
			SetIKWeight(foot_id, 0f, footPlacementData.mTransitionTime);
			footPlacementData.SetTargetPos(FootPlacementData.Target.FOOT, Vector3.Lerp(iKPosition, (Vector3)((int)foot_id switch
			{
				0 => mLeftFootContact_Ontransition_Disable, 
				1 => mRightFootContact_Ontransition_Disable, 
				2 => mLeftHandContact_Ontransition_Disable, 
				3 => mRightHandContact_Ontransition_Disable, 
				_ => Vector3.zero, 
			}), footPlacementData.GetCurrentFootWeight()));
			flag = false;
		}
		if (Physics.Raycast(iKPosition + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist + footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootLength, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)) && flag)
		{
			Vector3 val3 = ((RaycastHit)(ref val)).point;
			if (footPlacementData.mPlantFoot && footPlacementData.GetFootPlanted() && Physics.Raycast(footPlacementData.GetPlantedPos() + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist + footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootLength, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)))
			{
				val3 = Vector3.Lerp(val3, ((RaycastHit)(ref val)).point, footPlacementData.GetPlantBlendFactor());
			}
			footPlacementData.SetTargetPos(FootPlacementData.Target.TOE, val3 - footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT));
			switch ((int)foot_id)
			{
			case 0:
				mLeftToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE);
				break;
			case 1:
				mRightToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE);
				break;
			case 2:
				mLeftHandToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE);
				break;
			case 3:
				mRightHandToeContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.TOE);
				break;
			}
		}
		else
		{
			Vector3 val4 = (Vector3)((int)foot_id switch
			{
				0 => mLeftToeContact_Ontransition_Disable, 
				1 => mRightToeContact_Ontransition_Disable, 
				2 => mLeftHandToeContact_Ontransition_Disable, 
				3 => mRightHandToeContact_Ontransition_Disable, 
				_ => Vector3.zero, 
			});
			footPlacementData.SetTargetPos(FootPlacementData.Target.TOE, Vector3.Slerp(footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootLength, val4, footPlacementData.GetCurrentFootWeight()));
		}
		Quaternion val5 = default(Quaternion);
		((Quaternion)(ref val5))..ctor(0f, 0.7071f, 0f, 0.7071f);
		Vector3 val6 = iKPosition + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist;
		Vector3 val7 = val5 * footPlacementData.GetRotatedFwdVec();
		if (Physics.Raycast(val6 + ((Vector3)(ref val7)).normalized * footPlacementData.mFootHalfWidth, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)) && flag)
		{
			Vector3 val8 = ((RaycastHit)(ref val)).point;
			if (footPlacementData.mPlantFoot && footPlacementData.GetFootPlanted())
			{
				Vector3 val9 = footPlacementData.GetPlantedPos() + footPlacementData.mUpVector * footPlacementData.mFootOffsetDist;
				Vector3 val10 = val5 * footPlacementData.GetRotatedFwdVec();
				if (Physics.Raycast(val9 + ((Vector3)(ref val10)).normalized * footPlacementData.mFootHalfWidth, -footPlacementData.mUpVector, ref val, footPlacementData.mFootOffsetDist + footPlacementData.mFootLength + footPlacementData.mExtraRayDistanceCheck, LayerMask.op_Implicit(mLayerMask)))
				{
					val8 = Vector3.Lerp(val8, ((RaycastHit)(ref val)).point, footPlacementData.GetPlantBlendFactor());
				}
			}
			footPlacementData.SetTargetPos(FootPlacementData.Target.HEEL, val8 - footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT));
			switch ((int)foot_id)
			{
			case 0:
				mLeftHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL);
				break;
			case 1:
				mRightHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL);
				break;
			case 2:
				mLeftHandHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL);
				break;
			case 3:
				mRightHeelContact_Ontransition_Disable = footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL);
				break;
			default:
			{
				Vector3 val4 = Vector3.zero;
				break;
			}
			}
		}
		else
		{
			Vector3 val4 = (Vector3)((int)foot_id switch
			{
				0 => mLeftHeelContact_Ontransition_Disable, 
				1 => mRightHeelContact_Ontransition_Disable, 
				2 => mLeftHandHeelContact_Ontransition_Disable, 
				3 => mRightHandHeelContact_Ontransition_Disable, 
				_ => Vector3.zero, 
			});
			footPlacementData.SetTargetPos(FootPlacementData.Target.HEEL, Vector3.Slerp(val5 * footPlacementData.GetRotatedFwdVec() * footPlacementData.mFootHalfWidth, val4, footPlacementData.GetCurrentFootWeight()));
		}
	}

	protected void RootPositioningCheck()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_040f: Unknown result type (might be due to invalid IL or missing references)
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		//IL_042a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_044d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0458: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0475: Unknown result type (might be due to invalid IL or missing references)
		//IL_0480: Unknown result type (might be due to invalid IL or missing references)
		//IL_048b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0490: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04be: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_033c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0347: Unknown result type (might be due to invalid IL or missing references)
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_0357: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_037a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_038a: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		AnimateRootVertError();
		if (mAdjustPelvisVertically)
		{
			Vector3 val = mAnim.GetBoneTransform((HumanBodyBones)2).position - mAnim.GetIKPosition((AvatarIKGoal)1);
			float magnitude = ((Vector3)(ref val)).magnitude;
			FootPlacementData footPlacementData = mRightFoot;
			mRootPosLeftRightFoot = true;
			Vector3 val2 = mAnim.GetBoneTransform((HumanBodyBones)1).position - mAnim.GetIKPosition((AvatarIKGoal)0);
			float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude;
			Vector3 val3 = mAnim.GetBoneTransform((HumanBodyBones)2).position - mAnim.GetIKPosition((AvatarIKGoal)1);
			if (sqrMagnitude > ((Vector3)(ref val3)).sqrMagnitude)
			{
				Vector3 val4 = mAnim.GetBoneTransform((HumanBodyBones)1).position - mAnim.GetIKPosition((AvatarIKGoal)0);
				magnitude = ((Vector3)(ref val4)).magnitude;
				footPlacementData = mLeftFoot;
				mRootPosLeftRightFoot = false;
			}
			if (magnitude > mMaxLegLength)
			{
				mTargetRootVertError = magnitude - mMaxLegLength;
				float num = 0f;
				float num2 = 0f;
				Vector3 val5 = mAnim.GetBoneTransform((HumanBodyBones)1).position - (mAnim.GetIKPosition((AvatarIKGoal)0) + mLeftFoot.mUpVector * mTargetRootVertError);
				float magnitude2 = ((Vector3)(ref val5)).magnitude;
				if (magnitude2 < mMinLegLength)
				{
					num = mMinLegLength - magnitude2;
				}
				Vector3 val6 = mAnim.GetBoneTransform((HumanBodyBones)2).position - (mAnim.GetIKPosition((AvatarIKGoal)1) + mLeftFoot.mUpVector * mTargetRootVertError);
				magnitude2 = ((Vector3)(ref val6)).magnitude;
				if (magnitude2 < mMinLegLength)
				{
					num2 = mMinLegLength - magnitude2;
				}
				if (num2 != 0f || num != 0f)
				{
					if (num2 > num)
					{
						mTargetRootVertError -= num2;
					}
					else
					{
						mTargetRootVertError -= num;
					}
				}
			}
			else
			{
				mTargetRootVertError = 0f;
				mCurrentPelvisSpeed = 0f;
			}
			mAnim.SetIKPosition((AvatarIKGoal)0, mAnim.GetIKPosition((AvatarIKGoal)0) + footPlacementData.mUpVector * mCurrentRootVertError);
			mAnim.SetIKPosition((AvatarIKGoal)1, mAnim.GetIKPosition((AvatarIKGoal)1) + footPlacementData.mUpVector * mCurrentRootVertError);
			mAnim.SetIKPosition((AvatarIKGoal)2, mAnim.GetIKPosition((AvatarIKGoal)2) + footPlacementData.mUpVector * mCurrentRootVertError);
			mAnim.SetIKPosition((AvatarIKGoal)3, mAnim.GetIKPosition((AvatarIKGoal)3) + footPlacementData.mUpVector * mCurrentRootVertError);
			return;
		}
		mTargetRootVertError = 0f;
		mCurrentPelvisSpeed = 0f;
		if (Mathf.Abs(mCurrentRootVertError) >= 0.005f)
		{
			if (mRootPosLeftRightFoot)
			{
				mAnim.SetIKPosition((AvatarIKGoal)0, mAnim.GetIKPosition((AvatarIKGoal)0) + mRightFoot.mUpVector * mCurrentRootVertError);
				mAnim.SetIKPosition((AvatarIKGoal)1, mAnim.GetIKPosition((AvatarIKGoal)1) + mRightFoot.mUpVector * mCurrentRootVertError);
				mAnim.SetIKPosition((AvatarIKGoal)2, mAnim.GetIKPosition((AvatarIKGoal)2) + mRightFoot.mUpVector * mCurrentRootVertError);
				mAnim.SetIKPosition((AvatarIKGoal)3, mAnim.GetIKPosition((AvatarIKGoal)3) + mRightFoot.mUpVector * mCurrentRootVertError);
			}
			else
			{
				mAnim.SetIKPosition((AvatarIKGoal)0, mAnim.GetIKPosition((AvatarIKGoal)0) + mRightFoot.mUpVector * mCurrentRootVertError);
				mAnim.SetIKPosition((AvatarIKGoal)1, mAnim.GetIKPosition((AvatarIKGoal)1) + mRightFoot.mUpVector * mCurrentRootVertError);
				mAnim.SetIKPosition((AvatarIKGoal)2, mAnim.GetIKPosition((AvatarIKGoal)2) + mRightFoot.mUpVector * mCurrentRootVertError);
				mAnim.SetIKPosition((AvatarIKGoal)3, mAnim.GetIKPosition((AvatarIKGoal)3) + mRightFoot.mUpVector * mCurrentRootVertError);
			}
		}
	}

	protected void AnimateRootVertError()
	{
		float num = Mathf.Abs(mCurrentRootVertError - mTargetRootVertError);
		if (num < 0.005f)
		{
			mCurrentRootVertError = mTargetRootVertError;
			mCurrentPelvisSpeed = 0f;
			return;
		}
		float num2 = Mathf.Sign(mTargetRootVertError - mCurrentRootVertError);
		if (mDampPelvis)
		{
			if (num < mTargetRootVertError * 0.3f)
			{
				mCurrentPelvisSpeed -= mPelvisAdjustmentSpeed * Time.deltaTime;
				if (mCurre