M2HB.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OpenScripts2;
using OtherLoader;
using TheNext;
using UnityEditor;
using UnityEngine;
using Valve.VR;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace JerryComponent
{
	public class EnableIfDisabled : MonoBehaviour
	{
		public FVRFireArmRound Bullet;

		public GameObject Obj;

		public GameObject Renderer;

		private void Start()
		{
		}

		private void Update()
		{
			if (Bullet.IsSpent)
			{
				Obj.SetActive(true);
			}
			if (Bullet.IsChambered)
			{
				Renderer.SetActive(true);
			}
			if (!Bullet.IsChambered)
			{
				Renderer.SetActive(false);
			}
		}
	}
	public class Syringe : FVRFireArmAttachment
	{
		public enum CartridgeState
		{
			Whole,
			BitOpen,
			Jammed
		}

		public List<Renderer> Rends;

		public CartridgeState CState;

		public int numPowderChunksLeft = 20;

		public AudioEvent AudEvent_Bite;

		public AudioEvent AudEvent_Tap;

		public Transform PowderSpawnPoint;

		public GameObject PowderPrefab;

		public GameObject BitPart;

		public AudioEvent AudEvent_Spit;

		public GameObject Splode;

		[NonSerialized]
		public bool m_isDestroyed;

		[NonSerialized]
		public float m_tickDownToSpit = 0.2f;

		[NonSerialized]
		public bool m_tickingDownToSpit;

		[NonSerialized]
		public float timeSinceSpawn = 1f;

		public PowerupType put;

		public PowerUpIntensity pui;

		public PowerUpDuration pud;

		public AudioEvent AudEvent_DIng;

		public FVRPhysicalObject PenObject;

		public bool isAlreadyInHeadRange = false;

		public bool isUsed = false;

		public KillAfter ka;

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

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

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

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

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

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

		public GameObject booletcam;

		private GameObject bullet;

		private bool spawned = false;

		private GameObject bc;

		private RaycastHit hit;

		private Ray ray;

		public LayerMask mask;

		private float timeb = 1f;

		private void Awake()
		{
		}

		private void Start()
		{
		}

		private void Update()
		{
			//IL_008f: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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_0183: Unknown result type (might be due to invalid IL or missing references)
			timeb += Time.deltaTime;
			boolet = Object.FindObjectOfType<BallisticProjectile>();
			if ((Object)(object)boolet != (Object)null)
			{
				bullet = ((Component)boolet).gameObject;
			}
			if ((Object)(object)boolet == (Object)null)
			{
			}
			if ((Object)(object)bullet != (Object)null && !spawned)
			{
				if (timeb >= 1f)
				{
					ray = new Ray(bullet.transform.position, bullet.transform.forward);
					if (Physics.Raycast(ray, ref hit, 2000f, LayerMask.op_Implicit(mask)) && ((Object)((Component)((RaycastHit)(ref hit)).collider).gameObject).name == "Geo_Head")
					{
						Time.timeScale = Mathf.Clamp(0.0001f, 0.0001f, 1f);
						Time.fixedDeltaTime = Time.timeScale / SteamVR.instance.hmd_DisplayFrequency;
						bc = Object.Instantiate<GameObject>(booletcam, bullet.transform.localPosition, Quaternion.identity);
						bc.transform.parent = bullet.transform;
						bc.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
						timeb = 0f;
					}
				}
				if (!(timeb < 1f))
				{
				}
			}
			if (spawned)
			{
			}
			if ((Object)(object)bc == (Object)null)
			{
				spawned = false;
			}
			if ((Object)(object)bc != (Object)null)
			{
				spawned = true;
			}
		}
	}
	public class BulletSearcher : MonoBehaviour
	{
		public GameObject BulletCamPrefab;

		public LayerMask RaycastHitMask;

		public float Range = 2000f;

		[HideInInspector]
		public static GameObject SpawnedBulletCamera;

		public void Awake()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			OpenScripts2_BasePlugin.ProjectileFiredEvent += new ProjectileFired(ProjectileFiredEvent);
		}

		public void OnDestroy()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			OpenScripts2_BasePlugin.ProjectileFiredEvent -= new ProjectileFired(ProjectileFiredEvent);
		}

		private void ProjectileFiredEvent(FVRFireArm fireArm, BallisticProjectile projectile)
		{
			//IL_001a: 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_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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)
			if (!((Object)(object)SpawnedBulletCamera == (Object)null))
			{
				return;
			}
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Component)projectile).transform.position, ((Component)projectile).transform.forward);
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(val, ref val2, Range, LayerMask.op_Implicit(RaycastHitMask)))
			{
				if (((Object)((Component)((RaycastHit)(ref val2)).collider).gameObject).name == "Geo_Head")
				{
					SpawnedBulletCamera = Object.Instantiate<GameObject>(BulletCamPrefab, ((Component)projectile).transform.position, Quaternion.identity);
					SpawnedBulletCamera.transform.SetParent(((Component)projectile).transform);
					SpawnedBulletCamera.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
				else
				{
					Debug.Log((object)"Head Not Hit!");
				}
			}
			else
			{
				Debug.Log((object)"Missed Sosig entirely!");
			}
		}

		private Vector3 GetZeroDirection(FVRFireArm fvrfireArm, BallisticProjectile projectile, float distance)
		{
			//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_0013: 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_0050: 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_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			FireArmRoundType roundType = fvrfireArm.RoundType;
			float num = 0f;
			if (AM.SRoundDisplayDataDic.ContainsKey(roundType))
			{
				FVRFireArmRoundDisplayData val = AM.SRoundDisplayDataDic[roundType];
				num = val.BulletDropCurve.Evaluate(distance * 0.001f);
			}
			Vector3 val2 = fvrfireArm.MuzzlePos.position + fvrfireArm.GetMuzzle().forward * distance + Vector3.up * num;
			return val2 - ((Component)projectile).transform.position;
		}
	}
	public class CameraAutoOn : MonoBehaviour
	{
		public GameObject CameraGameObject;

		public float MinimumTimeScale;

		public RotateOverTime RotateOverTimeComponent;

		private Vector3 _lastBulletPosition;

		private float _currentTimeScale;

		private float _speed;

		private static readonly float s_fixedDeltaTime;

		static CameraAutoOn()
		{
			s_fixedDeltaTime = -1f;
			s_fixedDeltaTime = Time.fixedDeltaTime;
		}

		public void Awake()
		{
			ChangeTimeScale(MinimumTimeScale);
			CameraGameObject.SetActive(true);
		}

		private void OnTriggerEnter(Collider other)
		{
			ResetAndDestroy();
		}

		private void OnTriggerExit(Collider other)
		{
			ResetAndDestroy();
		}

		private void OnTriggerStay(Collider other)
		{
			ResetAndDestroy();
		}

		public void ResetAndDestroy()
		{
			CameraGameObject.SetActive(false);
			ChangeTimeScale(1f);
			BulletSearcher.SpawnedBulletCamera = null;
			Object.Destroy((Object)(object)this);
		}

		public float Speed()
		{
			//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_000e: 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_0015: 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_002c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)this).transform.position;
			_speed = Vector3.Magnitude(position - _lastBulletPosition) / Time.fixedDeltaTime;
			_lastBulletPosition = position;
			return _speed;
		}

		public void Update()
		{
			_currentTimeScale = (MinimumTimeScale += Time.fixedDeltaTime);
			if (_currentTimeScale > 1f)
			{
				_currentTimeScale = 1f;
			}
			RotateOverTimeComponent.angularVelocity.y = 1f / MinimumTimeScale * (1f - _currentTimeScale);
			ChangeTimeScale(_currentTimeScale);
		}

		public void OnDestroy()
		{
			CameraGameObject.SetActive(false);
			ChangeTimeScale(1f);
			BulletSearcher.SpawnedBulletCamera = null;
		}

		private void ChangeTimeScale(float scale)
		{
			Time.timeScale = Mathf.Clamp(scale, MinimumTimeScale, 1f);
			Time.fixedDeltaTime = Time.timeScale * s_fixedDeltaTime;
			_currentTimeScale = scale;
		}
	}
}
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
public class DeferredNightVisionEffect : MonoBehaviour
{
	[SerializeField]
	[Tooltip("The main color of the NV effect")]
	public Color m_NVColor = new Color(0f, 1f, 0.1724138f, 0f);

