Decompiled source of Mannlicher G95 v1.0.0

Mannlicher_G95.dll

Decompiled 5 months ago
using System;
using System.Collections;
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 HarmonyLib;
using OtherLoader;
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]
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 (mCurrentPelvisSpeed < mPelvisAdjustmentSpeed * 0.5f)
				{
					mCurrentPelvisSpeed = mPelvisAdjustmentSpeed * 0.5f;
				}
				mCurrentRootVertError += num2 * mCurrentPelvisSpeed * Time.deltaTime;
			}
			else
			{
				mCurrentRootVertError += num2 * mPelvisAdjustmentSpeed * Time.deltaTime;
			}
		}
		else
		{
			mCurrentRootVertError += num2 * mPelvisAdjustmentSpeed * Time.deltaTime;
			mCurrentPelvisSpeed = 0f;
		}
		if (Mathf.Sign(mTargetRootVertError - mCurrentRootVertError) * num2 <= 0f)
		{
			mCurrentRootVertError = mTargetRootVertError;
		}
	}

	public void FootPlacement(AvatarIKGoal foot_id)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected I4, but got Unknown
		//IL_00c1: 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_00cd: 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_00db: 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_00ee: 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_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: 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_0134: 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_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: 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_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: 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_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: 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_01e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: 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_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Invalid comparison between Unknown and I4
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0235: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: 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_025e: 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_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0270: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_0308: Unknown result type (might be due to invalid IL or missing references)
		//IL_030d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0315: Unknown result type (might be due to invalid IL or missing references)
		//IL_0327: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: 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_02ce: 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_02d9: 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_02e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0389: 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_039b: Unknown result type (might be due to invalid IL or missing references)
		//IL_039c: Unknown result type (might be due to invalid IL or missing references)
		FootPlacementData footPlacementData = null;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			if (!mLeftFootActive)
			{
				return;
			}
			footPlacementData = mLeftFoot;
			break;
		case 1:
			if (!mRightFootActive)
			{
				return;
			}
			footPlacementData = mRightFoot;
			break;
		case 2:
			if (!mLeftHandActive)
			{
				return;
			}
			footPlacementData = mLeftHand;
			break;
		case 3:
			if (!mRightHandActive)
			{
				return;
			}
			footPlacementData = mRightHand;
			break;
		}
		((Vector3)(ref footPlacementData.mUpVector)).Normalize();
		((Vector3)(ref footPlacementData.mForwardVector)).Normalize();
		footPlacementData.CalculateRotatedIKHint();
		footPlacementData.CalculateRotatedFwdVec();
		footPlacementData.SetTargetPos(FootPlacementData.Target.FOOT, mAnim.GetIKPosition(foot_id));
		UpdateFootPlantBlendWeights(foot_id);
		FindContactPoints(foot_id);
		CheckForLimits(foot_id);
		CalculateIKGoalWeights(foot_id);
		mAnim.SetIKRotationWeight(foot_id, footPlacementData.GetCurrentFootWeight());
		float num = Vector3.Angle(footPlacementData.GetRotatedFwdVec(), footPlacementData.mForwardVector);
		Quaternion val = default(Quaternion);
		((Quaternion)(ref val))..ctor(0f, 0.7071f, 0f, 0.7071f);
		Quaternion val2 = Quaternion.FromToRotation(footPlacementData.mForwardVector, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE));
		Vector3 eulerAngles = ((Quaternion)(ref val2)).eulerAngles;
		eulerAngles.z = 0f;
		Quaternion val3 = Quaternion.Euler(eulerAngles);
		if ((num > 90f && num < 180f) || (num > 270f && num < 360f))
		{
			Quaternion val4 = Quaternion.FromToRotation(footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL), val * footPlacementData.GetRotatedFwdVec());
			eulerAngles = ((Quaternion)(ref val4)).eulerAngles;
		}
		else
		{
			Quaternion val5 = Quaternion.FromToRotation(val * footPlacementData.GetRotatedFwdVec(), footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL));
			eulerAngles = ((Quaternion)(ref val5)).eulerAngles;
		}
		eulerAngles.x = 0f;
		eulerAngles.y = 0f;
		val3 *= Quaternion.Euler(eulerAngles);
		mAnim.SetIKRotation(foot_id, val3);
		Vector3 zero = Vector3.zero;
		if ((int)foot_id == 0)
		{
			zero = mAnim.GetBoneTransform((HumanBodyBones)3).position - mAnim.GetIKPosition((AvatarIKGoal)0);
			mAnim.SetIKHintPositionWeight((AvatarIKHint)0, footPlacementData.GetCurrentFootWeight());
			mAnim.SetIKHintPosition((AvatarIKHint)0, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE) + footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT) + footPlacementData.GetRotatedIKHint() + zero);
		}
		if ((int)foot_id == 1)
		{
			zero = mAnim.GetBoneTransform((HumanBodyBones)4).position - mAnim.GetBoneTransform((HumanBodyBones)6).position;
			mAnim.SetIKHintPositionWeight((AvatarIKHint)1, footPlacementData.GetCurrentFootWeight());
			mAnim.SetIKHintPosition((AvatarIKHint)1, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE) + footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT) + footPlacementData.GetRotatedIKHint() + zero);
		}
		Vector3 val6 = footPlacementData.GetTargetPos(FootPlacementData.Target.FOOT) + footPlacementData.mUpVector * footPlacementData.mFootHeight;
		mAnim.SetIKPositionWeight(foot_id, footPlacementData.GetCurrentFootWeight());
		mAnim.SetIKPosition(foot_id, val6);
		if (footPlacementData.GetCurrentFootWeight() <= 0f)
		{
			footPlacementData.SetFootPlanted(planted: false);
		}
		else if (footPlacementData.mPlantFoot && !footPlacementData.GetFootPlanted() && Mathf.Abs(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight()) < 0.005f)
		{
			footPlacementData.SetPlantedPos(mAnim.GetIKPosition(foot_id));
			footPlacementData.SetPlantedRot(mAnim.GetIKRotation(foot_id));
			footPlacementData.SetFootPlanted(planted: true);
		}
	}

	private void UpdateLayerMask()
	{
		//IL_0021: 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)
		for (byte b = 0; b < mLayersToIgnore.Length; b++)
		{
			int num = LayerMask.NameToLayer(mLayersToIgnore[b]);
			if (num != -1)
			{
				mLayerMask = LayerMask.op_Implicit(LayerMask.op_Implicit(mLayerMask) & ~Mathf.RoundToInt(Mathf.Pow(2f, (float)num)));
			}
		}
	}

	private void Start()
	{
		mAnim = ((Component)this).GetComponent<Animator>();
		bool flag = false;
		bool flag2 = false;
		bool flag3 = false;
		bool flag4 = false;
		FootPlacementData[] components = ((Component)this).GetComponents<FootPlacementData>();
		for (byte b = 0; b < components.Length; b++)
		{
			switch (components[b].mFootID)
			{
			case FootPlacementData.LimbID.LEFT_FOOT:
				flag = true;
				mLeftFoot = components[b];
				break;
			case FootPlacementData.LimbID.RIGHT_FOOT:
				flag2 = true;
				mRightFoot = components[b];
				break;
			case FootPlacementData.LimbID.RIGHT_HAND:
				flag4 = true;
				mLeftHand = components[b];
				break;
			case FootPlacementData.LimbID.LEFT_HAND:
				flag3 = true;
				mRightHand = components[b];
				break;
			}
			if (flag && flag2 && flag3 && flag4)
			{
				break;
			}
		}
	}

	private void OnAnimatorIK()
	{
		UpdateLayerMask();
		if ((Object)(object)mLeftFoot != (Object)null)
		{
			FootPlacement((AvatarIKGoal)0);
		}
		if ((Object)(object)mRightFoot != (Object)null)
		{
			FootPlacement((AvatarIKGoal)1);
		}
		if ((Object)(object)mLeftHand != (Object)null)
		{
			FootPlacement((AvatarIKGoal)2);
		}
		if ((Object)(object)mRightHand != (Object)null)
		{
			FootPlacement((AvatarIKGoal)3);
		}
		RootPositioningCheck();
	}

	private void LateUpdate()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: 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_002b: 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_0041: 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)
		if (mCurrentRootVertError != 0f)
		{
			if (mRootPosLeftRightFoot)
			{
				Transform boneTransform = mAnim.GetBoneTransform((HumanBodyBones)0);
				boneTransform.position -= mRightFoot.mUpVector * mCurrentRootVertError;
			}
			else
			{
				Transform boneTransform2 = mAnim.GetBoneTransform((HumanBodyBones)0);
				boneTransform2.position -= mLeftFoot.mUpVector * mCurrentRootVertError;
			}
		}
	}
}
public class QBslotSpawn : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}
}
public class Rotate : MonoBehaviour
{
	public bool Up = false;