	[SerializeField]
	[Tooltip("The color that the NV effect will 'bleach' towards (white = default)")]
	public Color m_TargetBleachColor = new Color(1f, 1f, 1f, 0f);

	[Range(0f, 0.1f)]
	[Tooltip("How much base lighting does the NV effect pick up")]
	public float m_baseLightingContribution = 0.025f;

	[Range(0f, 128f)]
	[Tooltip("The higher this value, the more bright areas will get 'bleached out'")]
	public float m_LightSensitivityMultiplier = 100f;

	private Material m_Material;

	private Shader m_Shader;

	[Tooltip("Do we want to apply a vignette to the edges of the screen?")]
	public bool useVignetting = true;

	public Shader NightVisionShader => m_Shader;

	private void DestroyMaterial(Material mat)
	{
		if (Object.op_Implicit((Object)(object)mat))
		{
			Object.DestroyImmediate((Object)(object)mat);
			mat = null;
		}
	}

	private void CreateMaterials()
	{
		if ((Object)(object)m_Shader == (Object)null)
		{
			m_Shader = Shader.Find("Custom/DeferredNightVisionShader");
		}
		if ((Object)(object)m_Material == (Object)null && (Object)(object)m_Shader != (Object)null && m_Shader.isSupported)
		{
			m_Material = CreateMaterial(m_Shader);
		}
	}

	private Material CreateMaterial(Shader shader)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)(object)shader))
		{
			return null;
		}
		Material val = new Material(shader);
		((Object)val).hideFlags = (HideFlags)61;
		return val;
	}

	private void OnDisable()
	{
		DestroyMaterial(m_Material);
		m_Material = null;
		m_Shader = null;
	}

	[ContextMenu("UpdateShaderValues")]
	public void UpdateShaderValues()
	{
		//IL_0023: 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_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)
		if (!((Object)(object)m_Material == (Object)null))
		{
			m_Material.SetVector("_NVColor", Color.op_Implicit(m_NVColor));
			m_Material.SetVector("_TargetWhiteColor", Color.op_Implicit(m_TargetBleachColor));
			m_Material.SetFloat("_BaseLightingContribution", m_baseLightingContribution);
			m_Material.SetFloat("_LightSensitivityMultiplier", m_LightSensitivityMultiplier);
			m_Material.shaderKeywords = null;
			if (useVignetting)
			{
				Shader.EnableKeyword("USE_VIGNETTE");
			}
			else
			{
				Shader.DisableKeyword("USE_VIGNETTE");
			}
		}
	}

	private void OnEnable()
	{
		CreateMaterials();
		UpdateShaderValues();
	}

	public void ReloadShaders()
	{
		OnDisable();
	}

	private void OnRenderImage(RenderTexture source, RenderTexture destination)
	{
		UpdateShaderValues();
		CreateMaterials();
		Graphics.Blit((Texture)(object)source, destination, m_Material);
	}
}
namespace JerryComponent
{
	public class guitarreset : MonoBehaviour
	{
		public AudioSource song;

		public GameObject rot;

		private bool is45 = false;

		private void Start()
		{
		}

		private void over45()
		{
			if (is45)
			{
				song.Stop();
			}
			is45 = false;
		}

		private void under45()
		{
			if (!is45)
			{
				song.Play();
				song.Pause();
			}
			is45 = true;
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (rot.transform.localEulerAngles.x > 45f)
			{
				over45();
			}
			if (rot.transform.localEulerAngles.x < 45f)
			{
				under45();
			}
		}
	}
	public class guitarscript : MonoBehaviour
	{
		public GameObject reset;

		public AudioSource song;

		public GameObject resetvolume;

		private bool slaponce;

		private void Start()
		{
		}

		private void OnTriggerEnter(Collider other)
		{
			slaponce = true;
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: 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_004a: 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_0064: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: 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_0180: 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_016a: 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_01fb: Unknown result type (might be due to invalid IL or missing references)
			if (reset.transform.localEulerAngles.x > 15f)
			{
				resetvolume.SetActive(true);
				resetvolume.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				if (resetvolume.transform.localEulerAngles.x > 25f)
				{
					resetvolume.transform.localEulerAngles = new Vector3(25f, 0f, 0f);
					resetvolume.SetActive(false);
				}
			}
			if (reset.transform.localEulerAngles.x < 15f)
			{
				resetvolume.SetActive(false);
				resetvolume.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if (reset.transform.localEulerAngles.x < 25f)
			{
				song.UnPause();
			}
			if (reset.transform.localEulerAngles.x > 25f)
			{
				reset.transform.localEulerAngles = new Vector3(25f, 0f, 0f);
			}
			if (reset.transform.localEulerAngles.x >= 25f)
			{
				song.Pause();
			}
			song.volume = 1f - resetvolume.transform.localEulerAngles.x * 0.04f;
			if (slaponce)
			{
				reset.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				slaponce = false;
			}
		}
	}
	public class guitarslap : MonoBehaviour
	{
		public GameObject slide;

		public AudioSource asa1;

		public AudioSource asa2;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			asa1.pitch = slide.transform.localPosition.z;
			asa2.pitch = slide.transform.localPosition.z;
		}
	}
	public class guitarslap2 : MonoBehaviour
	{
		public int start = 0;

		public SphereCollider cols;

		public int[] notes1;

		public int[] notes2;

		public int[] notes3;

		public int[] notes4;

		public AudioEvent[] clips;

		public GameObject foregrip;

		public GameObject hold1;

		public GameObject hold2;

		public GameObject hold3;

		public GameObject hold4;

		public Transform pos;

		private void Start()
		{
		}

		private void OnTriggerEnter(Collider col)
		{
			//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_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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: 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_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: 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_019f: 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_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: 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_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: 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_0302: 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_0386: Unknown result type (might be due to invalid IL or missing references)
			col = (Collider)(object)cols;
			if (hold1.transform.localEulerAngles.x < 45f && hold2.transform.localEulerAngles.x < 45f && hold3.transform.localEulerAngles.x < 45f && hold4.transform.localEulerAngles.x < 45f)
			{
				SM.PlayGenericSound(clips[0], pos.localPosition);
				start = 0;
			}
			if ((hold1.transform.localEulerAngles.x > 45f && notes1[start] == 0) || (hold2.transform.localEulerAngles.x > 45f && notes2[start] == 0) || (hold3.transform.localEulerAngles.x > 45f && notes3[start] == 0) || (hold4.transform.localEulerAngles.x > 45f && notes4[start] == 0))
			{
				start = 0;
			}
			if (hold1.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes1[start]);
				SM.PlayGenericSound(clips[notes1[start]], pos.localPosition);
				start++;
			}
			if (hold2.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes2[start]);
				SM.PlayGenericSound(clips[notes2[start]], pos.localPosition);
				start++;
			}
			if (hold3.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes3[start]);
				SM.PlayGenericSound(clips[notes3[start]], pos.localPosition);
				start++;
			}
			if (hold4.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes4[start]);
				SM.PlayGenericSound(clips[notes4[start]], pos.localPosition);
				start++;
			}
		}

		private void FixedUpdate()
		{
		}

		private void Update()
		{
		}
	}
	public class LebelHandle : MonoBehaviour
	{
		public Mac11_Stock fakeboltt;

		public BoltActionRifle_Handle realbolt;

		public GameObject rot;

		public GameObject fakebolt;

		public FVRAlternateGrip foregrip;

		private GameObject _player = null;

		private FVRViveHand leftHand = null;

		private FVRViveHand rightHand = null;

		public bool istransfterd = true;

		private void Awake()
		{
			_player = ((Component)Object.FindObjectOfType<FVRPlayerBody>()).gameObject;
		}

		private void Start()
		{
			leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent<FVRViveHand>();
			rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
		}

		private void BoltTransfer()
		{
			if (!istransfterd)
			{
				((FVRInteractiveObject)fakeboltt).EndInteraction(rightHand);
				rightHand.ForceSetInteractable((FVRInteractiveObject)(object)realbolt);
				((FVRInteractiveObject)realbolt).BeginInteraction(rightHand);
				istransfterd = true;
			}
			if (!istransfterd)
			{
			}
		}

		private void Update()
		{
			if (!fakebolt.activeInHierarchy)
			{
				BoltTransfer();
			}
			if (fakebolt.activeInHierarchy)
			{
				istransfterd = false;
			}
			if (!((Object)(object)_player == (Object)null) && !((Object)(object)leftHand == (Object)null) && !((Object)(object)rightHand == (Object)null))
			{
			}
		}
	}
	public class DshapeGrip : MonoBehaviour
	{
		public ClosedBoltWeapon gun;

		public GameObject trigL;

		public GameObject trigR;

		public GameObject magrel;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			if (trigL.transform.localEulerAngles.x > 45f || trigR.transform.localEulerAngles.x > 45f)
			{
				gun.Fire();
			}
			if (magrel.transform.localEulerAngles.x > 45f && (Object)(object)((FVRFireArm)gun).Magazine != (Object)null)
			{
				((FVRFireArm)gun).EjectMag(false);
			}
		}
	}
}
namespace JerryAr.M2HB
{
	[BepInPlugin("JerryAr.M2HB", "M2HB", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class M2HBPlugin : 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.M2HB");
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.M2HB", "", "", "m2hbm", "");
		}
	}
}
namespace JerryComponent
{
	public class AutoGrabMagWell : MonoBehaviour
	{
		public GameObject rot;

		public FVRFireArm gun;

		public FVRFoldingStockYAxis fold;

		private GameObject _player = null;

		private FVRViveHand leftHand = null;

		private FVRViveHand rightHand = null;

		public bool leftGrab;

		public bool rightGrab;

		private void Awake()
		{
			_player = ((Component)Object.FindObjectOfType<FVRPlayerBody>()).gameObject;
		}

		private void Start()
		{
			leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent<FVRViveHand>();
			rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
		}

		private void Update()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: 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_00ee: 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)
			if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
				if (gun.Magazine.IsBeltBox && rightHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 45f)
				{
					if ((Object)(object)rightHand.CurrentInteractable != (Object)null)
					{
						rightGrab = false;
						return;
					}
					rightHand.ForceSetInteractable((FVRInteractiveObject)(object)fold);
					((FVRInteractiveObject)fold).BeginInteraction(rightHand);
					rightGrab = true;
				}
				else if (gun.Magazine.IsBeltBox && !rightHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 45f)
				{
					gun.EjectMag(false);
				}
				else if (gun.Magazine.IsBeltBox && rot.transform.localEulerAngles.y != 45f)
				{
				}
			}
			else if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
			}
		}
	}
	public class BeltAppear : MonoBehaviour
	{
		public FVRFireArmTopCover cover;

		public FVRFoldingStockXAxis lifter;

		public BoxCollider col;

		public OpenBoltReceiver gun;

		public FVRObject[] beltempt;

		public Transform beltpos;

		public GameObject follower;

		public int followerX = 0;

		public int beltL = 20;

		public float a = 45f;

		private void Start()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			follower.transform.localPosition = new Vector3(0f, 0f, 0f);
			followerX = 0;
		}

		private void OnPKMShotFired(FVRFireArm fireArm)
		{
			if ((Object)(object)fireArm == (Object)(object)gun)
			{
				followerX++;
				if (followerX >= beltL)
				{
					Object.Instantiate<GameObject>(((AnvilAsset)beltempt[beltL]).GetGameObject(), beltpos);
					followerX = 0;
				}
			}
		}

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnPKMShotFired);
		}

		private void Update()
		{
			//IL_001d: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_0087: 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_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			follower.transform.localPosition = new Vector3((float)followerX, 0f, 0f);
			if (!((FVRFireArm)gun).HasBelt && ((Component)cover).transform.localEulerAngles.x >= 45f)
			{
				((Collider)col).enabled = true;
			}
			if (((FVRFireArm)gun).HasBelt && ((Component)cover).transform.localEulerAngles.x < 45f)
			{
				((Collider)col).enabled = false;
			}
			if (((Component)lifter).transform.localEulerAngles.x <= 22.5f && followerX != 0)
			{
				Object.Instantiate<GameObject>(((AnvilAsset)beltempt[followerX]).GetGameObject(), beltpos);
				followerX = 0;
			}
			if (((Component)lifter).transform.localEulerAngles.x < 45f)
			{
				a = ((Component)lifter).transform.localEulerAngles.x;
				((Component)lifter).transform.localEulerAngles = new Vector3(a + 5f, 0f, 0f);
			}
			if (((Component)lifter).transform.localEulerAngles.x == 45f)
			{
				a = 45f;
			}
			if (((Component)lifter).transform.localEulerAngles.x > 45f)
			{
				((Component)lifter).transform.localEulerAngles = new Vector3(45f, 0f, 0f);
			}
		}

		private void OnDestroy()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnPKMShotFired);
		}
	}
	public class BeltChange : MonoBehaviour
	{
		public OpenBoltReceiver gun2;

		public FVRFirearmBeltDisplayData data1;

		public FVRFirearmBeltDisplayData data2;

		public GameObject rot;

		public Transform _Magpos;

		public Transform _Boxpos;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_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 (rot.transform.localEulerAngles.x < 45f)
			{
				((FVRFireArm)gun2).BeltDD = data1;
			}
			if (rot.transform.localEulerAngles.x >= 45f)
			{
				((FVRFireArm)gun2).BeltDD = data2;
			}
			((FVRFireArm)gun2).BeltBoxMountPos = _Boxpos;
			((FVRFireArm)gun2).MagazineMountPos = _Magpos;
		}
	}
	public class Control_Enable : MonoBehaviour
	{
		public GameObject objToRead;

		public GameObject objToAffect;

		private void Start()
		{
		}

		private void Update()
		{
			if (objToRead.activeInHierarchy)
			{
				objToAffect.SetActive(true);
			}
			else
			{
				objToAffect.SetActive(false);
			}
		}
	}
	public class MagMani : MonoBehaviour
	{
		public OpenBoltReceiver gun;

		public GameObject magmount;

		public GameObject well;

		public Collider col;

		public Collider col2;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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_0190: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine))
			{
				if ((float)((FVRFireArm)gun).Magazine.m_numRounds == 0f)
				{
					col.enabled = true;
					if (magmount.transform.localEulerAngles.z < 5f)
					{
						((FVRFireArm)gun).EjectMag(true);
					}
					else if (!(magmount.transform.localEulerAngles.z >= 5f))
					{
					}
				}
				else if ((float)((FVRFireArm)gun).Magazine.m_numRounds > 0f && magmount.transform.localEulerAngles.z == 45f)
				{
					col.enabled = false;
				}
			}
			else if (!Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine) && magmount.transform.localEulerAngles.z < 5f)
			{
				well.transform.localEulerAngles = new Vector3(0f, 0f, 20f);
				((Component)this).transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			else if (Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine) && magmount.transform.localEulerAngles.z < 5f)
			{
				well.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if (Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine))
			{
				col2.enabled = false;
			}
			if (!Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine))
			{
				col2.enabled = true;
			}
		}
	}
}
public class MagPosChange : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}
}
namespace JerryComponent
{
	public class MagRotate : MonoBehaviour
	{
		public GameObject rot;