	public bool Forward = true;

	public bool Right = false;

	public float Speed = 0.025f;

	private void FixedUpdate()
	{
		//IL_0012: 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_0054: Unknown result type (might be due to invalid IL or missing references)
		if (Up)
		{
			((Component)this).transform.Rotate(Vector3.up, Speed);
		}
		if (Forward)
		{
			((Component)this).transform.Rotate(Vector3.forward, Speed);
		}
		if (Right)
		{
			((Component)this).transform.Rotate(Vector3.right, Speed);
		}
	}
}
public class RagdollAdd : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}
}
namespace JerryAr.Mannlicher_G95;

[BepInPlugin("JerryAr.Mannlicher_G95", "Mannlicher_G95", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Mannlicher_G95Plugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	internal static ManualLogSource Logger;

	private void Awake()
	{
		Logger = ((BaseUnityPlugin)this).Logger;
		LoadAssets();
	}

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "JerryAr.Mannlicher_G95");
		OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.Mannlicher_G95", "", "", "mannlicherm95", "");
	}
}
public class RandomMovement : MonoBehaviour
{
	public NavMeshAgent agent;

	public float range;

	public Transform centrePoint;

	private void Start()
	{
		agent = ((Component)this).GetComponent<NavMeshAgent>();
	}

	private void Update()
	{
		//IL_0024: 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)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: 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)
		if (agent.remainingDistance <= agent.stoppingDistance && RandomPoint(centrePoint.position, range, out var result))
		{
			Debug.DrawRay(result, Vector3.up, Color.blue, 1f);
			agent.SetDestination(result);
		}
	}