		public FVRFireArm gun;

		public FVRFoldingStockYAxis fold;

		private GameObject _player = null;

		private FVRViveHand leftHand = null;

		private FVRViveHand rightHand = null;

		public bool leftGrab;

		public bool rightGrab;

		private void Awake()
		{
			_player = ((Component)Object.FindObjectOfType<FVRPlayerBody>()).gameObject;
		}

		private void Start()
		{
			leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent<FVRViveHand>();
			rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
		}

		private void Update()
		{
			//IL_021b: 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_003c: 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_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: 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)
			if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
				if (rightHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					if ((Object)(object)rightHand.CurrentInteractable != (Object)null)
					{
						rightGrab = false;
					}
					else
					{
						rightHand.ForceSetInteractable((FVRInteractiveObject)(object)fold);
						((FVRInteractiveObject)fold).BeginInteraction(rightHand);
						rightGrab = true;
					}
				}
				if (leftHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					if ((Object)(object)leftHand.CurrentInteractable != (Object)null)
					{
						leftGrab = false;
						return;
					}
					leftHand.ForceSetInteractable((FVRInteractiveObject)(object)fold);
					((FVRInteractiveObject)fold).BeginInteraction(leftHand);
					leftGrab = true;
				}
				else if (!rightHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					gun.EjectMag(false);
				}
				else if (!leftHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					gun.EjectMag(false);
				}
				else if (rot.transform.localEulerAngles.y != 30f)
				{
				}
			}
			else if (!Object.op_Implicit((Object)(object)gun.Magazine))
			{
				rot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class DisableInterfaceAndcolliders : MonoBehaviour
	{
		public Handgun gun;

		public GameObject safetyrot;

		public FVRFireArmAttachmentMount maglatch;

		public FVRFireArmAttachmentMount barrel;

		public FVRFireArmAttachmentMount spring;

		public FVRFireArmAttachmentMount slide;

		public FVRFireArmAttachmentMount trigger;

		public FVRFireArmAttachmentMount triggerguard;

		public FVRFireArmAttachmentMount safety;

		public FVRFireArmAttachmentMount lever;

		public FVRFireArmAttachmentMount hammer;

		public FVRFireArmAttachmentMount hammerstop;

		public FVRFireArmAttachmentMount sliderelease;

		public Collider safetycol;

		public Collider springcol;

		public Collider slidecol;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			if (!maglatch.HasAttachmentsOnIt())
			{
				((FVRFireArm)gun).EjectMag(false);
			}
			else if (!maglatch.HasAttachmentsOnIt())
			{
			}
			if (barrel.HasAttachmentsOnIt())
			{
				springcol.enabled = true;
			}
			else if (!barrel.HasAttachmentsOnIt())
			{
				springcol.enabled = false;
			}
			if (barrel.HasAttachmentsOnIt() && spring.HasAttachmentsOnIt() && lever.HasAttachmentsOnIt() && hammer.HasAttachmentsOnIt() && hammerstop.HasAttachmentsOnIt() && sliderelease.HasAttachmentsOnIt())
			{
				slidecol.enabled = true;
			}
			else if (!barrel.HasAttachmentsOnIt() || !spring.HasAttachmentsOnIt() || !lever.HasAttachmentsOnIt() || !hammer.HasAttachmentsOnIt() || !hammerstop.HasAttachmentsOnIt() || !sliderelease.HasAttachmentsOnIt())
			{
				slidecol.enabled = false;
			}
			if (slide.HasAttachmentsOnIt())
			{
				safetycol.enabled = true;
			}
			else if (!slide.HasAttachmentsOnIt())
			{
				safetycol.enabled = false;
			}
			if (!slide.HasAttachmentsOnIt() || !trigger.HasAttachmentsOnIt() || !triggerguard.HasAttachmentsOnIt() || !safety.HasAttachmentsOnIt())
			{
				gun.m_isSafetyEngaged = true;
				safetyrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			else if (slide.HasAttachmentsOnIt() && trigger.HasAttachmentsOnIt() && triggerguard.HasAttachmentsOnIt() && !safety.HasAttachmentsOnIt())
			{
			}
		}
	}
}
public class BearControl : MonoBehaviour
{
	public CapsuleCollider bearCollider;

	public Collider planeCollider;

	public Collider terrianCollider;

	private Vector3 prevPos;

	private Vector3 v = Vector3.zero;

	private bool cached = false;

	private float g = -5f;