	private bool RandomPoint(Vector3 center, float range, out Vector3 result)
	{
		//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_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_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: 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)
		//IL_0041: 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)
		Vector3 val = center + Random.insideUnitSphere * range;
		NavMeshHit val2 = default(NavMeshHit);
		if (NavMesh.SamplePosition(val, ref val2, 1f, -1))
		{
			result = ((NavMeshHit)(ref val2)).position;
			return true;
		}
		result = Vector3.zero;
		return false;
	}
}
public class FaceUpdate : MonoBehaviour
{
	public AnimationClip[] animations;

	private Animator anim;

	public float delayWeight;

	private float current = 0f;

	private void Start()
	{
		anim = ((Component)this).GetComponent<Animator>();
	}

	private void Update()
	{
		if (Input.GetMouseButton(0))
		{
			current = 1f;
		}
		else
		{
			current = Mathf.Lerp(current, 0f, delayWeight);
		}
		anim.SetLayerWeight(1, current);
	}
}
[RequireComponent(typeof(Animator))]
public class IdleChanger : MonoBehaviour
{
	private Animator anim;

	private AnimatorStateInfo currentState;

	private AnimatorStateInfo previousState;

	public bool _random = false;

	public float _threshold = 0.5f;

	public float _interval = 2f;

	private void Start()
	{
		//