	private void Start()
	{
		//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)
		prevPos = ((Component)bearCollider).transform.position;
	}

	private void FixedUpdate()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: 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_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: 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_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: 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_00be: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
		Ray val = Camera.main.ScreenPointToRay(Input.mousePosition);
		Rigidbody component = ((Component)this).GetComponent<Rigidbody>();
		if (component.useGravity)
		{
			Transform transform = ((Component)bearCollider).transform;
			transform.position += v;
		}
		else
		{
			v = Vector3.zero;
			RaycastHit val2 = default(RaycastHit);
			if (planeCollider.Raycast(val, ref val2, 100f))
			{
				Vector3 point = ((RaycastHit)(ref val2)).point;
				point.y = ((!(point.y < -0.04f)) ? point.y : (-0.04f));
				((Component)bearCollider).transform.position = point;
				v = ((Component)bearCollider).transform.position - prevPos;
			}
		}
		prevPos = ((Component)bearCollider).transform.position;
	}

	private void Update()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: 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_002a: Unknown result type (might be due to invalid IL or missing references)
		Ray val = Camera.main.ScreenPointToRay(Input.mousePosition);
		Rigidbody component = ((Component)this).GetComponent<Rigidbody>();
		RaycastHit val2 = default(RaycastHit);
		if (Input.GetMouseButton(0) && ((Collider)bearCollider).Raycast(val, ref val2, 100f))
		{
			cached = true;
			component.useGravity = false;
		}
		if (Input.GetMouseButtonUp(0))
		{
			cached = false;
			component.useGravity = true;
		}
	}

	public void ButtonDown()
	{
		Application.LoadLevel(0);
	}

	public void OnCollisionEnter(Collision other)
	{
		//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)
		v = Vector3.zero;
	}

	public void OnCollisionStay(Collision other)
	{
		//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)
		v = Vector3.zero;
	}
}
public class BodyController : MonoBehaviour
{
	public Transform windObj;

	private Animator animator;

	private Vector3 velocity;

	private Rigidbody rig;

	public float MoveSpeed = 5f;

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

	private void Update()
	{
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: 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_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: 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_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: Unknown result type (might be due to invalid IL or missing references)
		//IL_0246: 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)
		if ((Object)(object)animator == (Object)null)
		{
			return;
		}
		if (Input.GetButton("Jump"))
		{
			animator.SetBool("Jump", true);
		}
		else
		{
			animator.SetBool("Jump", false);
		}
		if (Input.GetKeyDown((KeyCode)49))
		{
			animator.SetInteger("Action", 1);
		}
		if (Input.GetKeyDown((KeyCode)50))
		{
			animator.SetInteger("Action", 2);
		}
		if (Input.GetKey((KeyCode)113))
		{
			windObj.Rotate(Vector3.up, 1f);
		}
		if (Input.GetKey((KeyCode)101))
		{
			windObj.Rotate(Vector3.up, -1f);
		}
		AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0);
		if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsTag("spActions"))
		{
			animator.SetInteger("Action", 0);
		}
		float axis = Input.GetAxis("Horizontal");
		float axis2 = Input.GetAxis("Vertical");
		float num = Mathf.Sqrt(axis * axis + axis2 * axis2);
		if (num > 1f)
		{
			num = 1f;
		}
		animator.SetFloat("Speed", num);
		if (num > 0.1f)
		{
			rig.useGravity = true;
			velocity = new Vector3(0f, 0f, num);
			float num2 = Mathf.Atan(axis / axis2);
			num2 *= 57.29578f;
			if (axis2 < 0f)
			{
				num2 -= 180f;
			}
			Vector3 zero = Vector3.zero;
			CharacterController component = ((Component)this).GetComponent<CharacterController>();
			((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, num2, 0f)), Time.deltaTime * 10f);
			velocity = ((Component)this).transform.TransformDirection(velocity);
			velocity *= MoveSpeed * Time.deltaTime;
			Transform transform = ((Component)this).transform;
			transform.position += velocity;
			Transform obj = windObj;
			obj.position += velocity;
		}
	}

	public void ButtonDown()
	{
		Application.LoadLevel(0);
	}
}
public class Demo02Camera : MonoBehaviour
{
	public Transform follow;

	public float followHeight = 1.3f;

	public float distanceAway = 5f;

	public float distanceUp = 2f;

	public float smooth = 1f;

	public bool Inverse = false;

	private Vector3 targetPosition;

	private Vector3 followPosition;

	private Vector3 forward;

	private float rotateSpeed = 2f;

	public Vector3 cameraRot;

	private Vector3 cameraPitch;

	private Quaternion rotSpeed;

	private float[] distanseArray = new float[4] { 0.8f, 0.6f, 0.4f, 0.2f };

	private void Start()
	{
		//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)
		//IL_0012: 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_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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)
		cameraPitch = Vector3.zero;
		cameraRot = Vector3.zero;
		forward = Vector3.forward;
		followPosition = Vector3.zero;
		Application.targetFrameRate = 10;
	}

	private void LateUpdate()
	{
		//IL_0020: 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_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_004e: 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_0063: 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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
		followPosition.y = followHeight;
		float num = distanceAway;
		targetPosition = follow.position + Vector3.up * distanceUp + (float)(Inverse ? 1 : (-1)) * forward * num;
		((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, targetPosition, Time.deltaTime * smooth);
		((Component)this).transform.LookAt(follow.position + followPosition);
	}
}
public class Attach : MonoBehaviour
{
	public Transform ropeEnd;

	public Transform bear;

	public Vector3 offset;

	private void LateUpdate()
	{
		//IL_000d: 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_0018: Unknown result type (might be due to invalid IL or missing references)
		bear.position = ropeEnd.position + offset;
	}
}
public class RopeController : MonoBehaviour
{
	public SphereCollider ropeCollider;

	public Collider planeCollider;

	private Ray mouseRay;

	private bool cached = false;

	private Vector3 pos = Vector3.zero;

	private Vector3 prevPos = Vector3.zero;

	private void Start()
	{
	}

	private void Update()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: 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_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_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: 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_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_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: 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_0050: 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_00a0: 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_00ba: 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_00c7: 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_00e8: 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_00f4: 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)
		Ray val = (mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition));
		Vector3 zero = Vector3.zero;
		RaycastHit val2 = default(RaycastHit);
		if (Input.GetMouseButton(0) && ((Collider)ropeCollider).Raycast(val, ref val2, 100f))
		{
			zero = ((RaycastHit)(ref val2)).point - ((Component)this).transform.position;
			cached = true;
		}
		if (Input.GetMouseButtonUp(0))
		{
			cached = false;
			prevPos = Vector3.zero;
			pos = Vector3.zero;
		}
		if (cached && planeCollider.Raycast(val, ref val2, 100f))
		{
			prevPos = pos;
			pos = ((RaycastHit)(ref val2)).point;
			if (prevPos != Vector3.zero)
			{
				Transform transform = ((Component)this).transform;
				transform.position += pos - prevPos;
			}
		}
	}

	private void OnDrawGizmos()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		Gizmos.color = Color.red;
		Gizmos.DrawLine(((Component)Camera.main).transform.position, pos);
	}
}
public class DynamicalSetup : MonoBehaviour
{
	private PhysicalBoneManager manager;

	private PhysicalBone hairRoot;

	private BoneAttribute attribute;

	private GameObject sphere;

	private SphereCollider sphereCollider;

	private GameObject wind;

	private PhysicalBoneCollider spherePhyCollider;

	private void Start()
	{
	}

	private void Update()
	{
		if ((Object)(object)manager == (Object)null)
		{
			manager = ((Component)this).gameObject.AddComponent<PhysicalBoneManager>();
			hairRoot = GameObject.FindGameObjectWithTag("HairTest").AddComponent<PhysicalBone>();
			hairRoot.Initialize();
			manager.addBoneRoot(hairRoot);
			hairRoot.stiffness = 10f;
			hairRoot.airFriction = 14f;
			hairRoot.radius = 0.04f;
			attribute = hairRoot.getBoneAttribute("hairPlait_L");
			if (attribute == null)
			{
				attribute = new BoneAttribute();
			}
			attribute.freezed = true;
			hairRoot.setBoneAttribute("hairPlait_L", attribute);
			sphere = GameObject.FindGameObjectWithTag("Sphere");
			sphereCollider = sphere.AddComponent<SphereCollider>();
			sphereCollider.radius = 0.5f;
			spherePhyCollider = sphere.AddComponent<PhysicalBoneCollider>();
			manager.addGlobalCollider(spherePhyCollider);
			wind = GameObject.FindGameObjectWithTag("Wind");
			wind.AddComponent<PhysicalBoneWindZone>();
		}
	}
}
namespace TheNext
{
	[Serializable]
	public class BoneAttribute
	{
		public bool freezed = false;

		public bool useIndividualAttribute = false;

		public bool useIndividualVelocityScale = false;

		public Vector3 velocityScale = Vector3.one;

		public float mass = 1f;

		public float stiffness = 20f;

		public float airFriction = 5f;

		public bool useIndividualRadius = false;

		public float radius = 0.1f;

		public bool rotationLimit = false;

		public Vector3 rotationAxis = Vector3.zero;

		public float maxRotationAngle = 180f;
	}
	public enum AxisEnum
	{
		x,
		xReverse,
		y,
		yReverse,
		z,
		zReverse
	}
	[ExecuteInEditMode]
	public class PhysicalBone : MonoBehaviour
	{
		private const int MAX_BONE_COUNT = 500;

		private PhysicalBoneBase[] softBones = new PhysicalBoneBase[500];

		[SerializeField]
		private Transform[] boneTransform = (Transform[])(object)new Transform[500];

		[SerializeField]
		private BoneAttribute[] boneAttribute = new BoneAttribute[500];

		private Vector3[] prevBonePos = (Vector3[])(object)new Vector3[500];

		private int boneCount = 0;

		public Vector3 globalVelocityScale = new Vector3(1f, 1f, 1f);

		public float gravity = 9.8f;

		public float mass = 1f;

		public bool smoothTweening = true;

		public bool highStiffnessTweenFix = false;

		[Range(0f, 1f)]
		public float energyDecay = 0.99f;

		public float stiffness = 10f;

		public float airFriction = 5f;

		public float radius = 0.1f;

		public float radiusScale = 1f;

		public bool rotationLimit = false;

		public float maxRotationAngle = 180f;

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

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

		public AxisEnum boneAxis = AxisEnum.y;

		public AxisEnum prevBoneAxis = AxisEnum.y;

		public bool selfCollision = false;

		public bool useGlobalColliders = true;

		public bool colliderFriction = true;

		private Vector3 globalPos;

		private int maxDeep = 0;

		public List<PhysicalBoneCollider> localColliders = new List<PhysicalBoneCollider>();

		private int colliderCount = 0;

		public void Initialize()
		{
			if (maxDeep == 0)
			{
				boneCount = 0;
				maxDeep = setupBone(((Component)this).transform, 0);
			}
		}

		private void Start()
		{
			if (maxDeep == 0)
			{
				boneCount = 0;
				maxDeep = setupBone(((Component)this).transform, 0);
				int num = 0;
			}
		}

		private int setupBone(Transform tf, int deep)
		{
			//IL_005f: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: 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_00af: 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_0124: Unknown result type (might be due to invalid IL or missing references)
			if (tf.childCount == 0)
			{
				return deep;
			}
			if (boneCount >= 500)
			{
				throw new UnityException("Warning: The bone count can't greater than " + 500 + " :" + ((Object)((Component)this).gameObject).name);
			}
			Vector3 val = Vector3.zero;
			for (int i = 0; i < tf.childCount; i++)
			{
				if ((Object)(object)tf.GetChild(i) != (Object)null)
				{
					val += tf.GetChild(i).position;
				}
			}
			int childCount = tf.childCount;
			if (childCount == 0)
			{
				val = Vector3.zero;
				softBones[boneCount] = null;
				return deep;
			}
			val /= (float)childCount;
			deep++;
			boneTransform[boneCount] = tf;
			if (boneAttribute[boneCount] == null)
			{
				boneAttribute[boneCount] = new BoneAttribute();
			}
			softBones[boneCount] = new PhysicalBoneBase(tf, boneAttribute[boneCount], val, deep, boneCount);
			boneCount++;
			int num = 0;
			for (int j = 0; j < tf.childCount; j++)
			{
				if ((Object)(object)tf.GetChild(j) != (Object)null)
				{
					int num2 = setupBone(tf.GetChild(j), deep);
					if (num2 > num)
					{
						num = num2;
					}
				}
			}
			return num;
		}

		public void DoSimpleUpdate(Vector3 globalPos, float dt)
		{
			//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)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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_0068: 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_00b0: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: 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_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: 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_014b: 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_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			this.globalPos = globalPos;
			Vector3 fixMotion = Vector3.zero;
			int i = 0;
			int num = 0;
			for (; i < boneCount; i++)
			{
				if (softBones[i] != null && !boneAttribute[i].freezed)
				{
					if (highStiffnessTweenFix && num == 0)
					{
						fixMotion = boneTransform[i].position - prevBonePos[i];
						num = 1;
					}
					Vector3 val = (boneAttribute[i].rotationLimit ? boneAttribute[i].rotationAxis : ((!rotationLimit) ? Vector3.zero : rotationAxis));
					float maxAngle = (boneAttribute[i].rotationLimit ? boneAttribute[i].maxRotationAngle : ((!rotationLimit) ? 360f : maxRotationAngle));
					Vector3 val2 = ((!boneAttribute[i].useIndividualVelocityScale) ? globalVelocityScale : boneAttribute[i].velocityScale);
					if (smoothTweening)
					{
						softBones[i].smoothUpdate(((Component)this).transform.TransformDirection(((Vector3)(ref val)).normalized), maxAngle, boneAxisValue, globalPos, val2, fixMotion, dt);
					}
					else
					{
						softBones[i].simpleUpdate(((Component)this).transform.TransformDirection(((Vector3)(ref val)).normalized), maxAngle, boneAxisValue, globalPos, val2);
					}
				}
			}
		}

		public void DoUpdate(Vector3 force, List<PhysicalBoneCollider> globalColliders, float loop, Vector3 globalPos, float dt)
		{
			//IL_0049: 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_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_008a: 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_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: 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_00ab: 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_00c7: 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_00de: 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_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: 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_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: 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_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: 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_0348: 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_0265: 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_03c3: 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_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: 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_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < localColliders.Count; i++)
			{
				PhysicalBoneCollider physicalBoneCollider = localColliders[i];
				if (Object.op_Implicit((Object)(object)physicalBoneCollider) && ((Behaviour)physicalBoneCollider).isActiveAndEnabled)
				{
					physicalBoneCollider.DoUpdate();
				}
			}
			this.globalPos = globalPos;
			if (boneAxis != prevBoneAxis)
			{
				if (boneAxis == AxisEnum.x)
				{
					boneAxisValue = Vector3.right;
				}
				else if (boneAxis == AxisEnum.xReverse)
				{
					boneAxisValue = Vector3.left;
				}
				else if (boneAxis == AxisEnum.y)
				{
					boneAxisValue = Vector3.up;
				}
				else if (boneAxis == AxisEnum.yReverse)
				{
					boneAxisValue = Vector3.down;
				}
				else if (boneAxis == AxisEnum.z)
				{
					boneAxisValue = Vector3.forward;
				}
				else if (boneAxis == AxisEnum.zReverse)
				{
					boneAxisValue = Vector3.back;
				}
				prevBoneAxis = boneAxis;
			}
			for (int j = 0; j < boneCount; j++)
			{
				if (softBones[j] != null && !boneAttribute[j].freezed)
				{
					Vector3 val = (boneAttribute[j].rotationLimit ? boneAttribute[j].rotationAxis : ((!rotationLimit) ? Vector3.zero : rotationAxis));
					float maxAngle = (boneAttribute[j].rotationLimit ? boneAttribute[j].maxRotationAngle : ((!rotationLimit) ? 360f : maxRotationAngle));
					Vector3 val2 = ((!boneAttribute[j].useIndividualVelocityScale) ? globalVelocityScale : boneAttribute[j].velocityScale);
					softBones[j].DoUpdate(gravity, energyDecay, mass, stiffness, airFriction, radius, radiusScale, ((Component)this).transform.TransformDirection(((Vector3)(ref val)).normalized), maxAngle, boneAxisValue, force, val2, selfCollision, softBones, colliderFriction, (!useGlobalColliders) ? null : globalColliders, localColliders, loop, globalPos, softBones[0].transform.position, dt);
				}
			}
			if (!smoothTweening)
			{
				return;
			}
			Vector3 fixMotion = Vector3.zero;
			int k = 0;
			int num = 0;
			for (; k < boneCount; k++)
			{
				if (softBones[k] != null && !boneAttribute[k].freezed)
				{
					if (highStiffnessTweenFix && num == 0)
					{
						fixMotion = boneTransform[k].position - prevBonePos[k];
						num = 1;
					}
					Vector3 val3 = (boneAttribute[k].rotationLimit ? boneAttribute[k].rotationAxis : ((!rotationLimit) ? Vector3.zero : rotationAxis));
					float maxAngle2 = (boneAttribute[k].rotationLimit ? boneAttribute[k].maxRotationAngle : ((!rotationLimit) ? 360f : maxRotationAngle));
					Vector3 val4 = ((!boneAttribute[k].useIndividualVelocityScale) ? globalVelocityScale : boneAttribute[k].velocityScale);
					softBones[k].preSmoothUpdate(((Component)this).transform.TransformDirection(((Vector3)(ref val3)).normalized), maxAngle2, boneAxisValue, val4, globalPos, fixMotion);
				}
			}
			if (highStiffnessTweenFix)
			{
				for (int l = 0; l < boneCount; l++)
				{
					ref Vector3 reference = ref prevBonePos[l];
					reference = boneTransform[l].position;
				}
			}
		}

		public bool setBoneAttribute(string boneName, BoneAttribute attr)
		{
			if (attr == null)
			{
				return false;
			}
			for (int i = 0; i < boneTransform.Length; i++)
			{
				if ((Object)(object)boneTransform[i] == (Object)null)
				{
					return false;
				}
				if (((Object)boneTransform[i]).name == boneName)
				{
					boneAttribute[i] = attr;
					return true;
				}
			}
			return false;
		}

		public BoneAttribute getBoneAttribute(string boneName)
		{
			for (int i = 0; i < boneTransform.Length; i++)
			{
				if ((Object)(object)boneTransform[i] == (Object)null)
				{
					return null;
				}
				if (((Object)boneTransform[i]).name == boneName)
				{
					return boneAttribute[i];
				}
			}
			return null;
		}

		public void addLocalCollider(PhysicalBoneCollider collider)
		{
			localColliders.Add(collider);
		}

		public void removeLocalCollider(PhysicalBoneCollider collider)
		{
			localColliders.Remove(collider);
		}

		private void OnDrawGizmos()
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: 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_01ad: 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_01b2: 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_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: 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_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: 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_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			if (softBones == null)
			{
				return;
			}
			for (int i = 0; i < boneCount; i++)
			{
				if (softBones[i] == null)
				{
					continue;
				}
				float num = radiusScale * ((!boneAttribute[i].useIndividualRadius) ? radius : boneAttribute[i].radius);
				if (Application.isPlaying && !boneAttribute[i].freezed)
				{
					Vector3 val = globalPos;
					Vector3 val2 = ((!boneAttribute[i].useIndividualVelocityScale) ? globalVelocityScale : boneAttribute[i].velocityScale);
					val.x *= val2.x;
					val.y *= val2.y;
					val.z *= val2.z;
					Vector3 val3 = softBones[i].bonePos - val + globalPos;
					Gizmos.color = ((softBones[i].contactColliderCount != 0) ? Color.green : Color.red);
					Gizmos.DrawWireSphere(val3, radiusScale * ((!softBones[i].attribute.useIndividualRadius) ? radius : softBones[i].attribute.radius));
					Vector3 val4 = (boneAttribute[i].rotationLimit ? boneAttribute[i].rotationAxis : ((!rotationLimit) ? Vector3.zero : rotationAxis));
					if (val4 != Vector3.zero)
					{
						Gizmos.color = Color.yellow;
						Vector3 val5 = ((Component)this).transform.TransformDirection(((Vector3)(ref val4)).normalized) * ((!boneAttribute[i].useIndividualAttribute) ? radius : boneAttribute[i].radius) * 10f;
						Gizmos.DrawLine(val3 - val5, val3 + val5);
					}
				}
				else
				{
					drawChildGizmo(boneTransform[i], num, boneAttribute[i]);
				}
			}
		}

		private void drawChildGizmo(Transform tf, float radius, BoneAttribute attri)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0031: 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_004a: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_0082: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00be: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: 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_00ee: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			if (tf.childCount <= 0)
			{
				return;
			}
			Vector3 val = Vector3.zero;
			for (int i = 0; i < tf.childCount; i++)
			{
				val += tf.GetChild(i).position;
			}
			val /= (float)tf.childCount;
			Gizmos.color = ((!attri.freezed) ? Color.red : Color.gray);
			Gizmos.DrawWireSphere(val, radius);
			if (!attri.freezed)
			{
				Gizmos.color = Color.yellow;
				Vector3 val2 = (attri.rotationLimit ? attri.rotationAxis : ((!rotationLimit) ? Vector3.zero : rotationAxis));
				if (val2 != Vector3.zero)
				{
					Vector3 val3 = ((Component)this).transform.TransformDirection(((Vector3)(ref val2)).normalized) * 0.1f;
					Gizmos.DrawLine(val - val3, val + val3);
				}
			}
		}
	}
	[CustomEditor(typeof(PhysicalBone))]
	public class PhysicalBoneInspector : Editor
	{
		public override void OnInspectorGUI()
		{
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("boneAxis"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("globalVelocityScale"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("gravity"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("mass"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			SerializedProperty val = ((Editor)this).serializedObject.FindProperty("smoothTweening");
			EditorGUILayout.PropertyField(val, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUI.BeginDisabledGroup(!val.boolValue);
			EditorGUI.indentLevel += 1;
			SerializedProperty val2 = ((Editor)this).serializedObject.FindProperty("highStiffnessTweenFix");
			EditorGUILayout.PropertyField(val2, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUI.indentLevel -= 1;
			EditorGUI.EndDisabledGroup();
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("energyDecay"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("stiffness"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("airFriction"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("radius"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("radiusScale"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			SerializedProperty val3 = ((Editor)this).serializedObject.FindProperty("rotationLimit");
			EditorGUILayout.PropertyField(val3, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUI.BeginDisabledGroup(!val3.boolValue);
			EditorGUI.indentLevel += 1;
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("rotationAxis"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("maxRotationAngle"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUI.indentLevel -= 1;
			EditorGUI.EndDisabledGroup();
			DrawAttributeList(((Editor)this).serializedObject.FindProperty("boneAttribute"), ((Editor)this).serializedObject.FindProperty("boneTransform"));
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("selfCollision"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("useGlobalColliders"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("colliderFriction"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
			EditorGUILayout.PropertyField(((Editor)this).serializedObject.FindProperty("localColliders"), true, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			((Editor)this).serializedObject.ApplyModifiedProperties();
		}

		private void DrawAttributeList(SerializedProperty alist, SerializedProperty tlist)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			EditorGUILayout.PropertyField(alist, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (!alist.isExpanded)
			{
				return;
			}
			EditorGUI.indentLevel += 1;
			for (int i = 0; i < alist.arraySize; i++)
			{
				SerializedProperty arrayElementAtIndex = tlist.GetArrayElementAtIndex(i);
				if (arrayElementAtIndex.objectReferenceValue != (Object)null)
				{
					Object objectReferenceValue = arrayElementAtIndex.objectReferenceValue;
					Transform val = (Transform)(object)((objectReferenceValue is Transform) ? objectReferenceValue : null);
					SerializedProperty arrayElementAtIndex2 = alist.GetArrayElementAtIndex(i);
					EditorGUILayout.PropertyField(arrayElementAtIndex2, new GUIContent(((Object)val).name), (GUILayoutOption[])(object)new GUILayoutOption[0]);
					if (arrayElementAtIndex2.isExpanded)
					{
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("freezed"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						SerializedProperty val2 = arrayElementAtIndex2.FindPropertyRelative("useIndividualVelocityScale");
						EditorGUILayout.PropertyField(val2, (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.BeginDisabledGroup(!val2.boolValue);
						EditorGUI.indentLevel += 1;
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("velocityScale"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.indentLevel -= 1;
						EditorGUI.EndDisabledGroup();
						SerializedProperty val3 = arrayElementAtIndex2.FindPropertyRelative("useIndividualRadius");
						EditorGUILayout.PropertyField(val3, (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.BeginDisabledGroup(!val3.boolValue);
						EditorGUI.indentLevel += 1;
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("radius"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.indentLevel -= 1;
						EditorGUI.EndDisabledGroup();
						SerializedProperty val4 = arrayElementAtIndex2.FindPropertyRelative("useIndividualAttribute");
						EditorGUILayout.PropertyField(val4, (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.BeginDisabledGroup(!val4.boolValue);
						EditorGUI.indentLevel += 1;
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("mass"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("stiffness"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("airFriction"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.indentLevel -= 1;
						EditorGUI.EndDisabledGroup();
						SerializedProperty val5 = arrayElementAtIndex2.FindPropertyRelative("rotationLimit");
						EditorGUILayout.PropertyField(val5, (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.BeginDisabledGroup(!val5.boolValue);
						EditorGUI.indentLevel += 1;
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("rotationAxis"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUILayout.PropertyField(arrayElementAtIndex2.FindPropertyRelative("maxRotationAngle"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
						EditorGUI.indentLevel -= 1;
						EditorGUI.EndDisabledGroup();
					}
				}
			}
			EditorGUI.indentLevel -= 1;
		}
	}
	public class PhysicalBoneBase
	{
		public GameObject gameObject;

		public Transform transform;

		protected float bLength;

		public Vector3 prevPosition;

		protected Quaternion prevRotation;

		protected Quaternion tRot;

		protected Vector3 tmpBPos;

		public Vector3 prevBPos;

		public Vector3 prevBPos2;

		public Vector3 bonePos;

		public readonly Vector3 oriPos;

		public readonly Vector3 oriVec;

		protected Vector3 pBPos = Vector3.zero;

		protected float energeValue;

		protected float prevEnergeDecay;

		public readonly int deep;

		public readonly int id;

		protected Quaternion oriRotation;

		protected Vector3 oriPosition;

		private PhysicalBoneCollider contactCollider;

		public BoneAttribute attribute;

		public int contactColliderCount = 0;

		public PhysicalBoneBase(Transform transform, BoneAttribute attribute, Vector3 bonePos, int boneDeep, int boneID)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_0042: 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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_0082: 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_009b: 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)
			this.transform = transform;
			gameObject = ((Component)transform).gameObject;
			this.attribute = attribute;
			this.bonePos = bonePos;
			tmpBPos = bonePos;
			prevBPos = bonePos;
			prevBPos2 = bonePos;
			pBPos = bonePos;
			oriPos = bonePos;
			oriVec = bonePos - transform.position;
			prevPosition = transform.position;
			bLength = Vector3.Distance(transform.position, bonePos);
			oriRotation = transform.localRotation;
			oriPosition = transform.localPosition;
			deep = boneDeep;
			id = boneID;
		}

		public void smoothUpdate(Vector3 rotAxis, float maxAngle, Vector3 boneAxis, Vector3 globalPosition, Vector3 globalVelocityScale, Vector3 fixMotion, float dt)
		{
			//IL_0001: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: 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_00de: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might