Decompiled source of Modmas 2024 Finale v1.0.1

MalorianCode.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using FistVR;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("MalorianCode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MalorianCode")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b9b63cac-1c1d-40c4-8f6e-11274edf9b9a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Cityrobo
{
	public class MalorianAnimationController : MonoBehaviour
	{
		private enum EBoltPos
		{
			Forward,
			ForwardToEject,
			Eject,
			EjectToStartChambering,
			StartChambering,
			ChamberingToLocked,
			Locked,
			LockedToRear,
			Rear
		}

		private class ProxyInfo
		{
			public FVRFireArmChamber Chamber;

			public FVRFirearmMovingProxyRound Proxy;

			public Transform Parent;

			public float CurrentBoltZPosition;

			public Transform RoundPosMagExit;

			public Transform RoundPosEjecting;
		}

		[Header("ManipulateFireArmRoundProxy Config")]
		public FVRFireArm FireArm;

		[Tooltip("Bolt/Slide position at which chambering starts.\nIf not set this is the Bolt/Slide-Lock position.")]
		public Transform BoltRoundChamberingStartPos;

		[Tooltip("Bolt/Slide position at which chambering ends.\nIf not set this is the Chamber position.")]
		public Transform BoltRoundChamberingEndPos;

		[Tooltip("Bolt/Slide position at which extraction starts.\nIf not set this is the Chamber position.")]
		public Transform BoltRoundExtractionStartPos;

		[Tooltip("Bolt/Slide position at which extraction ends.\nIf not set this is the Bolt/Slide-Lock position.")]
		public Transform BoltRoundExtractionEndPos;

		[Tooltip("Is magazine a double feed magazine?")]
		public bool DoubleFeed;

		[Header("Chambering Animation")]
		public AnimationCurve ChamberingPosX;

		public AnimationCurve ChamberingPosY;

		public AnimationCurve ChamberingPosZ;

		public AnimationCurve ChamberingRotX;

		public AnimationCurve ChamberingRotY;

		public AnimationCurve ChamberingRotZ;

		[Header("Extraction Animation")]
		public AnimationCurve ExtractionPosX;

		public AnimationCurve ExtractionPosY;

		public AnimationCurve ExtractionPosZ;

		public AnimationCurve ExtractionRotX;

		public AnimationCurve ExtractionRotY;

		public AnimationCurve ExtractionRotZ;

		[Header("In Editor Testing")]
		[Tooltip("Putting a testing round into this field activates in editor testing.")]
		public Transform ProxyRound;

		[Tooltip("Check this box to test the extraction cycle.")]
		public bool TestExtraction;

		[Tooltip("Set the virtual amount of rounds in the magazine for double feed testing.")]
		public int VirtualNumberOfRoundsInMag;

		[Tooltip("Does round in magazine start on even round count?")]
		public bool StartsAtEvenRoundCount;

		[Tooltip("Displays the current bolt lerp to help with keyframe creation. (time value)")]
		public float CurrentEditorLerpValue;

		[Header("Only used for curve setup with context menu.")]
		[Tooltip("Round X-Axis offset inside the magazine")]
		public float DoubleFeedXPosOffset;

		[Tooltip("Round Y-Axis rotation inside the magazine")]
		public float DoubleFeedYRotOffset;

		[HideInInspector]
		public bool RoundWasExtracted;

		private static readonly Dictionary<Handgun, MalorianAnimationController> _existingManipulateFireArmRoundProxyHandguns = new Dictionary<Handgun, MalorianAnimationController>();

		private float _lastBoltZ;

		private EBoltPos _curBoltPos;

		private EBoltPos _lastBoltPos;

		private Transform BoltParent
		{
			get
			{
				FVRFireArm fireArm = FireArm;
				ClosedBoltWeapon val = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
				if (val == null)
				{
					Handgun val2 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
					if (val2 == null)
					{
						TubeFedShotgun val3 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
						if (val3 == null)
						{
							OpenBoltReceiver val4 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
							if (val4 == null)
							{
								BoltActionRifle val5 = (BoltActionRifle)(object)((fireArm is BoltActionRifle) ? fireArm : null);
								if (val5 != null)
								{
									return ((Component)val5.BoltHandle).transform.parent;
								}
								return null;
							}
							return ((Component)val4.Bolt).transform.parent;
						}
						return ((Component)val3.Bolt).transform.parent;
					}
					return ((Component)val2.Slide).transform.parent;
				}
				return ((Component)val.Bolt).transform.parent;
			}
		}

		private float CurrentBoltZ
		{
			get
			{
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				FVRFireArm fireArm = FireArm;
				ClosedBoltWeapon val = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
				if (val == null)
				{
					Handgun val2 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
					if (val2 == null)
					{
						TubeFedShotgun val3 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
						if (val3 == null)
						{
							OpenBoltReceiver val4 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
							if (val4 == null)
							{
								BoltActionRifle val5 = (BoltActionRifle)(object)((fireArm is BoltActionRifle) ? fireArm : null);
								if (val5 != null)
								{
									return ((Component)val5.BoltHandle).transform.localPosition.z;
								}
								return 0f;
							}
							return val4.Bolt.m_boltZ_current;
						}
						return val3.Bolt.m_boltZ_current;
					}
					return val2.Slide.m_slideZ_current;
				}
				return val.Bolt.m_boltZ_current;
			}
		}

		private FVRFireArmChamber Chamber
		{
			get
			{
				FVRFireArm fireArm = FireArm;
				ClosedBoltWeapon val = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
				if (val == null)
				{
					OpenBoltReceiver val2 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
					if (val2 == null)
					{
						TubeFedShotgun val3 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
						if (val3 == null)
						{
							Handgun val4 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
							if (val4 == null)
							{
								return ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).Chamber;
							}
							return val4.Chamber;
						}
						return val3.Chamber;
					}
					return val2.Chamber;
				}
				return val.Chamber;
			}
		}

		private static bool CheckAllDictionariesForFirearm(FVRFireArm fireArm, out MalorianAnimationController manipulateFireArmRoundProxy)
		{
			Handgun val = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
			if (val != null)
			{
				Handgun key = val;
				if (_existingManipulateFireArmRoundProxyHandguns.TryGetValue(key, out manipulateFireArmRoundProxy))
				{
					return true;
				}
			}
			manipulateFireArmRoundProxy = null;
			return false;
		}

		public void Awake()
		{
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			FVRFireArm fireArm = FireArm;
			Handgun val = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
			if (val != null)
			{
				_existingManipulateFireArmRoundProxyHandguns.Add(val, this);
				if ((Object)(object)BoltRoundChamberingStartPos == (Object)null)
				{
					BoltRoundChamberingStartPos = val.Slide.Point_Slide_LockPoint;
				}
				if ((Object)(object)BoltRoundChamberingEndPos == (Object)null)
				{
					BoltRoundChamberingEndPos = val.Slide.Point_Slide_Forward;
				}
				if ((Object)(object)BoltRoundExtractionStartPos == (Object)null)
				{
					BoltRoundExtractionStartPos = val.Slide.Point_Slide_Forward;
				}
				if ((Object)(object)BoltRoundExtractionEndPos == (Object)null)
				{
					BoltRoundExtractionEndPos = val.Slide.Point_Slide_LockPoint;
				}
				_lastBoltZ = ((Component)val.Slide).transform.localPosition.z;
			}
		}

		public void OnDestroy()
		{
			FVRFireArm fireArm = FireArm;
			Handgun val = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
			if (val != null)
			{
				_existingManipulateFireArmRoundProxyHandguns.Remove(val);
			}
		}

		public void Update()
		{
			if ((Object)(object)ProxyRound == (Object)null)
			{
				UpdateCurrentBoltPositionEnum();
				if (_curBoltPos >= EBoltPos.Eject && _lastBoltPos < EBoltPos.Eject)
				{
					FVRFireArm fireArm = FireArm;
					Handgun val = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
					if (val != null)
					{
						Handgun_BoltEvent_EjectRound(val.Slide);
					}
				}
				if (!Chamber.IsFull && _curBoltPos < EBoltPos.StartChambering && _lastBoltPos > EBoltPos.EjectToStartChambering)
				{
					FVRFireArm fireArm2 = FireArm;
					Handgun val2 = (Handgun)(object)((fireArm2 is Handgun) ? fireArm2 : null);
					if (val2 != null)
					{
						Handgun_BoltEvent_ExtractRoundFromMag(val2.Slide);
					}
				}
				_lastBoltPos = _curBoltPos;
			}
			else
			{
				UpdateDisplayRoundPositionsEditor();
			}
		}

		private void UpdateCurrentBoltPositionEnum()
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			Transform boltParent = BoltParent;
			float currentBoltZ = CurrentBoltZ;
			FVRFireArm fireArm = FireArm;
			ClosedBoltWeapon val = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			float num;
			if (val == null)
			{
				Handgun val2 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val2 == null)
				{
					TubeFedShotgun val3 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val3 == null)
					{
						OpenBoltReceiver val4 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						if (val4 == null)
						{
							BoltActionRifle val5 = (BoltActionRifle)(object)((fireArm is BoltActionRifle) ? fireArm : null);
							num = ((val5 == null) ? 0f : val5.BoltHandle.Point_Forward.localPosition.z);
						}
						else
						{
							num = val4.Bolt.m_boltZ_forward;
						}
					}
					else
					{
						num = val3.Bolt.m_boltZ_forward;
					}
				}
				else
				{
					num = val2.Slide.m_slideZ_forward;
				}
			}
			else
			{
				num = val.Bolt.m_boltZ_forward;
			}
			float num2 = num;
			fireArm = FireArm;
			ClosedBoltWeapon val6 = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			if (val6 == null)
			{
				Handgun val7 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val7 == null)
				{
					TubeFedShotgun val8 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val8 == null)
					{
						OpenBoltReceiver val9 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						if (val9 == null)
						{
							BoltActionRifle val10 = (BoltActionRifle)(object)((fireArm is BoltActionRifle) ? fireArm : null);
							num = ((val10 == null) ? 0f : Mathf.Lerp(val10.BoltHandle.Point_Forward.localPosition.z, val10.BoltHandle.Point_Rearward.localPosition.z, 0.975f));
						}
						else
						{
							num = val9.Bolt.m_boltZ_lock;
						}
					}
					else
					{
						num = val8.Bolt.m_boltZ_lock;
					}
				}
				else
				{
					num = val7.Slide.m_slideZ_lock;
				}
			}
			else
			{
				num = val6.Bolt.m_boltZ_lock;
			}
			float num3 = num;
			fireArm = FireArm;
			ClosedBoltWeapon val11 = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			if (val11 == null)
			{
				Handgun val12 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val12 == null)
				{
					TubeFedShotgun val13 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val13 == null)
					{
						OpenBoltReceiver val14 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						if (val14 == null)
						{
							BoltActionRifle val15 = (BoltActionRifle)(object)((fireArm is BoltActionRifle) ? fireArm : null);
							num = ((val15 == null) ? 0f : val15.BoltHandle.Point_Rearward.localPosition.z);
						}
						else
						{
							num = val14.Bolt.m_boltZ_rear;
						}
					}
					else
					{
						num = val13.Bolt.m_boltZ_rear;
					}
				}
				else
				{
					num = val12.Slide.m_slideZ_rear;
				}
			}
			else
			{
				num = val11.Bolt.m_boltZ_rear;
			}
			float num4 = num;
			float z = boltParent.InverseTransformPoint(BoltRoundChamberingStartPos.position).z;
			float z2 = boltParent.InverseTransformPoint(BoltRoundExtractionEndPos.position).z;
			EBoltPos curBoltPos = ((!Mathf.Approximately(currentBoltZ, num2)) ? ((Mathf.Approximately(currentBoltZ, z2) && !Mathf.Approximately(num3, z2) && !Mathf.Approximately(z2, z)) ? EBoltPos.Eject : ((Mathf.Approximately(currentBoltZ, z) && !Mathf.Approximately(num3, z)) ? EBoltPos.StartChambering : (Mathf.Approximately(currentBoltZ, num3) ? EBoltPos.Locked : (Mathf.Approximately(currentBoltZ, num4) ? EBoltPos.Rear : ((currentBoltZ > z2) ? EBoltPos.ForwardToEject : ((currentBoltZ > z) ? EBoltPos.EjectToStartChambering : ((!(currentBoltZ > num3)) ? EBoltPos.LockedToRear : EBoltPos.ChamberingToLocked))))))) : EBoltPos.Forward);
			_curBoltPos = curBoltPos;
		}

		private void HandgunUpdate(HandgunSlide slide)
		{
			//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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Transform parent = ((Component)slide).transform.parent;
			float z = parent.InverseTransformPoint(BoltRoundExtractionEndPos.position).z;
			float z2 = parent.InverseTransformPoint(BoltRoundChamberingStartPos.position).z;
			if (_lastBoltZ >= z && slide.m_slideZ_current < z)
			{
				Handgun_BoltEvent_EjectRound(slide);
			}
			if (!slide.Handgun.m_proxy.IsFull && !slide.Handgun.Chamber.IsFull && slide.m_slideZ_current > z2)
			{
				Handgun_BoltEvent_ExtractRoundFromMag(slide);
			}
			_lastBoltZ = slide.m_slideZ_current;
		}

		private void Handgun_BoltEvent_ExtractRoundFromMag(HandgunSlide slide)
		{
			Handgun_BeginChamberingRound(slide.Handgun);
		}

		private void Handgun_BoltEvent_EjectRound(HandgunSlide slide)
		{
			slide.Handgun.EjectExtractedRound();
		}

		public void Handgun_BeginChamberingRound(Handgun handgun)
		{
			bool flag = false;
			GameObject fromPrefabReference = null;
			if (((FVRFireArm)handgun).HasBelt)
			{
				if (!handgun.m_proxy.IsFull && ((FVRFireArm)handgun).BeltDD.HasARound())
				{
					flag = true;
					fromPrefabReference = RemoveRound(((FVRFireArm)handgun).BeltDD);
				}
			}
			else if (!handgun.m_proxy.IsFull && (Object)(object)((FVRFireArm)handgun).Magazine != (Object)null && !((FVRFireArm)handgun).Magazine.IsBeltBox && ((FVRFireArm)handgun).Magazine.HasARound())
			{
				flag = true;
				fromPrefabReference = RemoveRound(((FVRFireArm)handgun).Magazine);
			}
			if (flag && flag)
			{
				handgun.m_proxy.SetFromPrefabReference(fromPrefabReference);
				UpdateDisplayRoundPositions();
			}
		}

		public GameObject RemoveRound(FVRFireArmMagazine mag)
		{
			mag.m_timeSinceRoundInserted = 0f;
			GameObject gameObject = ((AnvilAsset)mag.LoadedRounds[mag.m_numRounds - 1].LR_ObjectWrapper).GetGameObject();
			if ((!mag.IsInfinite || !GM.CurrentSceneSettings.AllowsInfiniteAmmoMags) && !GM.CurrentSceneSettings.IsAmmoInfinite && !GM.CurrentPlayerBody.IsInfiniteAmmo)
			{
				if (GM.CurrentPlayerBody.IsAmmoDrain)
				{
					mag.m_numRounds = 0;
				}
				else if (mag.m_numRounds > 0)
				{
					mag.LoadedRounds[mag.m_numRounds - 1] = null;
					mag.m_numRounds--;
					if (mag.DisplayBullets.Length != 0)
					{
						mag.DisplayBullets[0].SetActive(false);
					}
				}
			}
			RoundWasExtracted = true;
			return gameObject;
		}

		public GameObject RemoveRound(FVRFirearmBeltDisplayData belt)
		{
			GameObject gameObject = ((AnvilAsset)belt.BeltRounds[0].LR_ObjectWrapper).GetGameObject();
			if (!GM.CurrentPlayerBody.IsInfiniteAmmo && belt.m_roundsOnBelt > 0)
			{
				belt.BeltRounds.RemoveAt(0);
				belt.m_roundsOnBelt--;
			}
			if (belt.m_roundsOnBelt <= 0)
			{
				belt.Firearm.HasBelt = false;
			}
			RoundWasExtracted = true;
			return gameObject;
		}

		private void UpdateDisplayRoundPositionsEditor()
		{
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: 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_0025: 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_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_00d0: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			Transform boltParent = BoltParent;
			float currentBoltZ = CurrentBoltZ;
			float z;
			float z2;
			if (TestExtraction)
			{
				z = boltParent.InverseTransformPoint(BoltRoundExtractionStartPos.position).z;
				z2 = boltParent.InverseTransformPoint(BoltRoundExtractionEndPos.position).z;
				float num = (CurrentEditorLerpValue = Mathf.InverseLerp(z2, z, currentBoltZ));
				float num2 = ExtractionPosX.Evaluate(num);
				float num3 = ExtractionPosY.Evaluate(num);
				float num4 = ExtractionPosZ.Evaluate(num);
				float num5 = ExtractionRotX.Evaluate(num);
				float num6 = ExtractionRotY.Evaluate(num);
				float num7 = ExtractionRotZ.Evaluate(num);
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(num2, num3, num4);
				Quaternion val2 = Quaternion.Euler(num5, num6, num7);
				ProxyRound.position = boltParent.TransformPoint(val);
				ProxyRound.rotation = UnityEngineExtensions.TransformRotation(boltParent, val2);
				return;
			}
			z = boltParent.InverseTransformPoint(BoltRoundChamberingStartPos.position).z;
			z2 = boltParent.InverseTransformPoint(BoltRoundChamberingEndPos.position).z;
			float num8 = (CurrentEditorLerpValue = Mathf.InverseLerp(z, z2, currentBoltZ));
			float num9 = ChamberingPosX.Evaluate(num8);
			float num10 = ChamberingPosY.Evaluate(num8);
			float num11 = ChamberingPosZ.Evaluate(num8);
			float num12 = ChamberingRotX.Evaluate(num8);
			float num13 = ChamberingRotY.Evaluate(num8);
			float num14 = ChamberingRotZ.Evaluate(num8);
			if (DoubleFeed && ((float)VirtualNumberOfRoundsInMag % 2f != 0f || !StartsAtEvenRoundCount) && ((float)VirtualNumberOfRoundsInMag % 2f == 0f || StartsAtEvenRoundCount))
			{
				num9 = 0f - num9;
				num13 = 0f - num13;
			}
			Vector3 val3 = default(Vector3);
			((Vector3)(ref val3))..ctor(num9, num10, num11);
			Quaternion val4 = Quaternion.Euler(num12, num13, num14);
			ProxyRound.position = boltParent.TransformPoint(val3);
			ProxyRound.rotation = UnityEngineExtensions.TransformRotation(boltParent, val4);
		}

		public void UpdateDisplayRoundPositions()
		{
			FVRFireArm fireArm = FireArm;
			ClosedBoltWeapon val = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			FVRFireArmChamber val5;
			if (val == null)
			{
				Handgun val2 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val2 == null)
				{
					TubeFedShotgun val3 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val3 == null)
					{
						OpenBoltReceiver val4 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						val5 = ((val4 != null) ? val4.Chamber : ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).Chamber);
					}
					else
					{
						val5 = val3.Chamber;
					}
				}
				else
				{
					val5 = val2.Chamber;
				}
			}
			else
			{
				val5 = val.Chamber;
			}
			FVRFireArmChamber val6 = val5;
			fireArm = FireArm;
			ClosedBoltWeapon val7 = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			FVRFirearmMovingProxyRound val11;
			if (val7 == null)
			{
				Handgun val8 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val8 == null)
				{
					TubeFedShotgun val9 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val9 == null)
					{
						OpenBoltReceiver val10 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						val11 = ((val10 != null) ? val10.m_proxy : ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).m_proxy);
					}
					else
					{
						val11 = val9.m_proxy;
					}
				}
				else
				{
					val11 = val8.m_proxy;
				}
			}
			else
			{
				val11 = val7.m_proxy;
			}
			FVRFirearmMovingProxyRound val12 = val11;
			Transform boltParent = BoltParent;
			float currentBoltZ = CurrentBoltZ;
			fireArm = FireArm;
			ClosedBoltWeapon val13 = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			Transform val17;
			if (val13 == null)
			{
				Handgun val14 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val14 == null)
				{
					TubeFedShotgun val15 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val15 == null)
					{
						OpenBoltReceiver val16 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						val17 = ((val16 != null) ? val16.RoundPos_MagazinePos : ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).Extraction_MagazinePos);
					}
					else
					{
						val17 = val15.RoundPos_UpperPath_Forward;
					}
				}
				else
				{
					val17 = val14.RoundPos_Magazine;
				}
			}
			else
			{
				val17 = val13.RoundPos_MagazinePos;
			}
			Transform roundPosMagExit = val17;
			fireArm = FireArm;
			ClosedBoltWeapon val18 = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			if (val18 == null)
			{
				Handgun val19 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val19 == null)
				{
					TubeFedShotgun val20 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val20 == null)
					{
						OpenBoltReceiver val21 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						val17 = ((val21 != null) ? val21.RoundPos_Ejecting : ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).Extraction_Ejecting);
					}
					else
					{
						val17 = val20.RoundPos_Ejecting;
					}
				}
				else
				{
					val17 = val19.RoundPos_Ejecting;
				}
			}
			else
			{
				val17 = val18.RoundPos_Ejecting;
			}
			Transform roundPosEjecting = val17;
			ProxyInfo proxyInfo = new ProxyInfo
			{
				Chamber = val6,
				Proxy = val12,
				Parent = boltParent,
				CurrentBoltZPosition = currentBoltZ,
				RoundPosMagExit = roundPosMagExit,
				RoundPosEjecting = roundPosEjecting
			};
			if ((Object)(object)boltParent != (Object)null)
			{
				if ((Object)(object)val6 != (Object)null && val6.IsFull)
				{
					ModifyProxyPositionExtraction(proxyInfo);
				}
				if ((Object)(object)val12 != (Object)null && val12.IsFull)
				{
					ModifyProxyPositionChambering(proxyInfo);
				}
			}
		}

		private void ModifyProxyPositionExtraction(ProxyInfo proxyInfo)
		{
			//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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: 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_00bb: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			float z = proxyInfo.Parent.InverseTransformPoint(BoltRoundExtractionStartPos.position).z;
			float num = Mathf.InverseLerp(proxyInfo.Parent.InverseTransformPoint(BoltRoundExtractionEndPos.position).z, z, proxyInfo.CurrentBoltZPosition);
			float num2 = ExtractionPosX.Evaluate(num);
			float num3 = ExtractionPosY.Evaluate(num);
			float num4 = ExtractionPosZ.Evaluate(num);
			float num5 = ExtractionRotX.Evaluate(num);
			float num6 = ExtractionRotY.Evaluate(num);
			float num7 = ExtractionRotZ.Evaluate(num);
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(num2, num3, num4);
			Quaternion val2 = Quaternion.Euler(num5, num6, num7);
			proxyInfo.Chamber.ProxyRound.position = proxyInfo.Parent.TransformPoint(val);
			proxyInfo.Chamber.ProxyRound.rotation = UnityEngineExtensions.TransformRotation(proxyInfo.Parent, val2);
		}

		private void ModifyProxyPositionChambering(ProxyInfo proxyInfo)
		{
			//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_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_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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: 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_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			float z = proxyInfo.Parent.InverseTransformPoint(BoltRoundChamberingStartPos.position).z;
			float z2 = proxyInfo.Parent.InverseTransformPoint(BoltRoundChamberingEndPos.position).z;
			float num = Mathf.InverseLerp(z, z2, proxyInfo.CurrentBoltZPosition);
			float num2 = ChamberingPosX.Evaluate(num);
			float num3 = ChamberingPosY.Evaluate(num);
			float num4 = ChamberingPosZ.Evaluate(num);
			float num5 = ChamberingRotX.Evaluate(num);
			float num6 = ChamberingRotY.Evaluate(num);
			float num7 = ChamberingRotZ.Evaluate(num);
			if (DoubleFeed && (Object)(object)FireArm.Magazine != (Object)null)
			{
				float num8 = Mathf.Sign(FireArm.Magazine.DisplayBullets[0].transform.localPosition.x);
				num2 *= num8;
				num6 *= num8;
			}
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(num2, num3, num4);
			Quaternion val2 = Quaternion.Euler(num5, num6, num7);
			proxyInfo.Proxy.ProxyRound.position = proxyInfo.Parent.TransformPoint(val);
			proxyInfo.Proxy.ProxyRound.rotation = UnityEngineExtensions.TransformRotation(proxyInfo.Parent, val2);
		}

		[ContextMenu("SetupDefaultProxyRoundCurves")]
		public void SetupDefaultProxyRoundCurves()
		{
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: 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_01b7: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: 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_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: 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_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: 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_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			Transform boltParent = BoltParent;
			FVRFireArm fireArm = FireArm;
			ClosedBoltWeapon val = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			FVRFireArmChamber val5;
			if (val == null)
			{
				Handgun val2 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val2 == null)
				{
					TubeFedShotgun val3 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val3 == null)
					{
						OpenBoltReceiver val4 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						val5 = ((val4 != null) ? val4.Chamber : ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).Chamber);
					}
					else
					{
						val5 = val3.Chamber;
					}
				}
				else
				{
					val5 = val2.Chamber;
				}
			}
			else
			{
				val5 = val.Chamber;
			}
			FVRFireArmChamber val6 = val5;
			fireArm = FireArm;
			ClosedBoltWeapon val7 = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			Transform val11;
			if (val7 == null)
			{
				Handgun val8 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val8 == null)
				{
					TubeFedShotgun val9 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val9 == null)
					{
						OpenBoltReceiver val10 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						val11 = ((val10 != null) ? val10.RoundPos_MagazinePos : ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).Extraction_MagazinePos);
					}
					else
					{
						val11 = val9.RoundPos_UpperPath_Forward;
					}
				}
				else
				{
					val11 = val8.RoundPos_Magazine;
				}
			}
			else
			{
				val11 = val7.RoundPos_MagazinePos;
			}
			Transform val12 = val11;
			fireArm = FireArm;
			ClosedBoltWeapon val13 = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null);
			if (val13 == null)
			{
				Handgun val14 = (Handgun)(object)((fireArm is Handgun) ? fireArm : null);
				if (val14 == null)
				{
					TubeFedShotgun val15 = (TubeFedShotgun)(object)((fireArm is TubeFedShotgun) ? fireArm : null);
					if (val15 == null)
					{
						OpenBoltReceiver val16 = (OpenBoltReceiver)(object)((fireArm is OpenBoltReceiver) ? fireArm : null);
						val11 = ((val16 != null) ? val16.RoundPos_Ejecting : ((BoltActionRifle)(((fireArm is BoltActionRifle) ? fireArm : null)?)).Extraction_Ejecting);
					}
					else
					{
						val11 = val15.RoundPos_Ejecting;
					}
				}
				else
				{
					val11 = val14.RoundPos_Ejecting;
				}
			}
			else
			{
				val11 = val13.RoundPos_Ejecting;
			}
			Transform val17 = val11;
			boltParent.InverseTransformPoint(val12.position);
			Quaternion val18 = UnityEngineExtensions.InverseTransformRotation(boltParent, val12.localRotation);
			Vector3 eulerAngles = ((Quaternion)(ref val18)).eulerAngles;
			if (eulerAngles.x > 180f)
			{
				eulerAngles.x -= 360f;
			}
			if (eulerAngles.y > 180f)
			{
				eulerAngles.y -= 360f;
			}
			if (eulerAngles.z > 180f)
			{
				eulerAngles.z -= 360f;
			}
			boltParent.InverseTransformPoint(((Component)val6).transform.position);
			val18 = UnityEngineExtensions.InverseTransformRotation(boltParent, ((Component)val6).transform.localRotation);
			Vector3 eulerAngles2 = ((Quaternion)(ref val18)).eulerAngles;
			if (eulerAngles2.x > 180f)
			{
				eulerAngles2.x -= 360f;
			}
			if (eulerAngles2.y > 180f)
			{
				eulerAngles2.y -= 360f;
			}
			if (eulerAngles2.z > 180f)
			{
				eulerAngles2.z -= 360f;
			}
			boltParent.InverseTransformPoint(val17.position);
			val18 = UnityEngineExtensions.InverseTransformRotation(boltParent, val17.localRotation);
			Vector3 eulerAngles3 = ((Quaternion)(ref val18)).eulerAngles;
			if (eulerAngles3.x > 180f)
			{
				eulerAngles3.x -= 360f;
			}
			if (eulerAngles3.y > 180f)
			{
				eulerAngles3.y -= 360f;
			}
			if (eulerAngles3.z > 180f)
			{
				eulerAngles3.z -= 360f;
			}
		}
	}
	public class MalorianSlapFlameThrower : MonoBehaviour
	{
		[Tooltip("The gun.")]
		public Handgun Malorian;

		[Tooltip("Point forward direction is slap direction reference. (Blue arrow!).")]
		public Transform SlapPointAndDirection;

		[Tooltip("Minimal distance between hand and slap point.")]
		public float SlapDistanceRequirement = 0.1f;

		[Tooltip("Alignment required between hand velocity vector and slap direction.")]
		public float SlapAlignmentRequirement = 0.3f;

		[Tooltip("Hand velocity required before slap is registered.")]
		public float SlapSpeedRequirement = 1f;

		[Tooltip("The actual flame thrower bit.")]
		public ParticleSystem FireParticleEmitter;

		[Tooltip("How many flames to fire (literally)")]
		public int NumberOfFlameParticlesPerShot;

		[Tooltip("Sounds to be played when roasting a choom.")]
		public AudioEvent FlameThrowerSounds;

		[Tooltip("Time in seconds you can't roast anyone.")]
		public float FlameThrowerRechargeTime = 1f;

		[Tooltip("This object turns on when you are ready to incinerate a choom.")]
		public GameObject FlameThrowerReadyIndicator;

		[Tooltip("This object turns on when you gotta wait for the next roast.")]
		public GameObject FlameThrowerChargingIndicator;

		[Tooltip("Flame has recoil? Whatever I guess!")]
		public FVRFireArmRecoilProfile FlameThrowerRecoilProfile;

		private bool _coolingDown;

		public void Awake()
		{
			GameObject flameThrowerReadyIndicator = FlameThrowerReadyIndicator;
			if (flameThrowerReadyIndicator != null)
			{
				flameThrowerReadyIndicator.SetActive(true);
			}
			GameObject flameThrowerChargingIndicator = FlameThrowerChargingIndicator;
			if (flameThrowerChargingIndicator != null)
			{
				flameThrowerChargingIndicator.SetActive(false);
			}
		}

		public void Update()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			if (((FVRInteractiveObject)Malorian).IsHeld && !_coolingDown)
			{
				FVRViveHand otherHand = ((FVRInteractiveObject)Malorian).m_hand.OtherHand;
				float num = Vector3.Distance(SlapPointAndDirection.position, ((HandInput)(ref otherHand.Input)).Pos);
				float num2 = Vector3.Dot(SlapPointAndDirection.forward, ((Vector3)(ref otherHand.Input.VelLinearWorld)).normalized);
				if (num < SlapDistanceRequirement && num2 > SlapAlignmentRequirement && ((Vector3)(ref otherHand.Input.VelLinearWorld)).magnitude > SlapSpeedRequirement)
				{
					FireParticleEmitter.Emit(NumberOfFlameParticlesPerShot);
					SM.PlayCoreSound((FVRPooledAudioType)0, FlameThrowerSounds, ((Component)this).transform.position).FollowThisTransform(((Component)FireParticleEmitter).transform);
					((FVRFireArm)Malorian).Recoil(((FVRFireArm)Malorian).IsTwoHandStabilized(), ((FVRFireArm)Malorian).IsForegripStabilized(), ((FVRFireArm)Malorian).IsShoulderStabilized(), FlameThrowerRecoilProfile, 1f);
					((FVRInteractiveObject)Malorian).m_hand.Buzz(((FVRInteractiveObject)Malorian).m_hand.Buzzer.Buzz_GunShot);
					((MonoBehaviour)this).StartCoroutine(CoolDownTimer());
				}
			}
		}

		private IEnumerator CoolDownTimer()
		{
			_coolingDown = true;
			GameObject flameThrowerReadyIndicator = FlameThrowerReadyIndicator;
			if (flameThrowerReadyIndicator != null)
			{
				flameThrowerReadyIndicator.SetActive(false);
			}
			GameObject flameThrowerChargingIndicator = FlameThrowerChargingIndicator;
			if (flameThrowerChargingIndicator != null)
			{
				flameThrowerChargingIndicator.SetActive(true);
			}
			for (float i = 0f; i < FlameThrowerRechargeTime; i += Time.deltaTime)
			{
				yield return null;
			}
			GameObject flameThrowerReadyIndicator2 = FlameThrowerReadyIndicator;
			if (flameThrowerReadyIndicator2 != null)
			{
				flameThrowerReadyIndicator2.SetActive(true);
			}
			GameObject flameThrowerChargingIndicator2 = FlameThrowerChargingIndicator;
			if (flameThrowerChargingIndicator2 != null)
			{
				flameThrowerChargingIndicator2.SetActive(false);
			}
			_coolingDown = false;
		}
	}
	[BepInPlugin("h3vr.cityrobo.MalorianCode", "Malorian Code", "1.0.0")]
	public class MalorianCode : BaseUnityPlugin
	{
	}
}

MD_F4E_Fighter.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using H3VRUtils.MonoScripts.VisualModifiers;
using HarmonyLib;
using OtherLoader;
using Sodalite.Api;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;
using UnityEngine.Windows.Speech;

[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 GunShipLeave : MonoBehaviour
	{
		public GameObject planeprop;

		private void Start()
		{
		}

		private void Update()
		{
		}

		private void OnDestroy()
		{
			//IL_000d: 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)
			Object.Instantiate<GameObject>(planeprop, ((Component)this).transform.position, ((Component)this).transform.rotation);
		}
	}
	public class GunShipScript : MonoBehaviour
	{
		public GameObject marker;

		public Transform markerholder;

		public GameObject markerswitch;

		public GameObject dots;

		public GameObject penref1;

		public GameObject penref2;

		public GameObject penref3;

		public GameObject pengeoonpaper1;

		public GameObject pengeoonpaper2;

		public GameObject pengeoonpaper3;

		public GameObject parentfordots;

		public float X = 30f;

		public float Y = 30f;

		public Camera cam;

		public GameObject fovSwitch;

		public KillAfter k1;

		public KillAfter k2;

		public KillAfter k3;

		public KillAfter k4;

		public KillAfter k5;

		public KillAfter k6;

		public Transform parent;

		public OpenBoltReceiver g_40mmCannon;

		public OpenBoltReceiver g_105mmCannon;

		public JoyStickJetSuit jsjs;

		public GameObject g_40mmRot;

		public GameObject g_105mmRot;

		public GameObject c_CameraRot;

		public GameObject laser;

		public GameObject shutdown;

		public Transform sitpos;

		public bool backtoplyer = false;

		public GameObject gunSwitch;

		public Vector3 vel = Vector3.zero;

		private void Start()
		{
			((Component)GM.CurrentMovementManager).transform.SetParent(parent);
		}

		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_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: 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_0060: 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_00b3: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_0119: 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_06d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: 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_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_070b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0710: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0761: Unknown result type (might be due to invalid IL or missing references)
			//IL_0780: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_056b: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_060c: Unknown result type (might be due to invalid IL or missing references)
			//IL_061c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0930: Unknown result type (might be due to invalid IL or missing references)
			//IL_0935: Unknown result type (might be due to invalid IL or missing references)
			//IL_0956: Unknown result type (might be due to invalid IL or missing references)
			//IL_095b: Unknown result type (might be due to invalid IL or missing references)
			if (shutdown.transform.localEulerAngles.x > 45f)
			{
				if (!backtoplyer)
				{
					marker.transform.SetParent(markerholder);
					marker.transform.localPosition = new Vector3(0f, 0f, 0f);
					marker.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					((Component)GM.CurrentMovementManager).transform.SetParent((Transform)null);
					((Component)GM.CurrentMovementManager).transform.position = new Vector3(((Component)this).gameObject.transform.position.x, ((Component)this).gameObject.transform.position.y, ((Component)this).gameObject.transform.position.z);
					((Component)GM.CurrentMovementManager).transform.eulerAngles = new Vector3(0f, ((Component)this).gameObject.transform.localEulerAngles.y, 0f);
					backtoplyer = true;
					((Behaviour)k1).enabled = true;
					((Behaviour)k2).enabled = true;
					((Behaviour)k3).enabled = true;
					((Behaviour)k4).enabled = true;
					((Behaviour)k5).enabled = true;
					((Behaviour)k6).enabled = true;
				}
			}
			else
			{
				if (!(shutdown.transform.localEulerAngles.x < 45f))
				{
					return;
				}
				if (markerswitch.transform.localEulerAngles.x > 45f)
				{
					marker.transform.SetParent(((Component)GM.CurrentMovementManager.RightHand).transform);
					marker.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					marker.transform.localPosition = new Vector3(0f, 0f, 0f);
					penref1.transform.position = ((Component)GM.CurrentMovementManager.RightHand).transform.position;
					penref2.transform.position = ((Component)GM.CurrentMovementManager.RightHand).transform.position;
					penref3.transform.position = ((Component)GM.CurrentMovementManager.RightHand).transform.position;
					penref1.transform.localPosition = new Vector3(Mathf.Clamp(penref1.transform.localPosition.x, -0.25f, 0.25f), Mathf.Clamp(penref1.transform.localPosition.y, -0.15f, 0.15f), 0f);
					penref2.transform.localPosition = new Vector3(Mathf.Clamp(penref2.transform.localPosition.x, -0.25f, 0.25f), Mathf.Clamp(penref2.transform.localPosition.y, -0.15f, 0.15f), 0f);
					penref3.transform.localPosition = new Vector3(Mathf.Clamp(penref3.transform.localPosition.x, -0.2f, 0.2f), Mathf.Clamp(penref3.transform.localPosition.y, -0.1f, 0.1f), 0f);
					if (GM.CurrentMovementManager.Hands[1].Input.TriggerPressed)
					{
						if (Vector3.Distance(((Component)GM.CurrentMovementManager.RightHand).transform.position, penref1.transform.position) < 0.05f)
						{
							marker.SetActive(false);
							pengeoonpaper1.SetActive(true);
							Object.Instantiate<GameObject>(dots, penref1.transform.position, penref1.transform.rotation, parentfordots.transform);
						}
						else if (Vector3.Distance(((Component)GM.CurrentMovementManager.RightHand).transform.position, penref2.transform.position) < 0.05f)
						{
							marker.SetActive(false);
							pengeoonpaper2.SetActive(true);
							Object.Instantiate<GameObject>(dots, penref2.transform.position, penref2.transform.rotation, parentfordots.transform);
						}
						else if (Vector3.Distance(((Component)GM.CurrentMovementManager.RightHand).transform.position, penref3.transform.position) < 0.05f)
						{
							marker.SetActive(false);
							pengeoonpaper3.SetActive(true);
							Object.Instantiate<GameObject>(dots, penref3.transform.position, penref3.transform.rotation, parentfordots.transform);
						}
						else if (Vector3.Distance(((Component)GM.CurrentMovementManager.RightHand).transform.position, penref1.transform.position) > 0.05f && Vector3.Distance(((Component)GM.CurrentMovementManager.RightHand).transform.position, penref2.transform.position) > 0.05f && Vector3.Distance(((Component)GM.CurrentMovementManager.RightHand).transform.position, penref3.transform.position) > 0.05f)
						{
							marker.SetActive(true);
							pengeoonpaper1.SetActive(false);
							pengeoonpaper2.SetActive(false);
							pengeoonpaper3.SetActive(false);
						}
					}
					else
					{
						marker.SetActive(true);
						pengeoonpaper1.SetActive(false);
						pengeoonpaper2.SetActive(false);
						pengeoonpaper3.SetActive(false);
					}
				}
				else
				{
					marker.transform.SetParent(markerholder);
					marker.transform.localPosition = new Vector3(0f, 0f, 0f);
					marker.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
				if (fovSwitch.transform.localEulerAngles.x < 45f)
				{
					cam.fieldOfView = 60f;
				}
				else
				{
					cam.fieldOfView = 15f;
				}
				((Component)GM.CurrentMovementManager).transform.position = ((Component)sitpos).transform.position;
				((Component)GM.CurrentMovementManager).transform.eulerAngles = ((Component)sitpos).transform.eulerAngles;
				if (!((Object)(object)((FVRInteractiveObject)jsjs).m_hand != (Object)null))
				{
					return;
				}
				if (((FVRInteractiveObject)jsjs).m_hand.Input.TriggerPressed)
				{
					if (gunSwitch.transform.localEulerAngles.x > 45f)
					{
						g_105mmCannon.ReleaseSeer();
					}
					else
					{
						g_40mmCannon.ReleaseSeer();
					}
				}
				else
				{
					g_40mmCannon.EngageSeer();
					g_105mmCannon.EngageSeer();
				}
				X -= 5f * jsjs.num1 * Time.deltaTime;
				Y -= 5f * jsjs.num2 * Time.deltaTime;
				if (X > 60f)
				{
					X = 60f;
				}
				else if (X < 0f)
				{
					X = 0f;
				}
				if (Y > 60f)
				{
					Y = 60f;
				}
				else if (Y < 0f)
				{
					Y = 0f;
				}
				c_CameraRot.transform.localEulerAngles = new Vector3(X, Y, 0f);
				if (laser.activeInHierarchy)
				{
					AxisLookAt(g_40mmRot.transform, laser.transform.position, Vector3.forward);
					AxisLookAt(g_105mmRot.transform, laser.transform.position, Vector3.forward);
				}
			}
		}

		private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis)
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_0061: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = tr_self.rotation;
			Vector3 val = lookPos - tr_self.position;
			Vector3 val2 = tr_self.rotation * directionAxis;
			Vector3 val3 = Vector3.Cross(val2, val);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num = Vector3.Angle(val2, val);
			tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation;
			tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f);
		}
	}
	public class GunshipActivate : MonoBehaviour
	{
		public GameObject switchAct;

		public GameObject AC;

		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_0034: 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 (switchAct.transform.localEulerAngles.x > 45f)
			{
				Object.Instantiate<GameObject>(AC, ((Component)GM.CurrentMovementManager).transform.position, ((Component)GM.CurrentMovementManager).transform.rotation);
				Object.Destroy((Object)(object)this);
			}
		}

		private void OnDestroy()
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class GSCamera : GSCameraAux
{
}
[RequireComponent(typeof(WheelCollider))]
public class GSWheelAux : GLandingGear
{
}
public class GSurfaceCenter : GCenter
{
}
public class GSurfaceDrive : GDrive
{
}
[RequireComponent(typeof(Rigidbody))]
public class GSurfaceManager : GAircraft
{
}
public class GSurfacePivot : GPivot
{
}
public class GSurfaceTrail : GTrail
{
}
public class GSurfaceWindZone : GWindBasic
{
}
public class GSAreaHeight : MonoBehaviour
{
	private float baseHeight = 0f;

	public float coefHeight = 0.01f;

	public GameObject viewer = null;

	private Vector3 position = Vector3.zero;

	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)
		baseHeight = ((Component)this).gameObject.transform.position.y;
	}

	private void Update()
	{
		//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_0034: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)viewer != (Object)null)
		{
			position = ((Component)this).gameObject.transform.position;
			if (viewer.transform.position.y > baseHeight)
			{
				position.y = baseHeight + (viewer.transform.position.y - baseHeight) * coefHeight;
			}
			else
			{
				position.y = baseHeight;
			}
			((Component)this).gameObject.transform.position = position;
		}
	}
}
public class GSCameraAux : MonoBehaviour
{
	private GAircraft sm = null;

	public Camera attachToCamera = null;

	private GUITexture crossair = null;

	public Light sunlight = null;

	public bool sunlightAttach = true;

	public float sunlightAttachDistance = 100f;

	public float sunlightAttachFilter = 0.01f;

	public float inputHorizontalMouseSensivity = 3.4f;

	public float inputVerticalMouseSensivity = 2.1f;

	public float inputWheelMouseSensivity = 2.1f;

	public KeyCode inputExternalCameraKeyForToggle = (KeyCode)99;

	private bool inputExternalCameraKeyForToggled = false;

	private int currentCameraPosition = 0;

	private int countCameraPositions = 0;

	public KeyCode inputFixedPositionCameraKeyForToggle = (KeyCode)118;

	private bool inputFixedPositionCameraKeyForToggled = false;

	public bool enableRecoverVehicle = true;

	public bool enableRecoverVehicleReset = false;

	public Vector3 enableRecoverVehiclePosition = Vector3.zero;

	public Vector3 enableRecoverVehicleRotation = Vector3.zero;

	public KeyCode inputRecoverVehicleKeyForToggle = (KeyCode)111;

	private bool inputRecoverVehicleKeyForToggled = false;

	private bool cameraFixedPositionEnabled = false;

	private bool cameraExternalEnabled_lastValue = true;

	private bool cameraOnFixedUpdate = true;

	private int cameraOnFixedUpdate_count = 0;

	public GameObject cameraAlternateFollow = null;

	public bool globalSimulationScaleApplyToCamera = true;

	private float globalSimulationScale = 1f;

	public float cameraExternalMinHeight = -93f;

	public bool cameraExternalMinHeightAutoProbe = true;

	public LayerMask cameraExternalMinHeightAutoProbeLayermask = LayerMask.op_Implicit(-24);

	private float cameraExternalMinHeightScale = 1f;

	public float cameraExternalMinHeightAutoProbeDelta = 5f;

	public float cameraExternalMinHeightAutoProbeDeltaProbe = 1000f;

	public bool cameraExternalEnabled = false;

	public float cameraExternalNearClipPlane = 2f;

	public float cameraExternalFarClipPlane = 8000f;

	public float cameraExternalFilter = 0.1f;

	private float cameraExternalDistance = 2f;

	public float cameraExternalDistanceMin = 0.4f;

	public float cameraExternalDistanceMax = 101f;

	public float cameraExternalDistanceStep = 1.25f;

	public bool cameraExternalUpWorld = true;

	public float cameraInternalSensivity = 1.35f;

	public float cameraInternalNearClipPlane = 0.175f;

	public float cameraInternalFarClipPlane = 5000f;

	public float cameraInternalFilter = 1f;

	private float cameraInternalFov = 60f;

	public float cameraInternalFovMin = 15f;

	public float cameraInternalFovMax = 110f;

	public float cameraInternalFovStep = 15f;

	public bool cameraInternalUpWorld = false;

	public bool cameraInternalUpWorldMix = true;

	public float cameraInternalUpWorldMixing = 0.5f;

	public bool cameraInternalDontVertical = false;

	public bool cameraInternalDontVerticalMix = true;

	public float cameraInternalDontVerticalMixing = 0.5f;

	public float cameraInternalGsMixing = 0.05f;

	public float cameraInternalGsMax = 0.7f;

	public bool cameraInternalGsPosition = true;

	public float cameraInternalGsPositionDelta = 0.075f;

	public float cameraInternalGsPositionHDelta = 0.1f;

	public bool cameraInternalGsRotation = true;

	public float cameraInternalGsRotationDelta = 0.2f;

	public bool enableSpecialForce = true;

	public float specialForceMagnitude = 10000f;

	public KeyCode specialForceApplyZeroRotate = (KeyCode)117;

	public KeyCode specialForceApplyLeft = (KeyCode)106;

	public KeyCode specialForceApplyRight = (KeyCode)108;

	public KeyCode specialForceApplyForward = (KeyCode)105;

	public KeyCode specialForceApplyForceBack = (KeyCode)107;

	public KeyCode specialForceApplyForceUp = (KeyCode)121;

	public KeyCode specialForceApplyDown = (KeyCode)104;

	public bool fogRenderingEnabled = false;

	private FogMode initialFogMode = (FogMode)1;

	private float initialFogValue = 0f;

	public float fog01 = 0f;

	public float extremeFogValue = -1f;

	public bool skyboxRenderingEnabled = false;

	private Color skyboxRenderingColor;

	private Color skyboxRenderingColorTop;

	public float skyboxRenderingColorTopDeltaHeight = 10000f;

	public float skyboxRenderingColorUpwardsScatteringDistance = 30000f;

	public float skyboxRenderingColorDownwardsScatteringDistance = 3000000f;

	public bool skyboxRenderingColor0Enabled = false;

	public Color skyboxRenderingColor0 = skyboxRenderingColor0Default;

	public float skyboxRenderingColor0Height = 0f;

	public float skyboxRenderingColor0Distance = 1000f;

	public Color skyboxRenderingColor1 = skyboxRenderingColor1Default;

	public float skyboxRenderingColor1Height = 1500f;

	public Color skyboxRenderingColor2 = skyboxRenderingColor2Default;

	public float skyboxRenderingColor2Height = 15000f;

	public Color skyboxRenderingColor3 = skyboxRenderingColor3Default;

	public float skyboxRenderingColor3Height = 45000f;

	[NonSerialized]
	public int skyboxAngleColors;

	[NonSerialized]
	public Color32[] skyboxAngleColor = null;

	[NonSerialized]
	public int[,] skyboxSideAngles;

	[NonSerialized]
	public int[,] skyboxTopAngles;

	[NonSerialized]
	public int[,] skyboxBottomAngles;

	private Color tmp_skyboxRenderingColorm1;

	private Color tmp_skyboxRenderingColor0;

	private Color tmp_skyboxRenderingColor1;

	private Color tmp_skyboxRenderingColor2;

	private Color tmp_skyboxRenderingColor3;

	private Color tmp_skyboxRenderingColor4;

	public int skyboxTextureWidth = 64;

	public int skyboxTextureHeight = 64;

	public int skyboxRenderNth = 5;

	public int skyboxRenderSidesPerNth = 2;

	private int skyboxRenderNth_count = 0;

	private int skyboxRenderNth_tex = 0;

	private Skybox skyboxComponent = null;

	private Material skyboxMaterial = null;

	private Texture2D _FrontTex = null;

	private Texture2D _LeftTex = null;

	private Texture2D _RightTex = null;

	private Texture2D _BackTex = null;

	private Texture2D _UpTex = null;

	private Texture2D _DownTex = null;

	[NonSerialized]
	private Color32[] pixels = null;

	public bool searchSounds = true;

	[HideInInspector]
	public GUIText speedmeter;

	[HideInInspector]
	public GUIText autopilotmeter;

	[HideInInspector]
	public GameObject scene;

	[HideInInspector]
	public GameObject ground;

	[HideInInspector]
	public GameObject clouds;

	private AudioSource[] soundmin = null;

	private string soundmin_pivotId = "";

	private float soundmin_pivotScale = 1f;

	private float soundmin_pitchBase = 1f;

	private float soundmin_pitchScale = 1f;

	private int soundmin_count;

	private int soundmin_countmax = 10;

	private AudioSource[] soundmax = null;

	private string soundmax_pivotId = "";

	private float soundmax_pivotScale = 1f;

	private float soundmax_pitchBase = 0.1f;

	private float soundmax_pitchScale = 1f;

	private int soundmax_count;

	private int soundmax_countmax = 10;

	private AudioSource[] soundstall = null;

	private int soundstall_count;

	private int soundstall_countmax = 10;

	private bool iscrashed = false;

	private AudioSource[] soundcrash = null;

	private int soundcrash_count;

	private int soundcrash_countmax = 10;

	public string searchScreenCursorObjectName = "Screen cursor";

	public string searchScreenSpeedMeterObjectName = "Screen speed meter";

	public string searchScreenAutopilotMeterObjectName = "Screen autopilot meter";

	public string searchSceneObjectName = "Scene";

	public float searchSceneObjectGranularity = 1500f;

	public string searchGroundObjectName = "Scene ground";

	public float searchGroundObjectGranularity = 150f;

	public string searchCloudsObjectName = "Scene clouds";

	public float searchCloudsObjectGranularity = 1500f;

	public float searchCloudsWindSpeedMultiplier = 5f;

	private Vector3 worldup = Vector3.up;

	private Vector3 cameraposition = Vector3.zero;

	private Quaternion cameraorientation = Quaternion.identity;

	private bool camerafixed = false;

	private Vector3 cameralookat = Vector3.zero;

	private Vector3 cameraup = Vector3.up;

	private Vector3 cameraposition_filtered = Vector3.zero;

	private Vector3 cameralookat_filtered = Vector3.zero;

	private Vector3 cameraup_filtered = Vector3.up;

	private float camera_filter = 0.01f;

	private int scheduleRecoverVehicle = 0;

	private float gs_old = 0f;

	private float hgs_old = 0f;

	private float ProcessSounds_granularityPitch = 0.01f;

	private float ProcessSounds_granularityTime = 0.25f;

	private float ProcessSounds_granularityTime2 = 5.25f;

	private float ProcessSounds_granularityTimeRemaining = 0f;

	private float ProcessSounds_granularityTime2Remaining = 0f;

	public static Color skyboxRenderingColor0Default => new Color(0.41015625f, 0.41015625f, 0.41015625f, 1f);

	public static Color skyboxRenderingColor1Default => new Color(0.48828125f, 0.68359375f, 0.99609375f, 1f);

	public static Color skyboxRenderingColor2Default => new Color(0.19140625f, 0.30078125f, 0.47265625f, 1f);

	public static Color skyboxRenderingColor3Default => new Color(0f, 0f, 0f, 1f);

	public bool recoverVehicle()
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: 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_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_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: 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_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_015e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)sm != (Object)null)
		{
			sm.isCrashed = false;
			if (enableRecoverVehicleReset)
			{
				sm.placeAt(enableRecoverVehiclePosition, enableRecoverVehicleRotation, applySpeed: true, 0f * sm.globalSimulationScale, applyThrottle: true, 0f);
			}
			else if (Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303))
			{
				sm.placeAt(((Component)this).gameObject.transform.position + new Vector3(0f, 500f * sm.globalSimulationScale, 0f), new Vector3(-30f, ((Component)this).gameObject.transform.eulerAngles.y, 0f), 100f * sm.globalSimulationScale);
			}
			else
			{
				sm.placeAt(((Component)this).gameObject.transform.position + new Vector3(0f, 50f * sm.globalSimulationScale, 0f), new Vector3(-30f, ((Component)this).gameObject.transform.eulerAngles.y, 0f), 100f * sm.globalSimulationScale);
			}
			sm.ignore_check_simulation_broken();
		}
		return true;
	}

	private void FindNodes(GameObject e, int r)
	{
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Expected O, but got Unknown
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Expected O, but got Unknown
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: Expected O, but got Unknown
		//IL_039e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a4: Expected O, but got Unknown
		for (int i = 0; i < e.transform.childCount; i++)
		{
			GameObject gameObject = ((Component)e.transform.GetChild(i)).gameObject;
			if (!gameObject.activeSelf)
			{
				continue;
			}
			if (searchSounds)
			{
				if (((Object)gameObject).name.Contains("_soundmin_") && soundmin_count < soundmin_countmax)
				{
					soundmin[soundmin_count] = (AudioSource)gameObject.GetComponent("AudioSource");
					if ((Object)(object)soundmin[soundmin_count] != (Object)null)
					{
						soundmin[soundmin_count].loop = true;
						soundmin[soundmin_count].volume = 0f;
						soundmin_pivotId = GAircraft.ReplaceStringIgnoreCase(((Object)gameObject).name, "pivotId", soundmin_pivotId);
						soundmin_pivotScale = GAircraft.ReplaceFloatIgnoreCase(((Object)gameObject).name, "pivotScale", soundmin_pivotScale);
						soundmin_pitchBase = GAircraft.ReplaceFloatIgnoreCase(((Object)gameObject).name, "pitchBase", soundmin_pitchBase);
						soundmin_pitchScale = GAircraft.ReplaceFloatIgnoreCase(((Object)gameObject).name, "pitchScale", soundmin_pitchScale);
						soundmin[soundmin_count].Play((ulong)Mathf.FloorToInt((float)soundmin_count * 1.7f * 44100f));
						soundmin_count++;
					}
				}
				if (((Object)gameObject).name.Contains("_soundmax_") && soundmax_count < soundmax_countmax)
				{
					soundmax[soundmax_count] = (AudioSource)gameObject.GetComponent("AudioSource");
					if ((Object)(object)soundmax[soundmax_count] != (Object)null)
					{
						soundmax[soundmax_count].loop = true;
						soundmax[soundmax_count].volume = 0f;
						soundmax_pivotId = GAircraft.ReplaceStringIgnoreCase(((Object)gameObject).name, "pivotId", soundmax_pivotId);
						soundmax_pivotScale = GAircraft.ReplaceFloatIgnoreCase(((Object)gameObject).name, "pivotScale", soundmax_pivotScale);
						soundmax_pitchBase = GAircraft.ReplaceFloatIgnoreCase(((Object)gameObject).name, "pitchBase", soundmax_pitchBase);
						soundmax_pitchScale = GAircraft.ReplaceFloatIgnoreCase(((Object)gameObject).name, "pitchScale", soundmax_pitchScale);
						soundmax[soundmax_count].Play((ulong)Mathf.FloorToInt((float)soundmax_count * 1.9f * 44100f));
						soundmax_count++;
					}
				}
				if (((Object)gameObject).name.Contains("_soundstall_") && soundstall_count < soundstall_countmax)
				{
					soundstall[soundstall_count] = (AudioSource)gameObject.GetComponent("AudioSource");
					if ((Object)(object)soundstall[soundstall_count] != (Object)null)
					{
						soundstall[soundstall_count].loop = true;
						soundstall[soundstall_count].volume = 0f;
						soundstall[soundstall_count].Play((ulong)Mathf.FloorToInt((float)soundstall_count * 1.9f * 44100f));
						soundstall_count++;
					}
				}
				if (((Object)gameObject).name.Contains("_soundcrash_") && soundcrash_count < soundcrash_countmax)
				{
					soundcrash[soundcrash_count] = (AudioSource)gameObject.GetComponent("AudioSource");
					if ((Object)(object)soundcrash[soundcrash_count] != (Object)null)
					{
						soundcrash[soundcrash_count].loop = false;
						soundcrash[soundcrash_count].volume = 0f;
						soundcrash_count++;
					}
				}
			}
			if (r < 10)
			{
				FindNodes(gameObject, r + 1);
			}
		}
	}

	private void Skybox_Start()
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Expected O, but got Unknown
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Expected O, but got Unknown
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Expected O, but got Unknown
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Expected O, but got Unknown
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Expected O, but got Unknown
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Expected O, but got Unknown
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Expected O, but got Unknown
		//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Expected O, but got Unknown
		//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ee: Expected O, but got Unknown
		if ((Object)(object)skyboxComponent == (Object)null)
		{
			skyboxComponent = (Skybox)((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).gameObject.GetComponent("Skybox");
		}
		if ((Object)(object)skyboxComponent == (Object)null)
		{
			((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).gameObject.AddComponent<Skybox>();
		}
		if ((Object)(object)skyboxComponent == (Object)null)
		{
			skyboxComponent = (Skybox)((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).gameObject.GetComponent("Skybox");
		}
		if (!((Object)(object)skyboxComponent != (Object)null))
		{
			return;
		}
		if ((Object)(object)skyboxMaterial == (Object)null)
		{
			skyboxMaterial = new Material(Shader.Find("RenderFX/Skybox"));
		}
		if ((Object)(object)skyboxMaterial != (Object)null)
		{
			int num = skyboxTextureWidth;
			int num2 = skyboxTextureHeight;
			if ((Object)(object)_FrontTex == (Object)null)
			{
				_FrontTex = new Texture2D(num, num2, (TextureFormat)5, false);
			}
			if ((Object)(object)_LeftTex == (Object)null)
			{
				_LeftTex = new Texture2D(num, num2, (TextureFormat)5, false);
			}
			if ((Object)(object)_RightTex == (Object)null)
			{
				_RightTex = new Texture2D(num, num2, (TextureFormat)5, false);
			}
			if ((Object)(object)_BackTex == (Object)null)
			{
				_BackTex = new Texture2D(num, num2, (TextureFormat)5, false);
			}
			if ((Object)(object)_UpTex == (Object)null)
			{
				_UpTex = new Texture2D(num, num2, (TextureFormat)5, false);
			}
			if ((Object)(object)_DownTex == (Object)null)
			{
				_DownTex = new Texture2D(num, num2, (TextureFormat)5, false);
			}
			((Texture)_FrontTex).wrapMode = (TextureWrapMode)1;
			((Texture)_LeftTex).wrapMode = (TextureWrapMode)1;
			((Texture)_RightTex).wrapMode = (TextureWrapMode)1;
			((Texture)_BackTex).wrapMode = (TextureWrapMode)1;
			((Texture)_UpTex).wrapMode = (TextureWrapMode)1;
			((Texture)_DownTex).wrapMode = (TextureWrapMode)1;
			skyboxMaterial.SetTexture("_FrontTex", (Texture)(object)_FrontTex);
			skyboxMaterial.SetTexture("_LeftTex", (Texture)(object)_LeftTex);
			skyboxMaterial.SetTexture("_RightTex", (Texture)(object)_RightTex);
			skyboxMaterial.SetTexture("_BackTex", (Texture)(object)_BackTex);
			skyboxMaterial.SetTexture("_UpTex", (Texture)(object)_UpTex);
			skyboxMaterial.SetTexture("_DownTex", (Texture)(object)_DownTex);
			if (pixels == null)
			{
				pixels = (Color32[])(object)new Color32[num * num2];
			}
			skyboxAngleColors = Mathf.FloorToInt(Mathf.Sqrt((float)(num * num + num2 * num2)) + (float)Mathf.Max(num, num2)) * 4 + 1;
			if (skyboxAngleColor == null)
			{
				skyboxAngleColor = (Color32[])(object)new Color32[skyboxAngleColors];
			}
			if (skyboxTopAngles == null)
			{
				skyboxTopAngles = new int[num, num2];
			}
			if (skyboxSideAngles == null)
			{
				skyboxSideAngles = new int[num, num2];
			}
			if (skyboxBottomAngles == null)
			{
				skyboxBottomAngles = new int[num, num2];
			}
			float num3 = 0f;
			float num4 = 0f;
			float num5 = 0f;
			for (int i = 0; i < num; i++)
			{
				for (int j = 0; j < num2; j++)
				{
					float num6 = ((float)i - (float)num / 2f) * 2f / (float)num;
					float num7 = ((float)j - (float)num2 / 2f) * 2f / (float)num2;
					pixels[i + j * num].a = byte.MaxValue;
					num3 = Mathf.Atan(1f / Mathf.Sqrt(num6 * num6 + num7 * num7));
					skyboxTopAngles[i, j] = Mathf.RoundToInt((float)skyboxAngleColors * ((num3 + (float)Math.PI / 2f) / (float)Math.PI));
					if (skyboxTopAngles[i, j] < 0)
					{
						skyboxTopAngles[i, j] = 0;
					}
					if (skyboxTopAngles[i, j] >= skyboxAngleColors)
					{
						skyboxTopAngles[i, j] = skyboxAngleColors - 1;
					}
					num4 = Mathf.Atan(num7 / Mathf.Sqrt(1f + num6 * num6));
					skyboxSideAngles[i, j] = Mathf.RoundToInt((float)skyboxAngleColors * ((num4 + (float)Math.PI / 2f) / (float)Math.PI));
					if (skyboxSideAngles[i, j] < 0)
					{
						skyboxSideAngles[i, j] = 0;
					}
					if (skyboxSideAngles[i, j] >= skyboxAngleColors)
					{
						skyboxSideAngles[i, j] = skyboxAngleColors - 1;
					}
					num5 = Mathf.Atan(-1f / Mathf.Sqrt(num6 * num6 + num7 * num7));
					skyboxBottomAngles[i, j] = Mathf.RoundToInt((float)skyboxAngleColors * ((num5 + (float)Math.PI / 2f) / (float)Math.PI));
					if (skyboxBottomAngles[i, j] < 0)
					{
						skyboxBottomAngles[i, j] = 0;
					}
					if (skyboxBottomAngles[i, j] >= skyboxAngleColors)
					{
						skyboxBottomAngles[i, j] = skyboxAngleColors - 1;
					}
				}
			}
		}
		else
		{
			Debug.Log((object)"Failed to create material from shader RenderFX/Skybox");
		}
		skyboxComponent.material = skyboxMaterial;
	}

	private void Start()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Expected O, but got Unknown
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Expected O, but got Unknown
		//IL_01b4: 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_01bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Invalid comparison between Unknown and I4
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: 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_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Invalid comparison between Unknown and I4
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d5: Invalid comparison between Unknown and I4
		if ((Object)(object)GameObject.Find(searchScreenCursorObjectName) != (Object)null)
		{
			crossair = (GUITexture)GameObject.Find(searchScreenCursorObjectName).GetComponent("GUITexture");
		}
		if ((Object)(object)GameObject.Find(searchScreenSpeedMeterObjectName) != (Object)null)
		{
			speedmeter = (GUIText)GameObject.Find(searchScreenSpeedMeterObjectName).GetComponent("GUIText");
		}
		if ((Object)(object)GameObject.Find(searchScreenAutopilotMeterObjectName) != (Object)null)
		{
			autopilotmeter = (GUIText)GameObject.Find(searchScreenAutopilotMeterObjectName).GetComponent("GUIText");
		}
		scene = GameObject.Find(searchSceneObjectName);
		ground = GameObject.Find(searchGroundObjectName);
		clouds = GameObject.Find(searchCloudsObjectName);
		cameraExternalEnabled_lastValue = !cameraExternalEnabled;
		if (searchSounds)
		{
			soundmin = (AudioSource[])(object)new AudioSource[soundmin_countmax];
			soundmax = (AudioSource[])(object)new AudioSource[soundmax_countmax];
			soundstall = (AudioSource[])(object)new AudioSource[soundstall_countmax];
			soundcrash = (AudioSource[])(object)new AudioSource[soundcrash_countmax];
			soundmin_count = 0;
			soundmax_count = 0;
			soundstall_count = 0;
			soundcrash_count = 0;
		}
		FindNodes(((Component)this).gameObject, 0);
		sm = (GAircraft)(object)((Component)this).gameObject.GetComponent("GAircraft");
		if (enableRecoverVehicle)
		{
			enableRecoverVehiclePosition = ((Component)sm).transform.position;
			enableRecoverVehicleRotation = ((Component)sm).transform.eulerAngles;
		}
		initialFogMode = RenderSettings.fogMode;
		FogMode val = initialFogMode;
		if ((int)val != 1)
		{
			if ((int)val == 2 || (int)val == 3)
			{
				initialFogValue = RenderSettings.fogDensity;
			}
		}
		else
		{
			initialFogValue = RenderSettings.fogEndDistance;
		}
		if (extremeFogValue < 0f)
		{
			extremeFogValue = initialFogValue;
		}
	}

	private void Update()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		if (globalSimulationScaleApplyToCamera && (Object)(object)sm != (Object)null)
		{
			globalSimulationScale = sm.globalSimulationScale;
		}
		if (Input.GetKeyUp(inputExternalCameraKeyForToggle))
		{
			inputExternalCameraKeyForToggled = true;
		}
		if (Input.GetKeyUp(inputFixedPositionCameraKeyForToggle))
		{
			inputFixedPositionCameraKeyForToggled = true;
		}
		if (Input.GetKeyUp(inputRecoverVehicleKeyForToggle))
		{
			inputRecoverVehicleKeyForToggled = true;
		}
		ProcessSkybox();
		if (GAircraft.isSimulationPaused)
		{
			ProcessSounds(Time.deltaTime);
		}
		else if (!cameraOnFixedUpdate)
		{
			ProcessCamera(Time.deltaTime);
		}
	}

	private void FixedUpdate()
	{
		if (globalSimulationScaleApplyToCamera && (Object)(object)sm != (Object)null)
		{
			globalSimulationScale = sm.globalSimulationScale;
		}
		if (!GAircraft.isSimulationPaused && cameraOnFixedUpdate)
		{
			ProcessCamera(Time.fixedDeltaTime);
		}
	}

	private bool getSkyboxRenderingColor(float height, bool renderSpace, out Color output)
	{
		//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_002f: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: 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_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_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		if (height < skyboxRenderingColor1Height)
		{
			output = skyboxRenderingColor1;
		}
		else if (height < skyboxRenderingColor2Height)
		{
			output = skyboxRenderingColor1 * (skyboxRenderingColor2Height - height) / (skyboxRenderingColor2Height - skyboxRenderingColor1Height) + skyboxRenderingColor2 * (height - skyboxRenderingColor1Height) / (skyboxRenderingColor2Height - skyboxRenderingColor1Height);
		}
		else if (renderSpace)
		{
			if (height < skyboxRenderingColor3Height)
			{
				output = skyboxRenderingColor2 * (skyboxRenderingColor3Height - height) / (skyboxRenderingColor3Height - skyboxRenderingColor2Height) + skyboxRenderingColor3 * (height - skyboxRenderingColor2Height) / (skyboxRenderingColor3Height - skyboxRenderingColor2Height);
			}
			else
			{
				output = skyboxRenderingColor3;
			}
		}
		else
		{
			output = skyboxRenderingColor2;
		}
		return true;
	}

	private bool PreProcessSkyboxTexture(float height)
	{
		//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_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_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_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_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: 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_0079: 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_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0768: Unknown result type (might be due to invalid IL or missing references)
		//IL_076d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0772: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_0338: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a90: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a95: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a9a: Unknown result type (might be due to invalid IL or missing references)
		//IL_071c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0721: Unknown result type (might be due to invalid IL or missing references)
		//IL_0726: Unknown result type (might be due to invalid IL or missing references)
		float num = 0f;
		int num2 = 0;
		float num3 = 0f;
		if (skyboxRenderingColor0Enabled)
		{
			tmp_skyboxRenderingColorm1 = skyboxRenderingColor0;
		}
		tmp_skyboxRenderingColor0 = skyboxRenderingColor;
		tmp_skyboxRenderingColor1 = skyboxRenderingColor1;
		tmp_skyboxRenderingColor2 = skyboxRenderingColor2;
		tmp_skyboxRenderingColor3 = skyboxRenderingColor3;
		tmp_skyboxRenderingColor4 = skyboxRenderingColorTop;
		if (height + skyboxRenderingColorTopDeltaHeight < skyboxRenderingColor3Height)
		{
			tmp_skyboxRenderingColor3 = skyboxRenderingColorTop;
		}
		if (height + skyboxRenderingColorTopDeltaHeight < skyboxRenderingColor2Height)
		{
			tmp_skyboxRenderingColor2 = skyboxRenderingColorTop;
		}
		if (height + skyboxRenderingColorTopDeltaHeight < skyboxRenderingColor1Height)
		{
			tmp_skyboxRenderingColor1 = skyboxRenderingColorTop;
		}
		if (skyboxRenderingColor0Enabled)
		{
			num = ((!(skyboxRenderingColor0Height - height > 0f)) ? Mathf.Atan((skyboxRenderingColor0Height - height) / skyboxRenderingColor0Distance) : Mathf.Atan((skyboxRenderingColor0Height - height) / skyboxRenderingColor0Distance));
		}
		float num4 = ((!(skyboxRenderingColor1Height - height > 0f)) ? Mathf.Atan((skyboxRenderingColor1Height - height) / skyboxRenderingColorDownwardsScatteringDistance) : Mathf.Atan((skyboxRenderingColor1Height - height) / skyboxRenderingColorUpwardsScatteringDistance));
		float num5 = ((!(skyboxRenderingColor2Height - height > 0f)) ? Mathf.Atan((skyboxRenderingColor2Height - height) / skyboxRenderingColorDownwardsScatteringDistance) : Mathf.Atan((skyboxRenderingColor2Height - height) / skyboxRenderingColorUpwardsScatteringDistance));
		float num6 = ((!(skyboxRenderingColor3Height - height > 0f)) ? Mathf.Atan((skyboxRenderingColor3Height - height) / skyboxRenderingColorDownwardsScatteringDistance) : Mathf.Atan((skyboxRenderingColor3Height - height) / skyboxRenderingColorUpwardsScatteringDistance));
		if (skyboxRenderingColor0Enabled)
		{
			num2 = Mathf.RoundToInt((float)skyboxAngleColors * ((num + (float)Math.PI / 2f) / (float)Math.PI));
		}
		int num7 = Mathf.RoundToInt((float)skyboxAngleColors * ((num4 + (float)Math.PI / 2f) / (float)Math.PI));
		int num8 = Mathf.RoundToInt((float)skyboxAngleColors * ((num5 + (float)Math.PI / 2f) / (float)Math.PI));
		int num9 = Mathf.RoundToInt((float)skyboxAngleColors * ((num6 + (float)Math.PI / 2f) / (float)Math.PI));
		int num10 = num7;
		int num11 = num9;
		if (skyboxRenderingColor0Enabled && num10 < num2 + 4)
		{
			num10 = num2 + 4;
		}
		if (num7 < num10 + 4)
		{
			num7 = num10 + 4;
		}
		if (num8 < num7 + 4)
		{
			num8 = num7 + 4;
		}
		if (num9 < num8 + 4)
		{
			num9 = num8 + 4;
		}
		if (num11 < num9 + 4)
		{
			num11 = num9 + 4;
		}
		if (skyboxRenderingColor0Enabled)
		{
			num3 = 255f / (float)(num10 - num2);
		}
		float num12 = 255f / (float)(num7 - num10);
		float num13 = 255f / (float)(num8 - num7);
		float num14 = 255f / (float)(num9 - num8);
		float num15 = 255f / (float)(num11 - num9);
		if (skyboxRenderingColor0Enabled)
		{
			for (int i = 0; i < skyboxAngleColors; i++)
			{
				if (i < num2)
				{
					ref Color32 reference = ref skyboxAngleColor[i];
					reference = Color32.op_Implicit(tmp_skyboxRenderingColorm1);
				}
				else if (i < num10)
				{
					skyboxAngleColor[i].r = (byte)((tmp_skyboxRenderingColor0.r * (float)(i - num2) + tmp_skyboxRenderingColorm1.r * (float)(num10 - i)) * num3);
					skyboxAngleColor[i].g = (byte)((tmp_skyboxRenderingColor0.g * (float)(i - num2) + tmp_skyboxRenderingColorm1.g * (float)(num10 - i)) * num3);
					skyboxAngleColor[i].b = (byte)((tmp_skyboxRenderingColor0.b * (float)(i - num2) + tmp_skyboxRenderingColorm1.b * (float)(num10 - i)) * num3);
				}
				else if (i < num7)
				{
					skyboxAngleColor[i].r = (byte)((tmp_skyboxRenderingColor1.r * (float)(i - num10) + tmp_skyboxRenderingColor0.r * (float)(num7 - i)) * num12);
					skyboxAngleColor[i].g = (byte)((tmp_skyboxRenderingColor1.g * (float)(i - num10) + tmp_skyboxRenderingColor0.g * (float)(num7 - i)) * num12);
					skyboxAngleColor[i].b = (byte)((tmp_skyboxRenderingColor1.b * (float)(i - num10) + tmp_skyboxRenderingColor0.b * (float)(num7 - i)) * num12);
				}
				else if (i < num8)
				{
					skyboxAngleColor[i].r = (byte)((tmp_skyboxRenderingColor2.r * (float)(i - num7) + tmp_skyboxRenderingColor1.r * (float)(num8 - i)) * num13);
					skyboxAngleColor[i].g = (byte)((tmp_skyboxRenderingColor2.g * (float)(i - num7) + tmp_skyboxRenderingColor1.g * (float)(num8 - i)) * num13);
					skyboxAngleColor[i].b = (byte)((tmp_skyboxRenderingColor2.b * (float)(i - num7) + tmp_skyboxRenderingColor1.b * (float)(num8 - i)) * num13);
				}
				else if (i < num9)
				{
					skyboxAngleColor[i].r = (byte)((tmp_skyboxRenderingColor3.r * (float)(i - num8) + tmp_skyboxRenderingColor2.r * (float)(num9 - i)) * num14);
					skyboxAngleColor[i].g = (byte)((tmp_skyboxRenderingColor3.g * (float)(i - num8) + tmp_skyboxRenderingColor2.g * (float)(num9 - i)) * num14);
					skyboxAngleColor[i].b = (byte)((tmp_skyboxRenderingColor3.b * (float)(i - num8) + tmp_skyboxRenderingColor2.b * (float)(num9 - i)) * num14);
				}
				else if (i < num11)
				{
					skyboxAngleColor[i].r = (byte)((tmp_skyboxRenderingColor4.r * (float)(i - num9) + tmp_skyboxRenderingColor3.r * (float)(num11 - i)) * num15);
					skyboxAngleColor[i].g = (byte)((tmp_skyboxRenderingColor4.g * (float)(i - num9) + tmp_skyboxRenderingColor3.g * (float)(num11 - i)) * num15);
					skyboxAngleColor[i].b = (byte)((tmp_skyboxRenderingColor4.b * (float)(i - num9) + tmp_skyboxRenderingColor3.b * (float)(num11 - i)) * num15);
				}
				else
				{
					ref Color32 reference2 = ref skyboxAngleColor[i];
					reference2 = Color32.op_Implicit(tmp_skyboxRenderingColor4);
				}
			}
		}
		else
		{
			for (int j = 0; j < skyboxAngleColors; j++)
			{
				if (j < num10)
				{
					ref Color32 reference3 = ref skyboxAngleColor[j];
					reference3 = Color32.op_Implicit(tmp_skyboxRenderingColor0);
				}
				else if (j < num7)
				{
					skyboxAngleColor[j].r = (byte)((tmp_skyboxRenderingColor1.r * (float)(j - num10) + tmp_skyboxRenderingColor0.r * (float)(num7 - j)) * num12);
					skyboxAngleColor[j].g = (byte)((tmp_skyboxRenderingColor1.g * (float)(j - num10) + tmp_skyboxRenderingColor0.g * (float)(num7 - j)) * num12);
					skyboxAngleColor[j].b = (byte)((tmp_skyboxRenderingColor1.b * (float)(j - num10) + tmp_skyboxRenderingColor0.b * (float)(num7 - j)) * num12);
				}
				else if (j < num8)
				{
					skyboxAngleColor[j].r = (byte)((tmp_skyboxRenderingColor2.r * (float)(j - num7) + tmp_skyboxRenderingColor1.r * (float)(num8 - j)) * num13);
					skyboxAngleColor[j].g = (byte)((tmp_skyboxRenderingColor2.g * (float)(j - num7) + tmp_skyboxRenderingColor1.g * (float)(num8 - j)) * num13);
					skyboxAngleColor[j].b = (byte)((tmp_skyboxRenderingColor2.b * (float)(j - num7) + tmp_skyboxRenderingColor1.b * (float)(num8 - j)) * num13);
				}
				else if (j < num9)
				{
					skyboxAngleColor[j].r = (byte)((tmp_skyboxRenderingColor3.r * (float)(j - num8) + tmp_skyboxRenderingColor2.r * (float)(num9 - j)) * num14);
					skyboxAngleColor[j].g = (byte)((tmp_skyboxRenderingColor3.g * (float)(j - num8) + tmp_skyboxRenderingColor2.g * (float)(num9 - j)) * num14);
					skyboxAngleColor[j].b = (byte)((tmp_skyboxRenderingColor3.b * (float)(j - num8) + tmp_skyboxRenderingColor2.b * (float)(num9 - j)) * num14);
				}
				else if (j < num11)
				{
					skyboxAngleColor[j].r = (byte)((tmp_skyboxRenderingColor4.r * (float)(j - num9) + tmp_skyboxRenderingColor3.r * (float)(num11 - j)) * num15);
					skyboxAngleColor[j].g = (byte)((tmp_skyboxRenderingColor4.g * (float)(j - num9) + tmp_skyboxRenderingColor3.g * (float)(num11 - j)) * num15);
					skyboxAngleColor[j].b = (byte)((tmp_skyboxRenderingColor4.b * (float)(j - num9) + tmp_skyboxRenderingColor3.b * (float)(num11 - j)) * num15);
				}
				else
				{
					ref Color32 reference4 = ref skyboxAngleColor[j];
					reference4 = Color32.op_Implicit(tmp_skyboxRenderingColor4);
				}
			}
		}
		return true;
	}

	private bool ProcessSkyboxTexture(Texture2D tex, float height, int mode)
	{
		//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_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_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		if (pixels == null)
		{
			Skybox_Start();
		}
		int width = ((Texture)tex).width;
		int height2 = ((Texture)tex).height;
		for (int i = 0; i < height2; i++)
		{
			switch (mode)
			{
			case -1:
			{
				for (int k = 0; k < width; k++)
				{
					ref Color32 reference2 = ref pixels[k + i * width];
					reference2 = skyboxAngleColor[skyboxBottomAngles[k, i]];
				}
				break;
			}
			case 0:
			{
				for (int l = 0; l < width; l++)
				{
					ref Color32 reference3 = ref pixels[l + i * width];
					reference3 = skyboxAngleColor[skyboxSideAngles[l, i]];
				}
				break;
			}
			case 1:
			{
				for (int j = 0; j < width; j++)
				{
					ref Color32 reference = ref pixels[j + i * width];
					reference = skyboxAngleColor[skyboxTopAngles[j, i]];
				}
				break;
			}
			}
		}
		tex.SetPixels32(pixels);
		tex.Apply(false);
		return true;
	}

	private void ProcessSkybox()
	{
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: 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_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Invalid comparison between Unknown and I4
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Invalid comparison between Unknown and I4
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: 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_0071: Invalid comparison between Unknown and I4
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: Unknown result type (might be due to invalid IL or missing references)
		//IL_0343: 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_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_0387: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
		float num = ((!((Object)(object)sm != (Object)null)) ? 0f : sm.height);
		if (fogRenderingEnabled)
		{
			if (skyboxRenderingColor0Enabled)
			{
				RenderSettings.fogColor = skyboxRenderingColor0;
			}
			else
			{
				RenderSettings.fogColor = skyboxRenderingColor;
			}
			FogMode val = initialFogMode;
			if ((int)val != 1)
			{
				if ((int)val == 2 || (int)val == 3)
				{
					RenderSettings.fogDensity = initialFogValue * (1f - fog01) + extremeFogValue * fog01;
				}
			}
			else
			{
				RenderSettings.fogEndDistance = initialFogValue * (1f - fog01) + extremeFogValue * fog01;
			}
		}
		if (!skyboxRenderingEnabled)
		{
			return;
		}
		if ((Object)(object)skyboxComponent == (Object)null)
		{
			Skybox_Start();
		}
		((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).clearFlags = (CameraClearFlags)1;
		getSkyboxRenderingColor(((Component)this).gameObject.transform.position.y + ((!((Object)(object)sm != (Object)null)) ? 0f : sm.height), renderSpace: false, out skyboxRenderingColor);
		((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).backgroundColor = skyboxRenderingColor;
		skyboxRenderNth_count--;
		if (skyboxRenderNth_count > 0)
		{
			return;
		}
		skyboxRenderNth_count = skyboxRenderNth;
		getSkyboxRenderingColor(((Component)this).gameObject.transform.position.y + num + skyboxRenderingColorTopDeltaHeight, renderSpace: true, out skyboxRenderingColorTop);
		PreProcessSkyboxTexture(((Component)this).gameObject.transform.position.y + num);
		for (int i = 0; i < skyboxRenderSidesPerNth; i++)
		{
			skyboxRenderNth_tex++;
			if (skyboxRenderNth_tex > 5)
			{
				skyboxRenderNth_tex = 0;
			}
			switch (skyboxRenderNth_tex)
			{
			case 0:
				if ((Object)(object)_FrontTex != (Object)null)
				{
					ProcessSkyboxTexture(_FrontTex, ((Component)this).gameObject.transform.position.y + num, 0);
				}
				break;
			case 1:
				if ((Object)(object)_LeftTex != (Object)null)
				{
					ProcessSkyboxTexture(_LeftTex, ((Component)this).gameObject.transform.position.y + num, 0);
				}
				break;
			case 2:
				if ((Object)(object)_RightTex != (Object)null)
				{
					ProcessSkyboxTexture(_RightTex, ((Component)this).gameObject.transform.position.y + num, 0);
				}
				break;
			case 3:
				if ((Object)(object)_BackTex != (Object)null)
				{
					ProcessSkyboxTexture(_BackTex, ((Component)this).gameObject.transform.position.y + num, 0);
				}
				break;
			case 4:
				if ((Object)(object)_UpTex != (Object)null)
				{
					ProcessSkyboxTexture(_UpTex, ((Component)this).gameObject.transform.position.y + num, 1);
				}
				break;
			case 5:
				if ((Object)(object)_DownTex != (Object)null)
				{
					ProcessSkyboxTexture(_DownTex, ((Component)this).gameObject.transform.position.y + num, -1);
				}
				break;
			}
		}
	}

	private void ProcessCamera(float timeLapsus)
	{
		//IL_000d: 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_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_021c: 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_027e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: 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_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0355: Unknown result type (might be due to invalid IL or missing references)
		//IL_032f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0334: Unknown result type (might be due to invalid IL or missing references)
		//IL_033f: Unknown result type (might be due to invalid IL or missing references)
		//IL_039b: Unknown result type (might be due to invalid IL or missing references)
		//IL_037a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04de: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0500: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0624: Unknown result type (might be due to invalid IL or missing references)
		//IL_0629: Unknown result type (might be due to invalid IL or missing references)
		//IL_0647: Unknown result type (might be due to invalid IL or missing references)
		//IL_064c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0940: Unknown result type (might be due to invalid IL or missing references)
		//IL_0945: Unknown result type (might be due to invalid IL or missing references)
		//IL_097e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0983: Unknown result type (might be due to invalid IL or missing references)
		//IL_07df: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0701: Unknown result type (might be due to invalid IL or missing references)
		//IL_0706: Unknown result type (might be due to invalid IL or missing references)
		//IL_0721: Unknown result type (might be due to invalid IL or missing references)
		//IL_0726: Unknown result type (might be due to invalid IL or missing references)
		//IL_076a: Unknown result type (might be due to invalid IL or missing references)
		//IL_076f: Unknown result type (might be due to invalid IL or missing references)
		//IL_078a: Unknown result type (might be due to invalid IL or missing references)
		//IL_078f: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_080e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0813: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b22: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a90: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0abc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ace: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ade: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0afa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a08: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_10e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_10f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_10ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_110a: Unknown result type (might be due to invalid IL or missing references)
		//IL_110f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1114: Unknown result type (might be due to invalid IL or missing references)
		//IL_111b: Unknown result type (might be due to invalid IL or missing references)
		//IL_112c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1132: Unknown result type (might be due to invalid IL or missing references)
		//IL_113d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1142: Unknown result type (might be due to invalid IL or missing references)
		//IL_1147: Unknown result type (might be due to invalid IL or missing references)
		//IL_114e: Unknown result type (might be due to invalid IL or missing references)
		//IL_115f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1165: Unknown result type (might be due to invalid IL or missing references)
		//IL_1170: Unknown result type (might be due to invalid IL or missing references)
		//IL_1175: Unknown result type (might be due to invalid IL or missing references)
		//IL_117a: Unknown result type (might be due to invalid IL or missing references)
		//IL_107b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1080: Unknown result type (might be due to invalid IL or missing references)
		//IL_11a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_10b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_10c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_10cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_10d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_10d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_10db: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_11dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d4f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d5f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0da7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dac: Unknown result type (might be due to invalid IL or missing references)
		//IL_0db1: Unknown result type (might be due to invalid IL or missing references)
		//IL_13a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_13a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_13c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_13c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_13ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f21: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f26: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e95: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e9b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ea0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ea5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eaa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ec0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ec5: Unknown result type (might be due to invalid IL or missing references)
		//IL_1434: Unknown result type (might be due to invalid IL or missing references)
		//IL_1224: Unknown result type (might be due to invalid IL or missing references)
		//IL_1229: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e37: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e3c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e20: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dd9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0de9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dfa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e04: Unknown result type (might be due to invalid IL or missing references)
		//IL_1913: Unknown result type (might be due to invalid IL or missing references)
		//IL_15a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_15a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_15f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_15f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_1237: Unknown result type (might be due to invalid IL or missing references)
		//IL_1239: Unknown result type (might be due to invalid IL or missing references)
		//IL_1244: Unknown result type (might be due to invalid IL or missing references)
		//IL_1249: Unknown result type (might be due to invalid IL or missing references)
		//IL_124e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1253: Unknown result type (might be due to invalid IL or missing references)
		//IL_1260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f95: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f9a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f48: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f53: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f63: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f79: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f7e: Unknown result type (might be due to invalid IL or missing references)
		//IL_127e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1283: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e4f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e66: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e71: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e76: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e7b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1666: Unknown result type (might be due to invalid IL or missing references)
		//IL_166b: Unknown result type (might be due to invalid IL or missing references)
		//IL_12a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_12ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_12db: Unknown result type (might be due to invalid IL or missing references)
		//IL_12e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fe0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0feb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff5: Unknown result type (might be due to invalid IL or missing references)
		//IL_1373: Unknown result type (might be due to invalid IL or missing references)
		//IL_1723: Unknown result type (might be due to invalid IL or missing references)
		//IL_1728: Unknown result type (might be due to invalid IL or missing references)
		//IL_172d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1780: Unknown result type (might be due to invalid IL or missing references)
		//IL_1785: Unknown result type (might be due to invalid IL or missing references)
		//IL_178a: Unknown result type (might be due to invalid IL or missing references)
		if (enableSpecialForce && Input.GetKey(specialForceApplyZeroRotate))
		{
			((Component)this).gameObject.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
		}
		if (scheduleRecoverVehicle > 0)
		{
			scheduleRecoverVehicle--;
			if (scheduleRecoverVehicle == 0)
			{
				recoverVehicle();
			}
		}
		if (enableRecoverVehicle && inputRecoverVehicleKeyForToggled)
		{
			inputRecoverVehicleKeyForToggled = false;
			recoverVehicle();
		}
		if (cameraOnFixedUpdate_count > 0)
		{
			cameraOnFixedUpdate_count--;
		}
		else if (inputExternalCameraKeyForToggled)
		{
			inputExternalCameraKeyForToggled = false;
			if (cameraExternalEnabled)
			{
				cameraExternalEnabled = false;
				if ((Object)(object)sm != (Object)null && sm.globalDebugNodes)
				{
					Debug.Log((object)("Internal Camera " + currentCameraPosition + " Selected"));
				}
			}
			else
			{
				currentCameraPosition++;
				if (currentCameraPosition >= countCameraPositions)
				{
					currentCameraPosition = 0;
					cameraExternalEnabled = true;
					if ((Object)(object)sm != (Object)null && sm.globalDebugNodes)
					{
						Debug.Log((object)"External Camera Selected");
					}
				}
				else if ((Object)(object)sm != (Object)null && sm.globalDebugNodes)
				{
					Debug.Log((object)("Internal Camera " + currentCameraPosition + " Selected"));
				}
			}
			cameraOnFixedUpdate_count = 50;
		}
		if (inputFixedPositionCameraKeyForToggled)
		{
			inputFixedPositionCameraKeyForToggled = false;
			cameraFixedPositionEnabled = !cameraFixedPositionEnabled;
			if (cameraFixedPositionEnabled)
			{
				cameraposition += ((Component)this).gameObject.GetComponent<Rigidbody>().velocity * 4f;
			}
		}
		if (enableSpecialForce && Input.GetKey(specialForceApplyLeft))
		{
			((Component)this).gameObject.GetComponent<Rigidbody>().AddForce(-((Component)this).gameObject.transform.right * specialForceMagnitude);
		}
		if (enableSpecialForce && Input.GetKey(specialForceApplyRight))
		{
			((Component)this).gameObject.GetComponent<Rigidbody>().AddForce(((Component)this).gameObject.transform.right * specialForceMagnitude);
		}
		if (enableSpecialForce && Input.GetKey(specialForceApplyForward))
		{
			((Component)this).gameObject.GetComponent<Rigidbody>().AddForce(((Component)this).gameObject.transform.forward * specialForceMagnitude);
		}
		if (enableSpecialForce && Input.GetKey(specialForceApplyForceBack))
		{
			((Component)this).gameObject.GetComponent<Rigidbody>().AddForce(-((Component)this).gameObject.transform.forward * specialForceMagnitude);
		}
		if (enableSpecialForce && Input.GetKey(specialForceApplyForceUp))
		{
			((Component)this).gameObject.GetComponent<Rigidbody>().AddForce(((Component)this).gameObject.transform.up * specialForceMagnitude);
		}
		if (enableSpecialForce && Input.GetKey(specialForceApplyDown))
		{
			((Component)this).gameObject.GetComponent<Rigidbody>().AddForce(-((Component)this).gameObject.transform.up * specialForceMagnitude);
		}
		if (cameraExternalEnabled != cameraExternalEnabled_lastValue)
		{
			if (cameraExternalEnabled)
			{
				((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).nearClipPlane = cameraExternalNearClipPlane * globalSimulationScale;
				((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).farClipPlane = cameraExternalFarClipPlane * globalSimulationScale;
			}
			else
			{
				((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).nearClipPlane = cameraInternalNearClipPlane * globalSimulationScale;
				((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).farClipPlane = cameraInternalFarClipPlane * globalSimulationScale;
			}
			cameraExternalEnabled_lastValue = cameraExternalEnabled;
		}
		float num = (Input.mousePosition.x - (float)Screen.width / 2f) / (float)Screen.width;
		float num2 = (Input.mousePosition.y - (float)Screen.height / 2f) / (float)Screen.height;
		if (num > 0.5f)
		{
			num = 0.5f;
		}
		if (num < -0.5f)
		{
			num = -0.5f;
		}
		if (num2 > 0.5f)
		{
			num2 = 0.5f;
		}
		if (num2 < -0.5f)
		{
			num2 = -0.5f;
		}
		float num3 = gs_old * (1f - cameraInternalGsMixing) + sm.gaugesGs_output * cameraInternalGsMixing;
		if (num3 > cameraInternalGsMax)
		{
			num3 = cameraInternalGsMax;
		}
		if (num3 < 0f - cameraInternalGsMax)
		{
			num3 = 0f - cameraInternalGsMax;
		}
		gs_old = num3;
		float num4 = hgs_old * (1f - cameraInternalGsMixing) + sm.gaugesHGs_output * cameraInternalGsMixing;
		if (num4 > cameraInternalGsMax)
		{
			num4 = cameraInternalGsMax;
		}
		if (num4 < 0f - cameraInternalGsMax)
		{
			num4 = 0f - cameraInternalGsMax;
		}
		hgs_old = num4;
		Vector3 position = ((Component)this).gameObject.transform.position;
		if ((Object)(object)cameraAlternateFollow != (Object)null)
		{
			position = cameraAlternateFollow.transform.position;
		}
		if (cameraExternalEnabled)
		{
			if (Input.GetAxis("Mouse ScrollWheel") > 0f && cameraExternalDistance > cameraExternalDistanceMin)
			{
				cameraExternalDistance -= cameraExternalDistanceStep * inputWheelMouseSensivity / 10f;
			}
			if (Input.GetAxis("Mouse ScrollWheel") < 0f && cameraExternalDistance < cameraExternalDistanceMax)
			{
				cameraExternalDistance += cameraExternalDistanceStep * inputWheelMouseSensivity / 10f;
			}
			if (!cameraFixedPositionEnabled)
			{
				cameraposition = position + new Vector3((0f - ((Component)this).gameObject.transform.forward.x) * 20f - ((Component)this).gameObject.transform.right.x * 40f * num * inputHorizontalMouseSensivity / 3f, -40f * (num2 * inputVerticalMouseSensivity / 3f - 0.25f), (0f - ((Component)this).gameObject.transform.forward.z) * 20f - ((Component)this).gameObject.transform.right.z * 40f * num * inputHorizontalMouseSensivity / 3f) * cameraExternalDistance * cameraExternalMinHeightScale * globalSimulationScale;
			}
			cameralookat = position;
			if (cameraExternalUpWorld)
			{
				cameraup = worldup;
			}
			else
			{
				cameraup = ((Component)this).gameObject.transform.up;
			}
			if (cameraFixedPositionEnabled)
			{
				((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).fieldOfView = 20f;
			}
			else
			{
				((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).fieldOfView = 80f;
			}
			camera_filter = cameraExternalFilter;
			cameraOnFixedUpdate = true;
		}
		else
		{
			if (Input.GetAxis("Mouse ScrollWheel") > 0f && cameraInternalFov > cameraInternalFovMin)
			{
				cameraInternalFov -= cameraInternalFovStep * inputWheelMouseSensivity * cameraInternalSensivity / 10f;
			}
			if (Input.GetAxis("Mouse ScrollWheel") < 0f && cameraInternalFov < cameraInternalFovMax)
			{
				cameraInternalFov += cameraInternalFovStep * inputWheelMouseSensivity * cameraInternalSensivity / 10f;
			}
			cameraorientation = ((Component)this).gameObject.transform.rotation;
			camerafixed = false;
			countCameraPositions = 0;
			if (!cameraFixedPositionEnabled)
			{
				cameraposition = ((Component)this).gameObject.transform.TransformPoint(0f, 0.4f, -0.4f);
			}
			if (!cameraFixedPositionEnabled && (Object)(object)sm != (Object)null && sm.labeled_surfacemisc != null)
			{
				for (int i = 0; i < sm.labeled_surfacemisc_count; i++)
				{
					if (sm.labeled_surfacemisc[i].cameraPosition)
					{
						if (currentCameraPosition == countCameraPositions)
						{
							cameraposition = sm.labeled_surfacemisc[i].gameObject.transform.position;
							cameraorientation = sm.labeled_surfacemisc[i].gameObject.transform.rotation;
							camerafixed = !sm.labeled_surfacemisc[i].cameraCanRotate;
						}
						countCameraPositions++;
					}
				}
			}
			if (!camerafixed)
			{
				if (cameraInternalGsPosition)
				{
					cameraposition -= ((Component)this).gameObject.transform.up * num3 * cameraInternalGsPositionDelta;
				}
				if (cameraInternalGsPosition)
				{
					cameraposition -= ((Component)this).gameObject.transform.right * num4 * cameraInternalGsPositionHDelta;
				}
			}
			if ((Object)(object)cameraAlternateFollow != (Object)null)
			{
				cameraposition = cameraAlternateFollow.transform.position;
			}
			float num5 = ((cameraInternalDontVertical && cameraInternalDontVerticalMix) ? ((!cameraInternalGsRotation) ? (0f - Mathf.Sin((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity * (1f - cameraInternalDontVerticalMixing))) : (0f - Mathf.Sin((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity * (1f - cameraInternalDontVerticalMixing) + num3 * cameraInternalGsRotationDelta))) : (cameraInternalDontVertical ? ((!cameraInternalGsRotation) ? (0f - Mathf.Sin(0f)) : (0f - Mathf.Sin(num3 * cameraInternalGsRotationDelta))) : ((!cameraInternalGsRotation) ? (0f - Mathf.Sin((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity)) : (0f - Mathf.Sin((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity + num3 * cameraInternalGsRotationDelta)))));
			float num6 = ((cameraInternalDontVertical && cameraInternalDontVerticalMix) ? ((!cameraInternalGsRotation) ? Mathf.Cos((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity * (1f - cameraInternalDontVerticalMixing)) : Mathf.Cos((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity * (1f - cameraInternalDontVerticalMixing) + num3 * cameraInternalGsRotationDelta)) : (cameraInternalDontVertical ? ((!cameraInternalGsRotation) ? Mathf.Cos(0f) : Mathf.Cos(num3 * cameraInternalGsRotationDelta)) : ((!cameraInternalGsRotation) ? Mathf.Cos((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity) : Mathf.Cos((0f - num2) * inputVerticalMouseSensivity * cameraInternalSensivity + num3 * cameraInternalGsRotationDelta))));
			if ((Object)(object)cameraAlternateFollow != (Object)null)
			{
				cameralookat = cameraposition + cameraAlternateFollow.transform.rotation * new Vector3((0f - Mathf.Cos(-(float)Math.PI / 2f - num * inputHorizontalMouseSensivity * cameraInternalSensivity)) * num6, num5, (0f - Mathf.Sin(-(float)Math.PI / 2f - num * inputHorizontalMouseSensivity * cameraInternalSensivity)) * num6);
				if (cameraInternalUpWorld && cameraInternalUpWorldMix)
				{
					cameraup = worldup * cameraInternalUpWorldMixing + cameraAlternateFollow.transform.up * (1f - cameraInternalUpWorldMixing);
				}
				else if (cameraInternalUpWorld)
				{
					cameraup = worldup;
				}
				else
				{
					cameraup = cameraAlternateFollow.transform.up;
				}
				if (cameraInternalGsRotation)
				{
					cameraup -= cameraAlternateFollow.transform.right * num4 * cameraInternalGsRotationDelta;
				}
			}
			else if (camerafixed)
			{
				cameralookat = cameraposition + cameraorientation * Vector3.forward;
				cameraup = ((Component)this).gameObject.transform.up;
			}
			else
			{
				cameralookat = cameraposition + cameraorientation * new Vector3((0f - Mathf.Cos(-(float)Math.PI / 2f - num * inputHorizontalMouseSensivity * cameraInternalSensivity)) * num6, num5, (0f - Mathf.Sin(-(float)Math.PI / 2f - num * inputHorizontalMouseSensivity * cameraInternalSensivity)) * num6);
				if (cameraInternalUpWorld && cameraInternalUpWorldMix)
				{
					cameraup = worldup * cameraInternalUpWorldMixing + ((Component)this).gameObject.transform.up * (1f - cameraInternalUpWorldMixing);
				}
				else if (cameraInternalUpWorld)
				{
					cameraup = worldup;
				}
				else
				{
					cameraup = ((Component)this).gameObject.transform.up;
				}
				if (cameraInternalGsRotation)
				{
					cameraup -= ((Component)this).gameObject.transform.right * num4 * cameraInternalGsRotationDelta;
				}
			}
			((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main).fieldOfView = cameraInternalFov;
			camera_filter = cameraInternalFilter;
			cameraOnFixedUpdate = false;
		}
		if (sunlightAttach && (Object)(object)sunlight != (Object)null)
		{
			((Component)sunlight).transform.position = (1f - sunlightAttachFilter) * ((Component)sunlight).transform.position + sunlightAttachFilter * (((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).transform.position - ((Component)sunlight).transform.forward * sunlightAttachDistance);
		}
		cameraposition_filtered = cameraposition_filtered * (1f - camera_filter) + cameraposition * camera_filter;
		cameralookat_filtered = cameralookat_filtered * (1f - camera_filter) + cameralookat * camera_filter;
		cameraup_filtered = cameraup_filtered * (1f - camera_filter) + cameraup * camera_filter;
		((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).transform.position = cameraposition_filtered;
		((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).transform.LookAt(cameralookat_filtered, cameraup_filtered);
		cameraExternalMinHeightScale = 1f;
		if (cameraExternalEnabled)
		{
			Vector3 position2 = ((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).transform.position;
			RaycastHit val = default(RaycastHit);
			if (cameraExternalMinHeightAutoProbe && Physics.Raycast(position2 + Vector3.up * cameraExternalMinHeightAutoProbeDeltaProbe, -Vector3.up, ref val, 1E+09f, LayerMask.op_Implicit(cameraExternalMinHeightAutoProbeLayermask)) && position2.y < ((RaycastHit)(ref val)).point.y + cameraExternalMinHeightAutoProbeDelta)
			{
				cameraExternalMinHeightScale *= 1f / ((((RaycastHit)(ref val)).point.y + cameraExternalMinHeightAutoProbeDelta - position2.y) * 0.1f + 1f);
				position2.y = ((RaycastHit)(ref val)).point.y + cameraExternalMinHeightAutoProbeDelta * cameraExternalMinHeightScale;
			}
			if (position2.y < cameraExternalMinHeight)
			{
				cameraExternalMinHeightScale *= 1f / ((cameraExternalMinHeight - position2.y) * 1f + 1f);
				position2.y = cameraExternalMinHeight;
			}
			((Component)((!((Object)(object)attachToCamera == (Object)null)) ? attachToCamera : Camera.main)).transform.position = position2;
		}
		if ((Object)(object)crossair != (Object)null)
		{
			Cursor.visible = false;
			float num7 = 64f;
			crossair.pixelInset = new Rect(Input.mousePosition.x - (float)Screen.width / 2f - num7 / 2f, Input.mousePosition.y - (float)Screen.height / 2f - num7 / 2f, num7, num7);
		}
		if ((Object)(object)speedmeter != (Object)null)
		{
			speedmeter.pixelOffset = new Vector2((float)(-Screen.width) / 2f + 10f, (float)Screen.height / 2f - 10f);
			float num8 = 15f;
			float num9 = 331.3f + 0.606f * num8;
			if ((Object)(object)sm != (Object)null)
			{
				GUIText obj = speedmeter;
				string[] obj2 = new string[28]
				{
					"speed: ",
					(Mathf.Floor(sm.speed / sm.globalSimulationScale * 3.6f * 100f) / 100f).ToString(),
					" km/h | ",
					(Mathf.Floor(sm.speed / sm.globalSimulationScale * 1.9438444f * 100f) / 100f).ToString(),
					" knots | M",
					(Mathf.Floor(sm.speed / sm.globalSimulationScale / num9 * 100f) / 100f).ToString(),
					" | ",
					(Mathf.Floor(sm.speed / sm.globalSimulationScale * 100f) / 100f).ToString(),
					" m/s | alternate method: ",
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null,
					null
				};
				Vector3 velocity = ((Component)this).gameObject.GetComponent<Rigidbody>().velocity;
				obj2[9] = (Mathf.Floor(((Vector3)(ref velocity)).magnitude / sm.globalSimulationScale * 100f) / 100f).ToString();
				obj2[10] = " m/s\nheight ";
				obj2[11] = (Mathf.Floor(((Component)this).gameObject.transform.position.y + ((!((Object)(object)sm != (Object)null)) ? 0f : sm.height) + 102.84f) / sm.globalSimulationScale).ToString();
				obj2[12] = "m | ";
				obj2[13] = (Mathf.Floor((((Component)this).gameObject.transform.position.y + ((!((Object)(object)sm != (Object)null)) ? 0f : sm.height) + 102.84f) / 0.3048f) / sm.globalSimulationScale).ToString();
				obj2[14] = " feet | vertical distance to ground: ";
				obj2[15] = (Mathf.Floor(sm.distanceToGround / sm.globalSimulationScale * 100f) / 100f).ToString();
				obj2[16] = " m\nwind: ";
				Vector3 val2 = GWindBasic.windAt(((Component)this).gameObject.transform.position);
				obj2[17] = (Mathf.Floor(((Vector3)(ref val2)).magnitude / sm.globalSimulationScale * 3.6f * 100f) / 100f).ToString();
				obj2[18] = "km/h | ";
				Vector3 val3 = GWindBasic.windAt(((Component)this).gameObject.transform.position);
				obj2[19] = (Mathf.Floor(((Vector3)(ref val3)).magnitude / sm.globalSimulationScale * 1.9438444f * 100f) / 100f).ToString();
				obj2[20] = " knots\nsensivity: ";
				obj2[21] = sm.inputSensivity.ToString();
				obj2[22] = " | trim ailerons: ";
				obj2[23] = sm.inputAileronsTrim.ToString();
				obj2[24] = " | trim elevator: ";
				obj2[25] = sm.inputElevatorTrim.ToString();
				obj2[26] = " | trim rudder: ";
				obj2[27] = sm.inputRudderTrim.ToString();
				obj.text = string.Concat(obj2);
				if (sm.stall > 0f)
				{
					GUIText obj3 = speedmeter;
					obj3.text = obj3.text + "\nSTALL: " + Mathf.RoundToInt(sm.stall * 100f) + "%";
				}
			}
			else
			{
				speedmeter.text = "Cannot locate GAircraft attached to the same object where GSCameraAux is attached.";
			}
		}
		if ((Object)(object)autopilotmeter != (Object)null)
		{
			autopilotmeter.pixelOffset = new Vector2((float)(-Screen.width) / 2f + 10f, (float)(-Screen.height) / 2f + 10f + 10f);
		}
		ProcessGround(timeLapsus);
		ProcessClouds(timeLapsus);
		ProcessSounds(timeLapsus);
	}

	private void ProcessGround(float timeLapsus)
	{
		//IL_0025: 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_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: 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_010e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)ground != (Object)null)
		{
			float num = searchGroundObjectGranularity;
			Vector3 position = ground.transform.position;
			if (position.x - ((Component)this).gameObject.transform.position.x > num)
			{
				position.x -= num;
			}
			if (position.x - ((Component)this).gameObject.transform.position.x < 0f - num)
			{
				position.x += num;
			}
			if (position.z - ((Component)this).gameObject.transform.position.z > num)
			{
				position.z -= num;
			}
			if (position.z - ((Component)this).gameObject.transform.position.z < 0f - num)
			{
				position.z += num;
			}
			ground.transform.position = position;
		}
	}

	public void ProcessClouds(float timeLapsus)
	{
		//IL_0025: 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_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)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: 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_004a: 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_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: 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)
		//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_012f: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)clouds != (Object)null)
		{
			float num = searchCloudsObjectGranularity;
			Vector3 position = clouds.transform.position;
	

Meloncorp_Reserves_G47_Rifle.dll

Decompiled a week ago
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using FistVR;
using OtherLoader;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;

[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]
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoStopLoopedEffect : MonoBehaviour
{
	public float effectDuration = 2.5f;

	private float d;

	private void OnEnable()
	{
		d = effectDuration;
	}

	private void Update()
	{
		if (!(d > 0f))
		{
			return;
		}
		d -= Time.deltaTime;
		if (d <= 0f)
		{
			((Component)this).GetComponent<ParticleSystem>().Stop(true);
			CFX_Demo_Translate component = ((Component)this).gameObject.GetComponent<CFX_Demo_Translate>();
			if ((Object)(object)component != (Object)null)
			{
				((Behaviour)component).enabled = false;
			}
		}
	}
}
public class CFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class CFX_Demo_RotateCamera : MonoBehaviour
{
	public static bool rotating = true;

	public float speed = 30f;

	public Transform rotationCenter;

	private void Update()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		if (rotating)
		{
			((Component)this).transform.RotateAround(rotationCenter.position, Vector3.up, speed * Time.deltaTime);
		}
	}
}
public class CFX_Demo_Translate : MonoBehaviour
{
	public float speed = 30f;

	public Vector3 rotation = Vector3.forward;

	public Vector3 axis = Vector3.forward;

	public bool gravity;

	private Vector3 dir;

	private void Start()
	{
		//IL_002f: 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_0040: 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)
		dir = new Vector3(Random.Range(0f, 360f), Random.Range(0f, 360f), Random.Range(0f, 360f));
		((Vector3)(ref dir)).Scale(rotation);
		((Component)this).transform.localEulerAngles = dir;
	}

	private void Update()
	{
		//IL_0008: 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_001d: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.Translate(axis * speed * Time.deltaTime, (Space)1);
	}
}
public class WFX_Demo : MonoBehaviour
{
	public float cameraSpeed = 10f;

	public bool orderedSpawns = true;

	public float step = 1f;

	public float range = 5f;

	private float order = -5f;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject[] ParticleExamples;

	private int exampleIndex;

	private string randomSpawnsDelay = "0.5";

	private bool randomSpawns;

	private bool slowMo;

	private bool rotateCam = true;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	public GameObject m4;

	public GameObject m4fps;

	private bool rotate_m4 = true;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = spawnParticle();
			if (!((Object)val2).name.StartsWith("WFX_MF"))
			{
				val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
			}
		}
	}

	public GameObject spawnParticle()
	{
		//IL_0064: 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)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		SetActiveCrossVersions(val, active: true);
		return val;
	}

	private void SetActiveCrossVersions(GameObject obj, bool active)
	{
		obj.SetActive(active);
		for (int i = 0; i < obj.transform.childCount; i++)
		{
			((Component)obj.transform.GetChild(i)).gameObject.SetActive(active);
		}
	}

	private void OnGUI()
	{
		//IL_0019: 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_02ef: 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_0321: 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_033a: Unknown result type (might be due to invalid IL or missing references)
		//IL_033f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(5f, 20f, (float)(Screen.width - 10), 60f));
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Effect: " + ((Object)ParticleExamples[exampleIndex]).name, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(280f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevParticle();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextParticle();
		}
		GUILayout.FlexibleSpace();
		GUILayout.Label("Click on the ground to spawn the selected effect", (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.FlexibleSpace();
		if (GUILayout.Button((!rotateCam) ? "Rotate Camera" : "Pause Camera", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }))
		{
			rotateCam = !rotateCam;
		}
		if (GUILayout.Button((!((Component)this).GetComponent<Renderer>().enabled) ? "Show Ground" : "Hide Ground", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) }))
		{
			((Component)this).GetComponent<Renderer>().enabled = !((Component)this).GetComponent<Renderer>().enabled;
		}
		if (GUILayout.Button((!slowMo) ? "Slow Motion" : "Normal Speed", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }))
		{
			slowMo = !slowMo;
			if (slowMo)
			{
				Time.timeScale = 0.33f;
			}
			else
			{
				Time.timeScale = 1f;
			}
		}
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Ground texture: " + groundTextureStr, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevTexture();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextTexture();
		}
		GUILayout.EndHorizontal();
		GUILayout.EndArea();
		if (!m4.GetComponent<Renderer>().enabled)
		{
			return;
		}
		GUILayout.BeginArea(new Rect(5f, (float)(Screen.height - 100), (float)(Screen.width - 10), 90f));
		rotate_m4 = GUILayout.Toggle(rotate_m4, "AutoRotate Weapon", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(250f) });
		GUI.enabled = !rotate_m4;
		float x = m4.transform.localEulerAngles.x;
		x = ((!(x > 90f)) ? x : (x - 180f));
		float y = m4.transform.localEulerAngles.y;
		float z = m4.transform.localEulerAngles.z;
		x = GUILayout.HorizontalSlider(x, 0f, 179f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		y = GUILayout.HorizontalSlider(y, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		z = GUILayout.HorizontalSlider(z, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		if (GUI.changed)
		{
			if (x > 90f)
			{
				x += 180f;
			}
			m4.transform.localEulerAngles = new Vector3(x, y, z);
			Debug.Log((object)x);
		}
		GUILayout.EndArea();
	}

	private IEnumerator RandomSpawnsCoroutine()
	{
		while (true)
		{
			GameObject particles = spawnParticle();
			if (orderedSpawns)
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(order, particles.transform.position.y, 0f);
				order -= step;
				if (order < 0f - range)
				{
					order = range;
				}
			}
			else
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(Random.Range(0f - range, range), 0f, Random.Range(0f - range, range)) + new Vector3(0f, particles.transform.position.y, 0f);
			}
			yield return (object)new WaitForSeconds(float.Parse(randomSpawnsDelay));
		}
	}

	private void Update()
	{
		//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_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		if (rotateCam)
		{
			((Component)Camera.main).transform.RotateAround(Vector3.zero, Vector3.up, cameraSpeed * Time.deltaTime);
		}
		if (rotate_m4)
		{
			m4.transform.Rotate(new Vector3(0f, 40f, 0f) * Time.deltaTime, (Space)0);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			((Component)this).GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			((Component)this).GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			((Component)this).GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			((Component)this).GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		showHideStuff();
	}

	private void showHideStuff()
	{
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			SetActiveCrossVersions(walls, active: true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			SetActiveCrossVersions(walls, active: false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_DeleteAfterDelay : MonoBehaviour
{
	public float delay = 1f;

	private void Update()
	{
		delay -= Time.deltaTime;
		if (delay < 0f)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class WFX_Demo_New : MonoBehaviour
{
	public Renderer groundRenderer;

	public Collider groundCollider;

	[Space]
	[Space]
	public Image slowMoBtn;

	public Text slowMoLabel;

	public Image camRotBtn;

	public Text camRotLabel;

	public Image groundBtn;

	public Text groundLabel;

	[Space]
	public Text EffectLabel;

	public Text EffectIndexLabel;

	public GameObject[] AdditionalEffects;

	public GameObject ground;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject m4;

	public GameObject m4fps;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	private GameObject[] ParticleExamples;

	private int exampleIndex;

	private bool slowMo;

	private Vector3 defaultCamPosition;

	private Quaternion defaultCamRotation;

	private List<GameObject> onScreenParticles = new List<GameObject>();

	private void Awake()
	{
		//IL_0063: 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_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)
		List<GameObject> list = new List<GameObject>();
		int childCount = ((Component)this).transform.childCount;
		for (int i = 0; i < childCount; i++)
		{
			GameObject gameObject = ((Component)((Component)this).transform.GetChild(i)).gameObject;
			list.Add(gameObject);
		}
		list.AddRange(AdditionalEffects);
		ParticleExamples = list.ToArray();
		defaultCamPosition = ((Component)Camera.main).transform.position;
		defaultCamRotation = ((Component)Camera.main).transform.rotation;
		((MonoBehaviour)this).StartCoroutine("CheckForDeletedParticles");
		UpdateUI();
	}

	private void Update()
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		else if (Input.GetKeyDown((KeyCode)127))
		{
			destroyParticles();
		}
		if (Input.GetMouseButtonDown(0))
		{
			RaycastHit val = default(RaycastHit);
			if (groundCollider.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
			{
				GameObject val2 = spawnParticle();
				if (!((Object)val2).name.StartsWith("WFX_MF"))
				{
					val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
				}
			}
		}
		float axis = Input.GetAxis("Mouse ScrollWheel");
		if (axis != 0f)
		{
			((Component)Camera.main).transform.Translate(Vector3.forward * ((!(axis < 0f)) ? 1f : (-1f)), (Space)1);
		}
		if (Input.GetMouseButtonDown(2))
		{
			((Component)Camera.main).transform.position = defaultCamPosition;
			((Component)Camera.main).transform.rotation = defaultCamRotation;
		}
	}

	public void OnToggleGround()
	{
		//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_004c: 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)
		Color white = Color.white;
		groundRenderer.enabled = !groundRenderer.enabled;
		white.a = ((!groundRenderer.enabled) ? 0.33f : 1f);
		((Graphic)groundBtn).color = white;
		((Graphic)groundLabel).color = white;
	}

	public void OnToggleCamera()
	{
		//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_003a: 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)
		Color white = Color.white;
		CFX_Demo_RotateCamera.rotating = !CFX_Demo_RotateCamera.rotating;
		white.a = ((!CFX_Demo_RotateCamera.rotating) ? 0.33f : 1f);
		((Graphic)camRotBtn).color = white;
		((Graphic)camRotLabel).color = white;
	}

	public void OnToggleSlowMo()
	{
		//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_005c: 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)
		Color white = Color.white;
		slowMo = !slowMo;
		if (slowMo)
		{
			Time.timeScale = 0.33f;
			white.a = 1f;
		}
		else
		{
			Time.timeScale = 1f;
			white.a = 0.33f;
		}
		((Graphic)slowMoBtn).color = white;
		((Graphic)slowMoLabel).color = white;
	}

	public void OnPreviousEffect()
	{
		prevParticle();
	}

	public void OnNextEffect()
	{
		nextParticle();
	}

	private void UpdateUI()
	{
		EffectLabel.text = ((Object)ParticleExamples[exampleIndex]).name;
		EffectIndexLabel.text = string.Format("{0}/{1}", (exampleIndex + 1).ToString("00"), ParticleExamples.Length.ToString("00"));
	}

	public GameObject spawnParticle()
	{
		//IL_0025: 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_0037: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: 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)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		val.transform.position = new Vector3(0f, val.transform.position.y, 0f);
		val.SetActive(true);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		ParticleSystem component = val.GetComponent<ParticleSystem>();
		if ((Object)(object)component != (Object)null)
		{
			MainModule main = component.main;
			if (((MainModule)(ref main)).loop)
			{
				((Component)component).gameObject.AddComponent<CFX_AutoStopLoopedEffect>();
				((Component)component).gameObject.AddComponent<CFX_AutoDestructShuriken>();
			}
		}
		onScreenParticles.Add(val);
		return val;
	}

	private IEnumerator CheckForDeletedParticles()
	{
		while (true)
		{
			yield return (object)new WaitForSeconds(5f);
			for (int num = onScreenParticles.Count - 1; num >= 0; num--)
			{
				if ((Object)(object)onScreenParticles[num] == (Object)null)
				{
					onScreenParticles.RemoveAt(num);
				}
			}
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		UpdateUI();
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		UpdateUI();
		showHideStuff();
	}

	private void destroyParticles()
	{
		for (int num = onScreenParticles.Count - 1; num >= 0; num--)
		{
			if ((Object)(object)onScreenParticles[num] != (Object)null)
			{
				Object.Destroy((Object)(object)onScreenParticles[num]);
			}
			onScreenParticles.RemoveAt(num);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			ground.GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			ground.GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			ground.GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			ground.GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void showHideStuff()
	{
		//IL_004d: 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)
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
			((Component)Camera.main).transform.position = new Vector3(-2.482457f, 3.263842f, -0.004924395f);
			((Component)Camera.main).transform.eulerAngles = new Vector3(20f, 90f, 0f);
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			walls.SetActive(true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			walls.SetActive(false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class WFX_Demo_Wall : MonoBehaviour
{
	public WFX_Demo_New demo;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = demo.spawnParticle();
			val2.transform.position = ((RaycastHit)(ref val)).point;
			val2.transform.rotation = Quaternion.FromToRotation(Vector3.forward, ((RaycastHit)(ref val)).normal);
		}
	}
}
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoDestructShuriken : MonoBehaviour
{
	public bool OnlyDeactivate;

	private void OnEnable()
	{
		((MonoBehaviour)this).StartCoroutine("CheckIfAlive");
	}

	private IEnumerator CheckIfAlive()
	{
		do
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		while (((Component)this).GetComponent<ParticleSystem>().IsAlive(true));
		if (OnlyDeactivate)
		{
			((Component)this).gameObject.SetActive(false);
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(Light))]
public class CFX_LightIntensityFade : MonoBehaviour
{
	public float duration = 1f;

	public float delay = 0f;

	public float finalIntensity = 0f;

	private float baseIntensity;

	public bool autodestruct;

	private float p_lifetime = 0f;

	private float p_delay;

	private void Start()
	{
		baseIntensity = ((Component)this).GetComponent<Light>().intensity;
	}

	private void OnEnable()
	{
		p_lifetime = 0f;
		p_delay = delay;
		if (delay > 0f)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = false;
		}
	}

	private void Update()
	{
		if (p_delay > 0f)
		{
			p_delay -= Time.deltaTime;
			if (p_delay <= 0f)
			{
				((Behaviour)((Component)this).GetComponent<Light>()).enabled = true;
			}
		}
		else if (p_lifetime / duration < 1f)
		{
			((Component)this).GetComponent<Light>().intensity = Mathf.Lerp(baseIntensity, finalIntensity, p_lifetime / duration);
			p_lifetime += Time.deltaTime;
		}
		else if (autodestruct)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(MeshFilter))]
public class WFX_BulletHoleDecal : MonoBehaviour
{
	private static Vector2[] quadUVs = (Vector2[])(object)new Vector2[4]
	{
		new Vector2(0f, 0f),
		new Vector2(0f, 1f),
		new Vector2(1f, 0f),
		new Vector2(1f, 1f)
	};

	public float lifetime = 10f;

	public float fadeoutpercent = 80f;

	public Vector2 frames;

	public bool randomRotation = false;

	public bool deactivate = false;

	private float life;

	private float fadeout;

	private Color color;

	private float orgAlpha;

	private void Awake()
	{
		//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)
		color = ((Component)this).GetComponent<Renderer>().material.GetColor("_TintColor");
		orgAlpha = color.a;
	}

	private void OnEnable()
	{
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		int num = Random.Range(0, (int)(frames.x * frames.y));
		int num2 = (int)((float)num % frames.x);
		int num3 = (int)((float)num / frames.y);
		Vector2[] array = (Vector2[])(object)new Vector2[4];
		for (int i = 0; i < 4; i++)
		{
			array[i].x = (quadUVs[i].x + (float)num2) * (1f / frames.x);
			array[i].y = (quadUVs[i].y + (float)num3) * (1f / frames.y);
		}
		((Component)this).GetComponent<MeshFilter>().mesh.uv = array;
		if (randomRotation)
		{
			((Component)this).transform.Rotate(0f, 0f, Random.Range(0f, 360f), (Space)1);
		}
		life = lifetime;
		fadeout = life * (fadeoutpercent / 100f);
		color.a = orgAlpha;
		((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine("holeUpdate");
	}

	private IEnumerator holeUpdate()
	{
		while (life > 0f)
		{
			life -= Time.deltaTime;
			if (life <= fadeout)
			{
				color.a = Mathf.Lerp(0f, orgAlpha, life / fadeout);
				((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
			}
			yield return null;
		}
	}
}
[RequireComponent(typeof(Light))]
public class WFX_LightFlicker : MonoBehaviour
{
	public float time = 0.05f;

	private float timer;

	private void Start()
	{
		timer = time;
		((MonoBehaviour)this).StartCoroutine("Flicker");
	}

	private IEnumerator Flicker()
	{
		while (true)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = !((Behaviour)((Component)this).GetComponent<Light>()).enabled;
			do
			{
				timer -= Time.deltaTime;
				yield return null;
			}
			while (timer > 0f);
			timer = time;
		}
	}
}
public class MagazineHelper : EditorWindow
{
	public FVRFireArmMagazine Magazine;

	public GameObject firstCartridge;

	public int numberOfCartridges = 1;

	public bool mirrorX;

	public float cartridgeOffsetY = 0f;

	public float cartridgeOffsetZ = 0f;

	public bool generateFollowerPoints;

	public bool useFollowerOffsets = false;

	public bool invertFollowerOffsets = false;

	public GameObject follower;

	public float followerOffsetY = 0f;

	public float followerOffsetZ = 0f;

	private GameObject cartridge_root;

	private GameObject[] CartridgeObjectList;

	private MeshFilter[] CartridgeMeshFilterList;

	private MeshRenderer[] CartridgeMeshRendererList;

	private float cartridge_currentX;

	private float cartridge_currentY;

	private float cartridge_currentZ;

	private bool ready1 = true;

	private bool ready2 = true;

	private GameObject follower_root;

	private GameObject[] FollowerObjectList;

	private float follower_currentX;

	private float follower_currentY;

	private float follower_currentZ;

	[MenuItem("Window/Magazine Helper")]
	public static void ShowWindow()
	{
		EditorWindow.GetWindow(typeof(MagazineHelper));
	}

	private void OnGUI()
	{
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Expected O, but got Unknown
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Expected O, but got Unknown
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Expected O, but got Unknown
		GUILayout.Label("Cartridge Settings", EditorStyles.boldLabel, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		EditorGUIUtility.labelWidth = 300f;
		Magazine = (FVRFireArmMagazine)EditorGUILayout.ObjectField("Magazine", (Object)(object)Magazine, typeof(FVRFireArmMagazine), true, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if ((Object)(object)Magazine == (Object)null)
		{
			EditorGUILayout.HelpBox("Please add Magazine!", (MessageType)3);
			ready1 = false;
		}
		firstCartridge = (GameObject)EditorGUILayout.ObjectField("First Cartridge", (Object)(object)firstCartridge, typeof(GameObject), true, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if ((Object)(object)firstCartridge == (Object)null)
		{
			EditorGUILayout.HelpBox("Please add Reference Cartridge!", (MessageType)3);
			ready1 = false;
		}
		numberOfCartridges = EditorGUILayout.IntField("Number of Cartridges", numberOfCartridges, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (numberOfCartridges <= 0)
		{
			numberOfCartridges = 1;
		}
		mirrorX = EditorGUILayout.Toggle("Is double stacked Magazine (mirror X axis)", mirrorX, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		cartridgeOffsetY = EditorGUILayout.Slider("Cartridge Offset Y", cartridgeOffsetY, -0.1f, 0.1f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		cartridgeOffsetZ = EditorGUILayout.Slider("Cartridge Offset Z", cartridgeOffsetZ, -0.1f, 0.1f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		generateFollowerPoints = EditorGUILayout.BeginToggleGroup("Generate Follower Points", generateFollowerPoints);
		follower = (GameObject)EditorGUILayout.ObjectField("Follower", (Object)(object)follower, typeof(GameObject), true, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if ((Object)(object)follower == (Object)null && generateFollowerPoints)
		{
			EditorGUILayout.HelpBox("Please add Follower!", (MessageType)3);
			ready2 = false;
		}
		useFollowerOffsets = EditorGUILayout.Toggle("Use Follower Offsets", useFollowerOffsets, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (!useFollowerOffsets)
		{
			invertFollowerOffsets = EditorGUILayout.Toggle("Invert Follower Offsets", invertFollowerOffsets, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		}
		else
		{
			invertFollowerOffsets = false;
		}
		if (useFollowerOffsets)
		{
			followerOffsetY = EditorGUILayout.Slider("Follower Offset Y", followerOffsetY, -0.1f, 0.1f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			followerOffsetZ = EditorGUILayout.Slider("Follower Offset Z", followerOffsetZ, -0.1f, 0.1f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		}
		else if (invertFollowerOffsets)
		{
			followerOffsetY = 0f - cartridgeOffsetY;
			followerOffsetZ = 0f - cartridgeOffsetZ;
		}
		else
		{
			followerOffsetY = cartridgeOffsetY;
			followerOffsetZ = cartridgeOffsetZ;
		}
		EditorGUILayout.EndToggleGroup();
		if (ready1 && !generateFollowerPoints)
		{
			if (GUILayout.Button("Add Cartridges", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }))
			{
				AddCartridges();
			}
			if (GUILayout.Button("Clear Cartridges", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }))
			{
				ClearCartridges(all: true);
			}
		}
		else if (ready1 && ready2)
		{
			if (GUILayout.Button("Add Cartridges and FollowerPoints", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }))
			{
				AddCartridges();
				AddFollowerPoints();
			}
			if (GUILayout.Button("Clear Cartridges and FollowerPoints", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }))
			{
				ClearCartridges(all: true);
				ClearFollowerPoints(all: true);
			}
			if (GUILayout.Button("Remove FollowerPoint Visuals", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }))
			{
				RemoveFollowerPointVisuals();
			}
		}
		ready1 = true;
		ready2 = true;
	}

	private void AddCartridges()
	{
		//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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Expected O, but got Unknown
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: 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_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		ClearCartridges();
		CartridgeObjectList = (GameObject[])(object)new GameObject[numberOfCartridges];
		CartridgeMeshFilterList = (MeshFilter[])(object)new MeshFilter[numberOfCartridges];
		CartridgeMeshRendererList = (MeshRenderer[])(object)new MeshRenderer[numberOfCartridges];
		CartridgeObjectList[0] = firstCartridge;
		CartridgeMeshFilterList[0] = firstCartridge.GetComponent<MeshFilter>();
		CartridgeMeshRendererList[0] = firstCartridge.GetComponent<MeshRenderer>();
		cartridge_currentX = firstCartridge.transform.localPosition.x;
		cartridge_currentY = firstCartridge.transform.localPosition.y;
		cartridge_currentZ = firstCartridge.transform.localPosition.z;
		if ((Object)(object)cartridge_root == (Object)null)
		{
			cartridge_root = new GameObject();
			((Object)cartridge_root).name = "Cartridge Root";
			cartridge_root.transform.parent = firstCartridge.transform.parent;
			cartridge_root.transform.localPosition = new Vector3(0f, 0f, 0f);
			cartridge_root.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			cartridge_root.transform.localScale = new Vector3(1f, 1f, 1f);
		}
		Vector3 localPosition = default(Vector3);
		for (int i = 2; i <= numberOfCartridges; i++)
		{
			if (mirrorX)
			{
				cartridge_currentX = 0f - cartridge_currentX;
			}
			cartridge_currentY += cartridgeOffsetY;
			cartridge_currentZ += cartridgeOffsetZ;
			((Vector3)(ref localPosition))..ctor(cartridge_currentX, cartridge_currentY, cartridge_currentZ);
			GameObject val = Object.Instantiate<GameObject>(firstCartridge, cartridge_root.transform);
			((Object)val).name = ((Object)firstCartridge).name + " (" + i + ")";
			val.transform.localPosition = localPosition;
			val.transform.localRotation = firstCartridge.transform.localRotation;
			CartridgeObjectList[i - 1] = val;
			CartridgeMeshFilterList[i - 1] = val.GetComponent<MeshFilter>();
			CartridgeMeshRendererList[i - 1] = val.GetComponent<MeshRenderer>();
		}
		Magazine.DisplayBullets = CartridgeObjectList;
		Magazine.DisplayMeshFilters = CartridgeMeshFilterList;
		Magazine.DisplayRenderers = (Renderer[])(object)CartridgeMeshRendererList;
	}

	private void ClearCartridges(bool all = false)
	{
		if ((Object)(object)cartridge_root != (Object)null)
		{
			int childCount = cartridge_root.transform.childCount;
			for (int num = childCount - 1; num >= 0; num--)
			{
				Object.DestroyImmediate((Object)(object)((Component)cartridge_root.transform.GetChild(num)).gameObject);
			}
			if (all)
			{
				Object.DestroyImmediate((Object)(object)cartridge_root);
			}
		}
	}

	private void AddFollowerPoints()
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: 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_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Expected O, but got Unknown
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: 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_01e8: Unknown result type (might be due to invalid IL or missing references)
		ClearFollowerPoints();
		FollowerObjectList = (GameObject[])(object)new GameObject[numberOfCartridges];
		FollowerObjectList[0] = follower;
		follower_currentX = follower.transform.localPosition.x;
		follower_currentY = follower.transform.localPosition.y;
		follower_currentZ = follower.transform.localPosition.z;
		if ((Object)(object)follower_root == (Object)null)
		{
			follower_root = new GameObject();
			((Object)follower_root).name = "Follower Root";
			follower_root.transform.parent = follower.transform.parent;
			follower_root.transform.localPosition = new Vector3(0f, 0f, 0f);
			follower_root.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			follower_root.transform.localScale = new Vector3(1f, 1f, 1f);
		}
		Vector3 localPosition = default(Vector3);
		for (int i = 2; i <= numberOfCartridges; i++)
		{
			follower_currentY += followerOffsetY;
			follower_currentZ += followerOffsetZ;
			((Vector3)(ref localPosition))..ctor(follower_currentX, follower_currentY, follower_currentZ);
			GameObject val = Object.Instantiate<GameObject>(follower, follower_root.transform);
			((Object)val).name = ((Object)follower).name + " (" + i + ")";
			val.transform.localPosition = localPosition;
			val.transform.localRotation = follower.transform.localRotation;
			FollowerObjectList[i - 1] = val;
		}
	}

	private void ClearFollowerPoints(bool all = false)
	{
		if ((Object)(object)follower_root != (Object)null)
		{
			int childCount = follower_root.transform.childCount;
			for (int num = childCount - 1; num >= 0; num--)
			{
				Object.DestroyImmediate((Object)(object)((Component)follower_root.transform.GetChild(num)).gameObject);
			}
			if (all)
			{
				Object.DestroyImmediate((Object)(object)follower_root);
			}
		}
	}

	private void RemoveFollowerPointVisuals()
	{
		if ((Object)(object)follower_root == (Object)null)
		{
			return;
		}
		GameObject[] followerObjectList = FollowerObjectList;
		foreach (GameObject val in followerObjectList)
		{
			if ((Object)(object)val != (Object)(object)follower)
			{
				MeshRenderer component = val.GetComponent<MeshRenderer>();
				Object.DestroyImmediate((Object)(object)component);
				MeshFilter component2 = val.GetComponent<MeshFilter>();
			}
		}
	}
}
[BepInPlugin("Muzzle.Meloncorp_Reserves_G47_Rifle", "Meloncorp_Reserves_G47_Rifle", "1.0.0")]
[BepInProcess("h3vr.exe")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Meloncorp_Reserves_G47_RiflePlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	private void Awake()
	{
		LoadAssets();
	}

	private void LoadAssets()
	{
		OtherLoader.RegisterDirectLoad(BasePath, "Muzzle.Meloncorp_Reserves_G47_Rifle", "", "", "modmas_item11", "");
	}
}
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class MeshCombiner : MonoBehaviour
{
	private const int Mesh16BitBufferVertexLimit = 65535;

	[SerializeField]
	private bool createMultiMaterialMesh = false;

	[SerializeField]
	private bool combineInactiveChildren = false;

	[SerializeField]
	private bool deactivateCombinedChildren = true;

	[SerializeField]
	private bool deactivateCombinedChildrenMeshRenderers = false;

	[SerializeField]
	private bool generateUVMap = false;

	[SerializeField]
	private bool destroyCombinedChildren = false;

	[SerializeField]
	private string folderPath = "Prefabs/CombinedMeshes";

	[SerializeField]
	[Tooltip("MeshFilters with Meshes which we don't want to combine into one Mesh.")]
	private MeshFilter[] meshFiltersToSkip = (MeshFilter[])(object)new MeshFilter[0];

	public bool CreateMultiMaterialMesh
	{
		get
		{
			return createMultiMaterialMesh;
		}
		set
		{
			createMultiMaterialMesh = value;
		}
	}

	public bool CombineInactiveChildren
	{
		get
		{
			return combineInactiveChildren;
		}
		set
		{
			combineInactiveChildren = value;
		}
	}

	public bool DeactivateCombinedChildren
	{
		get
		{
			return deactivateCombinedChildren;
		}
		set
		{
			deactivateCombinedChildren = value;
			CheckDeactivateCombinedChildren();
		}
	}

	public bool DeactivateCombinedChildrenMeshRenderers
	{
		get
		{
			return deactivateCombinedChildrenMeshRenderers;
		}
		set
		{
			deactivateCombinedChildrenMeshRenderers = value;
			CheckDeactivateCombinedChildren();
		}
	}

	public bool GenerateUVMap
	{
		get
		{
			return generateUVMap;
		}
		set
		{
			generateUVMap = value;
		}
	}

	public bool DestroyCombinedChildren
	{
		get
		{
			return destroyCombinedChildren;
		}
		set
		{
			destroyCombinedChildren = value;
			CheckDestroyCombinedChildren();
		}
	}

	public string FolderPath
	{
		get
		{
			return folderPath;
		}
		set
		{
			folderPath = value;
		}
	}

	private void CheckDeactivateCombinedChildren()
	{
		if (deactivateCombinedChildren || deactivateCombinedChildrenMeshRenderers)
		{
			destroyCombinedChildren = false;
		}
	}

	private void CheckDestroyCombinedChildren()
	{
		if (destroyCombinedChildren)
		{
			deactivateCombinedChildren = false;
			deactivateCombinedChildrenMeshRenderers = false;
		}
	}

	public void CombineMeshes(bool showCreatedMeshInfo)
	{
		//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_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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: 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_005d: 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_007d: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		Vector3 localScale = ((Component)this).transform.localScale;
		int siblingIndex = ((Component)this).transform.GetSiblingIndex();
		Transform parent = ((Component)this).transform.parent;
		((Component)this).transform.parent = null;
		Quaternion rotation = ((Component)this).transform.rotation;
		Vector3 position = ((Component)this).transform.position;
		Vector3 localScale2 = ((Component)this).transform.localScale;
		((Component)this).transform.rotation = Quaternion.identity;
		((Component)this).transform.position = Vector3.zero;
		((Component)this).transform.localScale = Vector3.one;
		if (!createMultiMaterialMesh)
		{
			CombineMeshesWithSingleMaterial(showCreatedMeshInfo);
		}
		else
		{
			CombineMeshesWithMutliMaterial(showCreatedMeshInfo);
		}
		((Component)this).transform.rotation = rotation;
		((Component)this).transform.position = position;
		((Component)this).transform.localScale = localScale2;
		((Component)this).transform.parent = parent;
		((Component)this).transform.SetSiblingIndex(siblingIndex);
		((Component)this).transform.localScale = localScale;
	}

	private MeshFilter[] GetMeshFiltersToCombine()
	{
		MeshFilter[] meshFilters = ((Component)this).GetComponentsInChildren<MeshFilter>(combineInactiveChildren);
		meshFiltersToSkip = meshFiltersToSkip.Where((MeshFilter meshFilter) => (Object)(object)meshFilter != (Object)(object)meshFilters[0]).ToArray();
		meshFiltersToSkip = meshFiltersToSkip.Where((MeshFilter meshFilter) => (Object)(object)meshFilter != (Object)null).ToArray();
		for (int i = 0; i < meshFiltersToSkip.Length; i++)
		{
			meshFilters = meshFilters.Where((MeshFilter meshFilter) => (Object)(object)meshFilter != (Object)(object)meshFiltersToSkip[i]).ToArray();
		}
		return meshFilters;
	}

	private void CombineMeshesWithSingleMaterial(bool showCreatedMeshInfo)
	{
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Expected O, but got Unknown
		MeshFilter[] meshFiltersToCombine = GetMeshFiltersToCombine();
		CombineInstance[] array = (CombineInstance[])(object)new CombineInstance[meshFiltersToCombine.Length - 1];
		long num = 0L;
		for (int i = 0; i < meshFiltersToCombine.Length - 1; i++)
		{
			((CombineInstance)(ref array[i])).subMeshIndex = 0;
			((CombineInstance)(ref array[i])).mesh = meshFiltersToCombine[i + 1].sharedMesh;
			((CombineInstance)(ref array[i])).transform = ((Component)meshFiltersToCombine[i + 1]).transform.localToWorldMatrix;
			num += ((CombineInstance)(ref array[i])).mesh.vertices.Length;
		}
		MeshRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<MeshRenderer>(combineInactiveChildren);
		if (componentsInChildren.Length >= 2)
		{
			((Renderer)componentsInChildren[0]).sharedMaterials = (Material[])(object)new Material[1];
			((Renderer)componentsInChildren[0]).sharedMaterial = ((Renderer)componentsInChildren[1]).sharedMaterial;
		}
		else
		{
			((Renderer)componentsInChildren[0]).sharedMaterials = (Material[])(object)new Material[0];
		}
		Mesh val = new Mesh();
		((Object)val).name = ((Object)this).name;
		if (num <= 65535)
		{
			val.CombineMeshes(array);
			GenerateUV(val);
			meshFiltersToCombine[0].sharedMesh = val;
			DeactivateCombinedGameObjects(meshFiltersToCombine);
			if (showCreatedMeshInfo)
			{
				Debug.Log((object)("<color=#00cc00><b>Mesh \"" + ((Object)this).name + "\" was created from " + array.Length + " children meshes and has " + num + " vertices.</b></color>"));
			}
		}
		else if (showCreatedMeshInfo)
		{
			Debug.Log((object)("<color=red><b>The mesh vertex limit is 65535! The created mesh had " + num + " vertices. Upgrade Unity version to 2017.3 or higher to avoid this limit (some old devices, like Android with Mali-400 GPU, do not support over 65535 vertices).</b></color>"));
		}
	}

	private void CombineMeshesWithMutliMaterial(bool showCreatedMeshInfo)
	{
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Expected O, but got Unknown
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Expected O, but got Unknown
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: 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_0103: 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_013d: Unknown result type (might be due to invalid IL or missing references)
		MeshFilter[] meshFiltersToCombine = GetMeshFiltersToCombine();
		MeshRenderer[] array = (MeshRenderer[])(object)new MeshRenderer[meshFiltersToCombine.Length];
		array[0] = ((Component)this).GetComponent<MeshRenderer>();
		List<Material> list = new List<Material>();
		for (int i = 0; i < meshFiltersToCombine.Length - 1; i++)
		{
			array[i + 1] = ((Component)meshFiltersToCombine[i + 1]).GetComponent<MeshRenderer>();
			if (!((Object)(object)array[i + 1] != (Object)null))
			{
				continue;
			}
			Material[] sharedMaterials = ((Renderer)array[i + 1]).sharedMaterials;
			for (int j = 0; j < sharedMaterials.Length; j++)
			{
				if (!list.Contains(sharedMaterials[j]))
				{
					list.Add(sharedMaterials[j]);
				}
			}
		}
		List<CombineInstance> list2 = new List<CombineInstance>();
		long num = 0L;
		for (int k = 0; k < list.Count; k++)
		{
			List<CombineInstance> list3 = new List<CombineInstance>();
			for (int l = 0; l < meshFiltersToCombine.Length - 1; l++)
			{
				if (!((Object)(object)array[l + 1] != (Object)null))
				{
					continue;
				}
				Material[] sharedMaterials2 = ((Renderer)array[l + 1]).sharedMaterials;
				for (int m = 0; m < sharedMaterials2.Length; m++)
				{
					if ((Object)(object)list[k] == (Object)(object)sharedMaterials2[m])
					{
						CombineInstance item = default(CombineInstance);
						((CombineInstance)(ref item)).subMeshIndex = m;
						((CombineInstance)(ref item)).mesh = meshFiltersToCombine[l + 1].sharedMesh;
						((CombineInstance)(ref item)).transform = ((Component)meshFiltersToCombine[l + 1]).transform.localToWorldMatrix;
						list3.Add(item);
						num += ((CombineInstance)(ref item)).mesh.vertices.Length;
					}
				}
			}
			Mesh val = new Mesh();
			if (num <= 65535)
			{
				val.CombineMeshes(list3.ToArray(), true);
			}
			CombineInstance item2 = default(CombineInstance);
			((CombineInstance)(ref item2)).subMeshIndex = 0;
			((CombineInstance)(ref item2)).mesh = val;
			((CombineInstance)(ref item2)).transform = Matrix4x4.identity;
			list2.Add(item2);
		}
		((Renderer)array[0]).sharedMaterials = list.ToArray();
		Mesh val2 = new Mesh();
		((Object)val2).name = ((Object)this).name;
		if (num <= 65535)
		{
			val2.CombineMeshes(list2.ToArray(), false);
			GenerateUV(val2);
			meshFiltersToCombine[0].sharedMesh = val2;
			DeactivateCombinedGameObjects(meshFiltersToCombine);
			if (showCreatedMeshInfo)
			{
				Debug.Log((object)("<color=#00cc00><b>Mesh \"" + ((Object)this).name + "\" was created from " + (meshFiltersToCombine.Length - 1) + " children meshes and has " + list2.Count + " submeshes, and " + num + " vertices.</b></color>"));
			}
		}
		else if (showCreatedMeshInfo)
		{
			Debug.Log((object)("<color=red><b>The mesh vertex limit is 65535! The created mesh had " + num + " vertices. Upgrade Unity version to 2017.3 or higher to avoid this limit (some old devices, like Android with Mali-400 GPU, do not support over 65535 vertices).</b></color>"));
		}
	}

	private void DeactivateCombinedGameObjects(MeshFilter[] meshFilters)
	{
		for (int i = 0; i < meshFilters.Length - 1; i++)
		{
			if (!destroyCombinedChildren)
			{
				if (deactivateCombinedChildren)
				{
					((Component)meshFilters[i + 1]).gameObject.SetActive(false);
				}
				if (deactivateCombinedChildrenMeshRenderers)
				{
					MeshRenderer component = ((Component)meshFilters[i + 1]).gameObject.GetComponent<MeshRenderer>();
					if ((Object)(object)component != (Object)null)
					{
						((Renderer)component).enabled = false;
					}
				}
			}
			else
			{
				Object.DestroyImmediate((Object)(object)((Component)meshFilters[i + 1]).gameObject);
			}
		}
	}

	private void GenerateUV(Mesh combinedMesh)
	{
		//IL_000f: 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)
		if (generateUVMap)
		{
			UnwrapParam val = default(UnwrapParam);
			UnwrapParam.SetDefaults(ref val);
			Unwrapping.GenerateSecondaryUVSet(combinedMesh, val);
		}
	}
}
[ExecuteInEditMode]
public class PostEffectScript : MonoBehaviour
{
	public Material mat;

	private void OnRenderImage(RenderTexture src, RenderTexture dest)
	{
		Graphics.Blit((Texture)(object)src, dest, mat);
	}
}
[ExecuteInEditMode]
public class NightVisionPostEffect : MonoBehaviour
{
	public Material nightVisionMat;

	public Material bloom;

	public bool renderNightVision = true;

	public bool renderBloom = true;

	[Range(1f, 16f)]
	public int iterations = 1;

	private const int BoxDownPrefilterPass = 0;

	private const int BoxDownPass = 1;

	private const int BoxUpPass = 2;

	private const int ApplyBloomPass = 3;

	private RenderTexture[] textures = (RenderTexture[])(object)new RenderTexture[16];

	private void OnRenderImage(RenderTexture src, RenderTexture dest)
	{
		//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_001d: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
		int num = ((Texture)src).width / 2;
		int num2 = ((Texture)src).height / 2;
		RenderTextureFormat format = src.format;
		RenderTexture val = RenderTexture.GetTemporary(num, num2, 0, format);
		if (renderNightVision)
		{
			Graphics.Blit((Texture)(object)src, val, nightVisionMat);
		}
		else
		{
			val = src;
		}
		if (!renderBloom)
		{
			Graphics.Blit((Texture)(object)val, dest);
			RenderTexture.ReleaseTemporary(val);
			return;
		}
		RenderTexture val2 = (textures[0] = RenderTexture.GetTemporary(num, num2, 0, format));
		Graphics.Blit((Texture)(object)val, val2, bloom, 0);
		RenderTexture val3 = val2;
		for (int i = 1; i < iterations; i++)
		{
			num /= 2;
			num2 /= 2;
			if (num2 < 2)
			{
				break;
			}
			val2 = (textures[i] = RenderTexture.GetTemporary(num, num2, 0, format));
			Graphics.Blit((Texture)(object)val3, val2, bloom, 1);
			val3 = val2;
		}
		for (int num3 = iterations - 2; num3 >= 0; num3--)
		{
			val2 = textures[num3];
			textures[num3] = null;
			Graphics.Blit((Texture)(object)val3, val2, bloom, 2);
			RenderTexture.ReleaseTemporary(val3);
			val3 = val2;
		}
		bloom.SetTexture("_SourceTex", (Texture)(object)val);
		Graphics.Blit((Texture)(object)val3, dest, bloom, 3);
		RenderTexture.ReleaseTemporary(val3);
		RenderTexture.ReleaseTemporary(val);
	}
}

Modul_VAL_2_Modmas.dll

Decompiled a week 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 OtherLoader;
using Sodalite.Api;
using UnityEngine;
using UnityEngine.UI;

[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 MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace NotWolfie.Modul_VAL_2_Modmas
{
	[BepInPlugin("NotWolfie.Modul_VAL_2_Modmas", "Modul_VAL_2_Modmas", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	[BepInDependency("h3vr.cityrobo.ModularWorkshopManager", "1.0.0")]
	[BepInDependency("nrgill28.Sodalite", "1.4.1")]
	public class Modul_VAL_2_ModmasPlugin : 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(), "NotWolfie.Modul_VAL_2_Modmas");
			OtherLoader.RegisterDirectLoad(BasePath, "NotWolfie.Modul_VAL_2_Modmas", "", "", "modmas2024_item22", "");
			GameAPI.PreloadAllAssets(Path.Combine(BasePath, "mw_modul_val_2_modmas"));
		}
	}
}
namespace H3VRUtils.Vehicles
{
	public class ButtonIgnition : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public VehicleAudioSet audioSet;

		public float ignitionTime;

		private float m_it;

		public float failChance;

		public Random rand;

		public void Start()
		{
			rand = new Random();
		}

		public void BeginInteraction(FVRViveHand hand)
		{
			m_it = ignitionTime;
			if (!vehicle.isOn)
			{
				if (vehicle.isForciblyOff)
				{
				}
			}
			else
			{
				vehicle.TurnOffEngine(forcibly: false);
			}
		}

		public void UpdateInteraction(FVRViveHand hand)
		{
			m_it -= Time.fixedDeltaTime;
			if (m_it <= 0f)
			{
				float num = (float)rand.Next(0, 10000) / 100f;
				if (!(num <= failChance))
				{
					vehicle.TurnOnEngine(forcibly: false);
				}
			}
		}
	}
}
namespace H3VRUtils.Vehicles.Core
{
	public class DamagingArea : MonoBehaviour
	{
		public VehicleControl vehicle;

		public float damageMult = 15f;

		public float sharpyness = 50f;
	}
}
namespace H3VRUtils.Vehicles
{
	[Serializable]
	public class DriveShiftNode
	{
		public Vector3 localposition;

		public Vector3 rotation;

		public int left = -1;

		public int up = -1;

		public int right = -1;

		public int down = -1;

		public int gear = 0;
	}
	public class DriveShift : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public Text gearText;

		public int currentNode;

		public List<DriveShiftNode> driveShiftNodes;

		public VehicleAudioSet audioSet;

		public void Update()
		{
			if (vehicle.carSetting.automaticGear)
			{
				if (vehicle.currentGear > 0 && vehicle.speed > 1f)
				{
					gearText.text = vehicle.currentGear.ToString();
				}
				else if (vehicle.speed > 1f)
				{
					gearText.text = "R";
				}
				else
				{
					gearText.text = "N";
				}
			}
			else if (vehicle.NeutralGear)
			{
				gearText.text = "N";
			}
			else if (vehicle.currentGear != 0)
			{
				gearText.text = vehicle.currentGear.ToString();
			}
			else
			{
				gearText.text = "R";
			}
		}

		public void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0009: 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_0090: 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_0117: 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_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_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].left != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].left;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].up != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].up;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].right != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].right;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].down != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].down;
			}
			if (flag)
			{
				vehicle.ShiftTo(driveShiftNodes[currentNode].gear);
				((Component)this).transform.localPosition = driveShiftNodes[currentNode].localposition;
				((Component)this).transform.localEulerAngles = driveShiftNodes[currentNode].rotation;
			}
		}
	}
	internal class EngineDamagable : VehicleDamagable
	{
		public GameObject particleSystemCentre;

		public GameObject explosionCentre;

		public float SmokeParticleHPThreshold;

		public float explosionStrength = 200f;

		public GameObject particleSmokePrefab;

		public GameObject particleFirePrefab;

		public GameObject explosionPrefab;

		public GameObject fixedMesh;

		public GameObject damagedMesh;

		public GameObject destroyedMesh;

		private ParticleSystem particleSmoke;

		private ParticleSystem particleFire;

		public void Start()
		{
			GameObject val = Object.Instantiate<GameObject>(particleSmokePrefab, particleSystemCentre.transform);
			particleSmoke = val.GetComponent<ParticleSystem>();
			particleSmoke.Stop();
			GameObject val2 = Object.Instantiate<GameObject>(particleFirePrefab, particleSystemCentre.transform);
			particleFire = val2.GetComponent<ParticleSystem>();
			particleFire.Stop();
		}

		public override void onHealthChange()
		{
			if (HPLessThanPercent(SmokeParticleHPThreshold))
			{
				if (!particleSmoke.IsAlive())
				{
					particleSmoke.Play();
				}
			}
			else
			{
				particleSmoke.Stop();
			}
			if (health < 0f)
			{
				fixedMesh.SetActive(false);
				damagedMesh.SetActive(false);
				destroyedMesh.SetActive(true);
			}
			else if (HPLessThanPercent(SmokeParticleHPThreshold))
			{
				fixedMesh.SetActive(false);
				damagedMesh.SetActive(true);
				destroyedMesh.SetActive(false);
			}
			else
			{
				fixedMesh.SetActive(true);
				damagedMesh.SetActive(false);
				destroyedMesh.SetActive(false);
			}
		}

		public override void onDeath()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			particleFire.Play();
			if ((Object)(object)explosionPrefab != (Object)null)
			{
				Object.Instantiate<GameObject>(explosionPrefab, explosionCentre.transform.position, explosionCentre.transform.rotation);
			}
		}

		public override void whileDead()
		{
		}

		public override void whileUndead()
		{
		}

		public override void Heal(float heal)
		{
			base.Heal(heal);
		}

		public override void HealPercent(float percentHeal)
		{
			base.HealPercent(percentHeal);
		}

		public override void onUndeath()
		{
			particleFire.Stop();
		}

		public override void Damage()
		{
		}
	}
	internal class EnterVehicle : FVRInteractiveObject
	{
		public VehicleSeat vehicleSeat;
	}
	internal class ForkliftLift : FVRInteractiveObject
	{
		public Vector3 rotUpwards;

		public Vector3 rotRegular;

		public Vector3 rotDownwards;

		public GameObject lift;

		public float liftSpeed;

		public float minLiftY;

		public float maxLiftY;

		public void UpdateInteraction(FVRViveHand hand)
		{
			//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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_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_008e: 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_0104: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = lift.transform.position;
			((Component)this).transform.localEulerAngles = rotRegular;
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f)
			{
				position.y += liftSpeed / 50f;
				((Component)this).transform.localEulerAngles = rotUpwards;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f)
			{
				position.y -= liftSpeed / 50f;
				((Component)this).transform.localEulerAngles = rotDownwards;
			}
			if (position.y > maxLiftY)
			{
				position.y = maxLiftY;
			}
			else if (position.y < minLiftY)
			{
				position.y = minLiftY;
			}
			lift.transform.position = position;
		}
	}
	public class FuelNeedle : MonoBehaviour
	{
		public FuelTank tank;

		public GameObject needle;

		public bool isImperial;

		public Vector3 needleNoFuel;

		public Vector3 needleMaxFuel;

		public void Update()
		{
			//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_004f: Unknown result type (might be due to invalid IL or missing references)
			float num = tank.currentFuel;
			if (isImperial)
			{
				num *= 0.6213712f;
			}
			float num2 = Mathf.InverseLerp(0f, tank.maxFuel, num);
			needle.transform.localEulerAngles = Vector3.Lerp(needleNoFuel, needleMaxFuel, num2);
		}
	}
	public class FuelTank : VehicleDamagable
	{
		public float currentFuel;

		public float maxFuel;

		public float fuelUsagePer1000Rpm = 0.01f;

		public float leakMult;

		public GameObject explosionEffect;

		public bool BlowsOnDeath;

		public AudioSource leakSound;

		private new void FixedUpdate()
		{
			base.FixedUpdate();
			float num = vehicle.motorRPM / 1000f;
			float num2 = num * (fuelUsagePer1000Rpm / 3000f);
			currentFuel -= num2;
			float num3 = Mathf.InverseLerp(maxHealth, 0f, health);
			currentFuel -= num3 * leakMult / 50f;
			if ((Object)(object)leakSound != (Object)null)
			{
				leakSound.volume = num3;
			}
		}

		public override void onDeath()
		{
			//IL_001f: 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)
			base.onDeath();
			if (BlowsOnDeath)
			{
				Object.Instantiate<GameObject>(explosionEffect, ((Component)this).transform.position, ((Component)this).transform.rotation);
			}
		}

		public float AddFuel(float fuelAdded)
		{
			currentFuel += fuelAdded;
			float num = maxFuel - currentFuel;
			if (num <= 0f)
			{
				return 0f;
			}
			return num;
		}
	}
}
namespace H3VRUtils
{
	internal class LockGun : MonoBehaviour
	{
		public FVRPhysicalObject Firearm;

		public GameObject LockPos;

		public void Update()
		{
		}
	}
}
namespace H3VRUtils.Vehicles
{
	public class ParkingBrakeClick : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public Vector3 positionOff;

		public Vector3 positionOn;

		public Vector3 rotationOff;

		public Vector3 rotationOn;

		public bool isOn;

		public VehicleAudioSet audioSet;
	}
	public class SpedometerNeedle : MonoBehaviour
	{
		public VehicleControl vehicle;

		public GameObject needle;

		public bool isImperial;

		public float maxSpeed;

		public Vector3 needleNoSpeed;

		public Vector3 needleMaxSpeed;

		public void Update()
		{
			//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_004f: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Abs(vehicle.speed);
			if (isImperial)
			{
				num *= 0.6213712f;
			}
			float num2 = Mathf.InverseLerp(0f, maxSpeed, num);
			needle.transform.localEulerAngles = Vector3.Lerp(needleNoSpeed, needleMaxSpeed, num2);
		}
	}
	internal class SteeringWheel : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public float resetLerpSpeed;

		public float maxRot;

		public bool isBraking;

		public bool reverseRot;

		[Header("Debug Values")]
		public Text rotText;

		public float rot;

		public float rh;

		public float lr;

		public float inlerp;

		public float lerp;

		public float rotAmt;

		public VehicleAudioSet audioSet;

		public void BeginInteraction(FVRViveHand hand)
		{
			//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_0045: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			Transform child = ((Component)this).transform.GetChild(0);
			child.parent = null;
			Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
			((Component)this).transform.LookAt(((Component)hand).transform);
			((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, localEulerAngles.z);
			child.parent = ((Component)this).transform;
		}

		public void EndInteraction(FVRViveHand hand)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_003e: 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)
			Transform child = ((Component)this).transform.GetChild(0);
			child.parent = null;
			((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, 0f, ((Component)this).transform.localEulerAngles.z);
			child.parent = ((Component)this).transform;
		}

		public void UpdateInteraction(FVRViveHand hand)
		{
			//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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_00e2: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: 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)
			Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
			((Component)this).transform.LookAt(((Component)hand).transform);
			Vector3 localEulerAngles2 = ((Component)this).transform.localEulerAngles;
			rot = Mathf.DeltaAngle((float)Math.Round(localEulerAngles2.y), (float)Math.Round(localEulerAngles.y));
			rotAmt += rot;
			if (rotAmt >= maxRot)
			{
				rotAmt = maxRot;
				((Component)this).transform.localEulerAngles = localEulerAngles;
			}
			else if (rotAmt <= 0f - maxRot)
			{
				rotAmt = 0f - maxRot;
				((Component)this).transform.localEulerAngles = localEulerAngles;
			}
			else
			{
				((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles2.y, localEulerAngles.z);
			}
			rh = localEulerAngles2.y;
			lr = localEulerAngles.y;
			SetRot();
			if (Vector2.Angle(hand.Input.TouchpadAxes, -Vector2.up) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.3f)
			{
				isBraking = !isBraking;
			}
			float triggerFloat = hand.Input.TriggerFloat;
			if (isBraking)
			{
				vehicle.accel = 0f - triggerFloat;
			}
			else
			{
				vehicle.accel = triggerFloat;
			}
		}

		private void FixedUpdate()
		{
			//IL_0061: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.m_hand != (Object)null)
			{
				float num = resetLerpSpeed;
				if (rotAmt > 0f)
				{
					num = 0f - num;
				}
				if (rotAmt > num || rotAmt < 0f - num)
				{
					rotAmt += num;
					((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, ((Component)this).transform.localEulerAngles.y + num, ((Component)this).transform.localEulerAngles.z);
					vehicle.accel = 0f;
					SetRot();
				}
			}
		}

		private void SetRot()
		{
			if (rotAmt > 0f)
			{
				inlerp = Mathf.InverseLerp(0f, maxRot, rotAmt);
				lerp = 0f - Mathf.Lerp(0f, 1f, inlerp);
			}
			else
			{
				inlerp = Mathf.InverseLerp(0f, 0f - maxRot, rotAmt);
				lerp = Mathf.Lerp(0f, 1f, inlerp);
			}
			if (reverseRot)
			{
				lerp = 0f - lerp;
			}
			vehicle.steer = lerp;
		}
	}
	[CreateAssetMenu(fileName = "New Vehicle Audio Set", menuName = "Vehicles/AudioSet", order = 0)]
	public class VehicleAudioSet : ScriptableObject
	{
		private static AudioEvent defaultAE;

		public AudioEvent VehicleStart;

		public AudioEvent VehicleIdle;

		public AudioEvent VehicleStop;

		public AudioEvent HandbrakeUp;

		public AudioEvent HandbrakeDown;

		public AudioEvent ShiftDownGear;

		public AudioEvent RevLoop;

		public AudioEvent ShiftUpGear;

		public AudioEvent Brake;

		public AudioEvent BrakeLong;

		public AudioEvent PedalSwitchSound;

		static VehicleAudioSet()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			AudioEvent val = new AudioEvent();
			val.PitchRange = new Vector2(0.98f, 1.04f);
			val.VolumeRange = new Vector2(0.98f, 1.04f);
			val.ClipLengthRange = new Vector2(1f, 1f);
			defaultAE = val;
		}
	}
}
public enum ControlMode
{
	simple = 1,
	touch
}
public class VehicleControl : MonoBehaviour
{
	[Serializable]
	public class CarWheels
	{
		public ConnectWheel wheels;
	}

	[Serializable]
	public class ConnectWheel
	{
		public bool frontWheelDrive = true;

		public Transform frontRight;

		public Transform frontLeft;

		public WheelSetting frontSetting;

		public bool backWheelDrive = true;

		public Transform backRight;

		public Transform backLeft;

		public WheelSetting rearSetting;
	}

	[Serializable]
	public class WheelSetting
	{
		public float Radius = 0.4f;

		public float Weight = 1000f;

		public float Distance = 0.2f;
	}

	[Serializable]
	public class CarLights
	{
		public Light[] brakeLights;

		public Light[] reverseLights;
	}

	[Serializable]
	public class CarSounds
	{
		public AudioSource IdleEngine;

		public AudioSource LowEngine;

		public AudioSource HighEngine;

		public float minPitch = 1f;

		public float maxPitch = 10f;

		public AudioSource nitro;

		public AudioSource switchGear;
	}

	[Serializable]
	public class CarParticles
	{
		public GameObject brakeParticlePerfab;

		public ParticleSystem shiftParticle1;

		public ParticleSystem shiftParticle2;

		private GameObject[] wheelParticle = (GameObject[])(object)new GameObject[4];
	}

	[Serializable]
	public class CarSetting
	{
		public bool showNormalGizmos = false;

		public Transform carSteer;

		public HitGround[] hitGround;

		public List<Transform> cameraSwitchView;

		public float springs = 25000f;

		public float dampers = 1500f;

		public float carPower = 120f;

		public float shiftPower = 150f;

		public float brakePower = 8000f;

		public Vector3 shiftCentre = new Vector3(0f, -0.8f, 0f);

		public float maxSteerAngle = 25f;

		public float shiftDownRPM = 1500f;

		public float shiftUpRPM = 2500f;

		public float idleRPM = 500f;

		public float stiffness = 2f;

		public bool automaticGear = true;

		public float[] gears = new float[6] { -10f, 9f, 6f, 4.5f, 3f, 2.5f };

		public float LimitBackwardSpeed = 60f;

		public float LimitForwardSpeed = 220f;
	}

	[Serializable]
	public class HitGround
	{
		public string tag = "street";

		public bool grounded = false;

		public AudioClip brakeSound;

		public AudioClip groundSound;

		public Color brakeColor;
	}

	private class WheelComponent
	{
		public Transform wheel;

		public WheelCollider collider;

		public Vector3 startPos;

		public float rotation = 0f;

		public float rotation2 = 0f;

		public float maxSteer;

		public bool drive;

		public float pos_y = 0f;

		public WheelSetting settings;
	}

	public ControlMode controlMode = ControlMode.simple;

	public bool activeControl = false;

	public CarWheels carWheels;

	public CarLights carLights;

	public CarSounds carSounds;

	public CarParticles carParticles;

	public CarSetting carSetting;

	[HideInInspector]
	public float steer = 0f;

	[HideInInspector]
	public float accel = 0f;

	[HideInInspector]
	public bool brake;

	private bool shifmotor;

	[HideInInspector]
	public float curTorque = 100f;

	[HideInInspector]
	public float powerShift = 100f;

	[HideInInspector]
	public bool shift;

	private float torque = 100f;

	[HideInInspector]
	public float speed = 0f;

	private float lastSpeed = -10f;

	private bool shifting = false;

	private float[] efficiencyTable = new float[22]
	{
		0.6f, 0.65f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 1f, 1f, 0.95f,
		0.8f, 0.7f, 0.6f, 0.5f, 0.45f, 0.4f, 0.36f, 0.33f, 0.3f, 0.2f,
		0.1f, 0.05f
	};

	private float efficiencyTableStep = 250f;

	private float Pitch;

	private float PitchDelay;

	private float shiftTime = 0f;

	private float shiftDelay = 0f;

	[HideInInspector]
	public int currentGear = 0;

	[HideInInspector]
	public bool NeutralGear = true;

	[HideInInspector]
	public float motorRPM = 0f;

	[HideInInspector]
	public bool Backward = false;

	[HideInInspector]
	public float accelFwd = 0f;

	[HideInInspector]
	public float accelBack = 0f;

	[HideInInspector]
	public float steerAmount = 0f;

	private float wantedRPM = 0f;

	private float w_rotate;

	private float slip;

	private float slip2 = 0f;

	private GameObject[] Particle = (GameObject[])(object)new GameObject[4];

	private Vector3 steerCurAngle;

	private Rigidbody myRigidbody;

	private WheelComponent[] wheels;

	public bool isOn = true;

	public bool isForciblyOff = false;

	private WheelComponent SetWheelComponent(Transform wheel, float maxSteer, bool drive, float pos_y, WheelSetting setting)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		//IL_0035: 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_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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		WheelComponent wheelComponent = new WheelComponent();
		GameObject val = new GameObject(((Object)wheel).name + "WheelCollider");
		val.transform.parent = ((Component)this).transform;
		val.transform.position = wheel.position;
		val.transform.eulerAngles = ((Component)this).transform.eulerAngles;
		pos_y = val.transform.localPosition.y;
		WheelCollider val2 = (WheelCollider)val.AddComponent(typeof(WheelCollider));
		wheelComponent.wheel = wheel;
		wheelComponent.collider = val.GetComponent<WheelCollider>();
		wheelComponent.drive = drive;
		wheelComponent.pos_y = pos_y;
		wheelComponent.maxSteer = maxSteer;
		wheelComponent.startPos = val.transform.localPosition;
		wheelComponent.settings = setting;
		return wheelComponent;
	}

	private void Awake()
	{
		//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_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_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_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_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: 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_0228: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		if (carSetting.automaticGear)
		{
			NeutralGear = false;
		}
		myRigidbody = ((Component)((Component)this).transform).GetComponent<Rigidbody>();
		wheels = new WheelComponent[4];
		wheels[0] = SetWheelComponent(carWheels.wheels.frontRight, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontRight.position.y, carWheels.wheels.frontSetting);
		wheels[1] = SetWheelComponent(carWheels.wheels.frontLeft, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontLeft.position.y, carWheels.wheels.frontSetting);
		wheels[2] = SetWheelComponent(carWheels.wheels.backRight, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backRight.position.y, carWheels.wheels.rearSetting);
		wheels[3] = SetWheelComponent(carWheels.wheels.backLeft, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backLeft.position.y, carWheels.wheels.rearSetting);
		if (Object.op_Implicit((Object)(object)carSetting.carSteer))
		{
			steerCurAngle = carSetting.carSteer.localEulerAngles;
		}
		WheelComponent[] array = wheels;
		foreach (WheelComponent wheelComponent in array)
		{
			WheelCollider collider = wheelComponent.collider;
			collider.suspensionDistance = wheelComponent.settings.Distance;
			JointSpring suspensionSpring = collider.suspensionSpring;
			suspensionSpring.spring = carSetting.springs;
			suspensionSpring.damper = carSetting.dampers;
			collider.suspensionSpring = suspensionSpring;
			collider.radius = wheelComponent.settings.Radius;
			collider.mass = wheelComponent.settings.Weight;
			WheelFrictionCurve val = collider.forwardFriction;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 5000f;
			((WheelFrictionCurve)(ref val)).extremumSlip = 2f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 20f;
			((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness;
			collider.forwardFriction = val;
			val = collider.sidewaysFriction;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 7500f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 2f;
			((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness;
			collider.sidewaysFriction = val;
		}
	}

	public void TurnOnEngine(bool forcibly)
	{
		if (!isForciblyOff)
		{
			isOn = true;
		}
		else if (forcibly)
		{
			isForciblyOff = false;
			isOn = true;
		}
	}

	public void TurnOffEngine(bool forcibly)
	{
		isForciblyOff = forcibly;
		isOn = false;
	}

	public void ShiftTo(int newGear)
	{
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		currentGear = newGear;
		if (currentGear == 0)
		{
			NeutralGear = true;
		}
		else
		{
			NeutralGear = false;
		}
		if (currentGear == -1)
		{
			currentGear = 0;
		}
	}

	public void ShiftUp(bool ignoreDelay)
	{
		float timeSinceLevelLoad = Time.timeSinceLevelLoad;
		if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || currentGear >= carSetting.gears.Length - 1)
		{
			return;
		}
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		if (!carSetting.automaticGear)
		{
			if (currentGear == 0)
			{
				if (NeutralGear)
				{
					currentGear++;
					NeutralGear = false;
				}
				else
				{
					NeutralGear = true;
				}
			}
			else
			{
				currentGear++;
			}
		}
		else
		{
			currentGear++;
		}
		shiftDelay = timeSinceLevelLoad + 1f;
		shiftTime = 1.5f;
	}

	public void ShiftDown(bool ignoreDelay)
	{
		float timeSinceLevelLoad = Time.timeSinceLevelLoad;
		if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || (currentGear <= 0 && !NeutralGear))
		{
			return;
		}
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		if (!carSetting.automaticGear)
		{
			if (currentGear == 1)
			{
				if (!NeutralGear)
				{
					currentGear--;
					NeutralGear = true;
				}
			}
			else if (currentGear == 0)
			{
				NeutralGear = false;
			}
			else
			{
				currentGear--;
			}
		}
		else
		{
			currentGear--;
		}
		shiftDelay = timeSinceLevelLoad + 0.1f;
		shiftTime = 2f;
	}

	private void OnCollisionEnter(Collision collision)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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_0092: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: 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)((Component)collision.transform.root).GetComponent<VehicleControl>()))
		{
			VehicleControl component = ((Component)collision.transform.root).GetComponent<VehicleControl>();
			Vector3 relativeVelocity = collision.relativeVelocity;
			component.slip2 = Mathf.Clamp(((Vector3)(ref relativeVelocity)).magnitude, 0f, 10f);
			myRigidbody.angularVelocity = new Vector3((0f - myRigidbody.angularVelocity.x) * 0.5f, myRigidbody.angularVelocity.y * 0.5f, (0f - myRigidbody.angularVelocity.z) * 0.5f);
			myRigidbody.velocity = new Vector3(myRigidbody.velocity.x, myRigidbody.velocity.y * 0.5f, myRigidbody.velocity.z);
		}
	}

	private void OnCollisionStay(Collision collision)
	{
		if (Object.op_Implicit((Object)(object)((Component)collision.transform.root).GetComponent<VehicleControl>()))
		{
			((Component)collision.transform.root).GetComponent<VehicleControl>().slip2 = 5f;
		}
	}

	private void Update()
	{
	}

	private void FixedUpdate()
	{
		//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_00b6: 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_0704: Unknown result type (might be due to invalid IL or missing references)
		//IL_0709: Unknown result type (might be due to invalid IL or missing references)
		//IL_0751: Unknown result type (might be due to invalid IL or missing references)
		//IL_075a: Unknown result type (might be due to invalid IL or missing references)
		//IL_075f: Unknown result type (might be due to invalid IL or missing references)
		//IL_079b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0acf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ee6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ef2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f0c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f17: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f25: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b3b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d23: Unknown result type (might be due to invalid IL or missing references)
		if (!isOn)
		{
			accel = 0f;
		}
		Vector3 velocity = myRigidbody.velocity;
		speed = ((Vector3)(ref velocity)).magnitude * 2.7f;
		if (speed < lastSpeed - 10f && slip < 10f)
		{
			slip = lastSpeed / 15f;
		}
		lastSpeed = speed;
		if (slip2 != 0f)
		{
			slip2 = Mathf.MoveTowards(slip2, 0f, 0.1f);
		}
		myRigidbody.centerOfMass = carSetting.shiftCentre;
		if (!carWheels.wheels.frontWheelDrive && !carWheels.wheels.backWheelDrive)
		{
			accel = 0f;
		}
		if (Object.op_Implicit((Object)(object)carSetting.carSteer))
		{
			carSetting.carSteer.localEulerAngles = new Vector3(steerCurAngle.x, steerCurAngle.y, steerCurAngle.z + steer * -120f);
		}
		if (carSetting.automaticGear && currentGear == 1 && accel < 0f)
		{
			if (speed < 5f)
			{
				ShiftDown(ignoreDelay: false);
			}
		}
		else if (carSetting.automaticGear && currentGear == 0 && accel > 0f)
		{
			if (speed < 5f)
			{
				ShiftUp(ignoreDelay: false);
			}
		}
		else if (carSetting.automaticGear && motorRPM > carSetting.shiftUpRPM && accel > 0f && speed > 10f && !brake)
		{
			ShiftUp(ignoreDelay: false);
		}
		else if (carSetting.automaticGear && motorRPM < carSetting.shiftDownRPM && currentGear > 1)
		{
			ShiftDown(ignoreDelay: false);
		}
		if (speed < 1f)
		{
			Backward = true;
		}
		if (currentGear != 0 || !Backward)
		{
			Backward = false;
		}
		Light[] brakeLights = carLights.brakeLights;
		foreach (Light val in brakeLights)
		{
			if (brake || accel < 0f || speed < 1f)
			{
				val.intensity = Mathf.MoveTowards(val.intensity, 8f, 0.5f);
			}
			else
			{
				val.intensity = Mathf.MoveTowards(val.intensity, 0f, 0.5f);
			}
			((Behaviour)val).enabled = val.intensity != 0f;
		}
		Light[] reverseLights = carLights.reverseLights;
		foreach (Light val2 in reverseLights)
		{
			if (speed > 2f && currentGear == 0)
			{
				val2.intensity = Mathf.MoveTowards(val2.intensity, 8f, 0.5f);
			}
			else
			{
				val2.intensity = Mathf.MoveTowards(val2.intensity, 0f, 0.5f);
			}
			((Behaviour)val2).enabled = val2.intensity != 0f;
		}
		wantedRPM = 5500f * accel * 0.1f + wantedRPM * 0.9f;
		float num = 0f;
		int num2 = 0;
		bool flag = false;
		int num3 = 0;
		WheelComponent[] array = wheels;
		WheelHit val4 = default(WheelHit);
		foreach (WheelComponent wheelComponent in array)
		{
			WheelCollider collider = wheelComponent.collider;
			if (wheelComponent.drive)
			{
				num = ((!NeutralGear && brake && currentGear < 2) ? (num + accel * carSetting.idleRPM) : (NeutralGear ? (num + carSetting.idleRPM * accel) : (num + collider.rpm)));
				num2++;
			}
			if (brake || accel < 0f)
			{
				if (accel < 0f || (brake && (wheelComponent == wheels[2] || wheelComponent == wheels[3])))
				{
					if (brake && accel > 0f)
					{
						slip = Mathf.Lerp(slip, 5f, accel * 0.01f);
					}
					else if (speed > 1f)
					{
						slip = Mathf.Lerp(slip, 1f, 0.002f);
					}
					else
					{
						slip = Mathf.Lerp(slip, 1f, 0.02f);
					}
					wantedRPM = 0f;
					collider.brakeTorque = carSetting.brakePower;
					wheelComponent.rotation = w_rotate;
				}
			}
			else
			{
				float brakeTorque;
				if (accel == 0f || NeutralGear)
				{
					float num5 = (collider.brakeTorque = 1000f);
					brakeTorque = num5;
				}
				else
				{
					float num5 = (collider.brakeTorque = 0f);
					brakeTorque = num5;
				}
				collider.brakeTorque = brakeTorque;
				slip = ((!(speed > 0f)) ? (slip = Mathf.Lerp(slip, 0.01f, 0.02f)) : ((!(speed > 100f)) ? (slip = Mathf.Lerp(slip, 1.5f, 0.02f)) : (slip = Mathf.Lerp(slip, 1f + Mathf.Abs(steer), 0.02f))));
				w_rotate = wheelComponent.rotation;
			}
			WheelFrictionCurve val3 = collider.forwardFriction;
			((WheelFrictionCurve)(ref val3)).asymptoteValue = 5000f;
			((WheelFrictionCurve)(ref val3)).extremumSlip = 2f;
			((WheelFrictionCurve)(ref val3)).asymptoteSlip = 20f;
			((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2);
			collider.forwardFriction = val3;
			val3 = collider.sidewaysFriction;
			((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2);
			((WheelFrictionCurve)(ref val3)).extremumSlip = 0.2f + Mathf.Abs(steer);
			collider.sidewaysFriction = val3;
			if (shift && currentGear > 1 && speed > 50f && shifmotor && Mathf.Abs(steer) < 0.2f)
			{
				if (powerShift == 0f)
				{
					shifmotor = false;
				}
				powerShift = Mathf.MoveTowards(powerShift, 0f, Time.deltaTime * 10f);
				carSounds.nitro.volume = Mathf.Lerp(carSounds.nitro.volume, 1f, Time.deltaTime * 10f);
				if (!carSounds.nitro.isPlaying)
				{
					((Component)carSounds.nitro).GetComponent<AudioSource>().Play();
				}
				curTorque = ((!(powerShift > 0f)) ? carSetting.carPower : carSetting.shiftPower);
				carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f);
				carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f);
			}
			else
			{
				if (powerShift > 20f)
				{
					shifmotor = true;
				}
				carSounds.nitro.volume = Mathf.MoveTowards(carSounds.nitro.volume, 0f, Time.deltaTime * 2f);
				if (carSounds.nitro.volume == 0f)
				{
					carSounds.nitro.Stop();
				}
				powerShift = Mathf.MoveTowards(powerShift, 100f, Time.deltaTime * 5f);
				curTorque = carSetting.carPower;
				carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, 0f, Time.deltaTime * 10f);
				carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, 0f, Time.deltaTime * 10f);
			}
			wheelComponent.rotation = Mathf.Repeat(wheelComponent.rotation + Time.deltaTime * collider.rpm * 360f / 60f, 360f);
			wheelComponent.rotation2 = Mathf.Lerp(wheelComponent.rotation2, collider.steerAngle, 0.1f);
			wheelComponent.wheel.localRotation = Quaternion.Euler(wheelComponent.rotation, wheelComponent.rotation2, 0f);
			Vector3 localPosition = wheelComponent.wheel.localPosition;
			if (collider.GetGroundHit(ref val4))
			{
				if (Object.op_Implicit((Object)(object)carParticles.brakeParticlePerfab))
				{
					if ((Object)(object)Particle[num3] == (Object)null)
					{
						Particle[num3] = Object.Instantiate<GameObject>(carParticles.brakeParticlePerfab, wheelComponent.wheel.position, Quaternion.identity);
						((Object)Particle[num3]).name = "WheelParticle";
						Particle[num3].transform.parent = ((Component)this).transform;
						Particle[num3].AddComponent<AudioSource>();
						Particle[num3].GetComponent<AudioSource>().maxDistance = 50f;
						Particle[num3].GetComponent<AudioSource>().spatialBlend = 1f;
						Particle[num3].GetComponent<AudioSource>().dopplerLevel = 5f;
						Particle[num3].GetComponent<AudioSource>().rolloffMode = (AudioRolloffMode)2;
					}
					ParticleSystem component = Particle[num3].GetComponent<ParticleSystem>();
					bool flag2 = false;
					for (int l = 0; l < carSetting.hitGround.Length; l++)
					{
						if (((Component)((WheelHit)(ref val4)).collider).CompareTag(carSetting.hitGround[l].tag))
						{
							flag2 = carSetting.hitGround[l].grounded;
							if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.5f) && speed > 1f)
							{
								Particle[num3].GetComponent<AudioSource>().clip = carSetting.hitGround[l].brakeSound;
							}
							else if ((Object)(object)Particle[num3].GetComponent<AudioSource>().clip != (Object)(object)carSetting.hitGround[l].groundSound && !Particle[num3].GetComponent<AudioSource>().isPlaying)
							{
								Particle[num3].GetComponent<AudioSource>().clip = carSetting.hitGround[l].groundSound;
							}
							Particle[num3].GetComponent<ParticleSystem>().startColor = carSetting.hitGround[l].brakeColor;
						}
					}
					if (flag2 && speed > 5f && !brake)
					{
						component.enableEmission = true;
						Particle[num3].GetComponent<AudioSource>().volume = 0.5f;
						if (!Particle[num3].GetComponent<AudioSource>().isPlaying)
						{
							Particle[num3].GetComponent<AudioSource>().Play();
						}
					}
					else if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && speed > 1f)
					{
						if (accel < 0f || ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && (wheelComponent == wheels[2] || wheelComponent == wheels[3])))
						{
							if (!Particle[num3].GetComponent<AudioSource>().isPlaying)
							{
								Particle[num3].GetComponent<AudioSource>().Play();
							}
							component.enableEmission = true;
							Particle[num3].GetComponent<AudioSource>().volume = 10f;
						}
					}
					else
					{
						component.enableEmission = false;
						Particle[num3].GetComponent<AudioSource>().volume = Mathf.Lerp(Particle[num3].GetComponent<AudioSource>().volume, 0f, Time.deltaTime * 10f);
					}
				}
				localPosition.y -= Vector3.Dot(wheelComponent.wheel.position - ((WheelHit)(ref val4)).point, ((Component)this).transform.TransformDirection(0f, 1f, 0f) / ((Component)this).transform.lossyScale.x) - collider.radius;
				localPosition.y = Mathf.Clamp(localPosition.y, -10f, wheelComponent.pos_y);
				flag = flag || wheelComponent.drive;
			}
			else
			{
				if ((Object)(object)Particle[num3] != (Object)null)
				{
					ParticleSystem component2 = Particle[num3].GetComponent<ParticleSystem>();
					component2.enableEmission = false;
				}
				localPosition.y = wheelComponent.startPos.y - wheelComponent.settings.Distance;
				myRigidbody.AddForce(Vector3.down * 5000f);
			}
			num3++;
			wheelComponent.wheel.localPosition = localPosition;
		}
		if (num2 > 1)
		{
			num /= (float)num2;
		}
		motorRPM = 0.95f * motorRPM + 0.05f * Mathf.Abs(num * carSetting.gears[currentGear]);
		if (motorRPM > 5500f)
		{
			motorRPM = 5200f;
		}
		int num7 = (int)(motorRPM / efficiencyTableStep);
		if (num7 >= efficiencyTable.Length)
		{
			num7 = efficiencyTable.Length - 1;
		}
		if (num7 < 0)
		{
			num7 = 0;
		}
		float num8 = curTorque * carSetting.gears[currentGear] * efficiencyTable[num7];
		WheelComponent[] array2 = wheels;
		foreach (WheelComponent wheelComponent2 in array2)
		{
			WheelCollider collider2 = wheelComponent2.collider;
			if (wheelComponent2.drive)
			{
				if (Mathf.Abs(collider2.rpm) > Mathf.Abs(wantedRPM))
				{
					collider2.motorTorque = 0f;
				}
				else
				{
					float motorTorque = collider2.motorTorque;
					if (!brake && accel != 0f && !NeutralGear)
					{
						if ((speed < carSetting.LimitForwardSpeed && currentGear > 0) || (speed < carSetting.LimitBackwardSpeed && currentGear == 0))
						{
							collider2.motorTorque = motorTorque * 0.9f + num8 * 1f;
						}
						else
						{
							collider2.motorTorque = 0f;
							collider2.brakeTorque = 2000f;
						}
					}
					else
					{
						collider2.motorTorque = 0f;
					}
				}
			}
			if (brake || slip2 > 2f)
			{
				collider2.steerAngle = Mathf.Lerp(collider2.steerAngle, steer * wheelComponent2.maxSteer, 0.02f);
				continue;
			}
			float num9 = Mathf.Clamp(speed / carSetting.maxSteerAngle, 1f, carSetting.maxSteerAngle);
			collider2.steerAngle = steer * (wheelComponent2.maxSteer / num9);
		}
		Pitch = Mathf.Clamp(1.2f + (motorRPM - carSetting.idleRPM) / (carSetting.shiftUpRPM - carSetting.idleRPM), 1f, 10f);
		shiftTime = Mathf.MoveTowards(shiftTime, 0f, 0.1f);
		if (Pitch == 1f)
		{
			carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1f, 0.1f);
			carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f);
			carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.1f);
		}
		else
		{
			carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1.8f - Pitch, 0.1f);
			if ((Pitch > PitchDelay || accel > 0f) && shiftTime == 0f)
			{
				carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0f, 0.2f);
				carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 1f, 0.1f);
			}
			else
			{
				carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f);
				carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.2f);
			}
			carSounds.HighEngine.pitch = Pitch;
			carSounds.LowEngine.pitch = Pitch;
			PitchDelay = Pitch;
		}
		if (!isOn)
		{
			carSounds.IdleEngine.volume = 0f;
			carSounds.LowEngine.volume = 0f;
			carSounds.HighEngine.volume = 0f;
		}
	}

	private void OnDrawGizmos()
	{
		//IL_0026: 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_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: 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_0061: 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_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00b1: Unknown result type (might be due to invalid IL or missing references)
		if (carSetting.showNormalGizmos && !Application.isPlaying)
		{
			Matrix4x4 matrix = Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.lossyScale);
			Gizmos.matrix = matrix;
			Gizmos.color = new Color(1f, 0f, 0f, 0.5f);
			Gizmos.DrawCube(Vector3.up / 1.5f, new Vector3(2.5f, 2f, 6f));
			Gizmos.DrawSphere(carSetting.shiftCentre / ((Component)this).transform.lossyScale.x, 0.2f);
		}
	}
}
namespace H3VRUtils.Vehicles
{
	[Serializable]
	public class VehicleDamagableMult
	{
		public float projectileMult = 1f;

		public float meleeMult = 1f;

		public float explosionMult = 1f;

		public float piercingMult = 1f;

		public float cuttingMult = 1f;

		public float thermalMult = 1f;

		public float bluntMult = 1f;

		public float totalKineticMult = 1f;
	}
	public class VehicleDamagable : MonoBehaviour
	{
		public float health;

		public float maxHealth;

		public float minHealth;

		public VehicleDamagableMult dmgMult;

		public VehicleControl vehicle;

		public bool dead;

		private float prevhealth;

		public virtual void FixedUpdate()
		{
			if (health < 0f)
			{
				if (!dead)
				{
					onDeath();
					dead = true;
				}
				whileDead();
			}
			else
			{
				if (dead)
				{
					onUndeath();
					dead = false;
				}
				whileUndead();
			}
			if (health < minHealth)
			{
				health = minHealth;
			}
			if (health != prevhealth)
			{
				onHealthChange();
			}
			prevhealth = health;
		}

		public virtual void onHealthChange()
		{
		}

		public bool HPLessThan(float num)
		{
			if (health < num)
			{
				return true;
			}
			return false;
		}

		public bool HPLessThanPercent(float num)
		{
			if (health < num * maxHealth)
			{
				return true;
			}
			return false;
		}

		public virtual void onDeath()
		{
		}

		public virtual void whileDead()
		{
		}

		public virtual void whileUndead()
		{
		}

		public virtual void onUndeath()
		{
		}

		public virtual void HealPercent(float percentHeal)
		{
			Heal(percentHeal * maxHealth);
			Debug.Log((object)("percenthealing for " + percentHeal));
		}

		public virtual void Heal(float heal)
		{
			health += heal;
			Debug.Log((object)("Healed for " + heal));
		}

		public virtual void Damage()
		{
		}

		public float getDamage()
		{
			return 0f;
		}
	}
	public class VehicleRepairTool : MonoBehaviour
	{
		public float percentHeal;

		private void OnCollisionEnter(Collision collision)
		{
			//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)
			Vector3 relativeVelocity = collision.relativeVelocity;
			if (!(((Vector3)(ref relativeVelocity)).magnitude < 2f))
			{
				VehicleDamagable component = collision.gameObject.GetComponent<VehicleDamagable>();
				if ((Object)(object)component != (Object)null)
				{
					component.HealPercent(percentHeal);
				}
			}
		}
	}
	internal class VehicleSeat : MonoBehaviour
	{
		public FVRViveHand hand;

		public GameObject SitPos;

		public GameObject EjectPos;

		public void Update()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)hand != (Object)null)
			{
				((Component)hand.MovementManager).transform.position = SitPos.transform.position;
			}
		}
	}
}

MW2_Pit.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using Atlas;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using Sodalite.Api;
using Sodalite.Utilities;
using Technie.PhysicsCreator.QHull;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.UI;

[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 MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace localpcnerd.MW2_Pit
{
	[BepInPlugin("localpcnerd.MW2_Pit", "MW2_Pit", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("nrgill28.Atlas", "1.0.1")]
	public class MW2_PitPlugin : 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(), "localpcnerd.MW2_Pit");
			AtlasPlugin.RegisterScene(Path.Combine(BasePath, "pit"));
		}
	}
}
namespace SimpleLightProbePlacer
{
	[RequireComponent(typeof(LightProbeGroup))]
	[AddComponentMenu("Rendering/Light Probe Group Control")]
	public class LightProbeGroupControl : MonoBehaviour
	{
		[SerializeField]
		private float m_mergeDistance = 0.5f;

		[SerializeField]
		private bool m_usePointLights = true;

		[SerializeField]
		private float m_pointLightRange = 1f;

		private int m_mergedProbes;

		private LightProbeGroup m_lightProbeGroup;

		public float MergeDistance
		{
			get
			{
				return m_mergeDistance;
			}
			set
			{
				m_mergeDistance = value;
			}
		}

		public int MergedProbes => m_mergedProbes;

		public bool UsePointLights
		{
			get
			{
				return m_usePointLights;
			}
			set
			{
				m_usePointLights = value;
			}
		}

		public float PointLightRange
		{
			get
			{
				return m_pointLightRange;
			}
			set
			{
				m_pointLightRange = value;
			}
		}

		public LightProbeGroup LightProbeGroup
		{
			get
			{
				if ((Object)(object)m_lightProbeGroup != (Object)null)
				{
					return m_lightProbeGroup;
				}
				return m_lightProbeGroup = ((Component)this).GetComponent<LightProbeGroup>();
			}
		}

		public void DeleteAll()
		{
			LightProbeGroup.probePositions = null;
			m_mergedProbes = 0;
		}

		public void Create()
		{
			DeleteAll();
			List<Vector3> list = CreatePositions();
			list.AddRange(CreateAroundPointLights(m_pointLightRange));
			list = MergeClosestPositions(list, m_mergeDistance, out m_mergedProbes);
			ApplyPositions(list);
		}

		public void Merge()
		{
			if (LightProbeGroup.probePositions != null)
			{
				List<Vector3> source = MergeClosestPositions(LightProbeGroup.probePositions.ToList(), m_mergeDistance, out m_mergedProbes);
				source = source.Select((Vector3 x) => ((Component)this).transform.TransformPoint(x)).ToList();
				ApplyPositions(source);
			}
		}

		private void ApplyPositions(List<Vector3> positions)
		{
			LightProbeGroup.probePositions = positions.Select((Vector3 x) => ((Component)this).transform.InverseTransformPoint(x)).ToArray();
		}

		private static List<Vector3> CreatePositions()
		{
			LightProbeVolume[] array = Object.FindObjectsOfType<LightProbeVolume>();
			if (array.Length == 0)
			{
				return new List<Vector3>();
			}
			List<Vector3> list = new List<Vector3>();
			for (int i = 0; i < array.Length; i++)
			{
				list.AddRange(array[i].CreatePositions());
			}
			return list;
		}

		private static List<Vector3> CreateAroundPointLights(float range)
		{
			List<Light> list = (from x in Object.FindObjectsOfType<Light>()
				where (int)x.type == 2
				select x).ToList();
			if (list.Count == 0)
			{
				return new List<Vector3>();
			}
			List<Vector3> list2 = new List<Vector3>();
			for (int i = 0; i < list.Count; i++)
			{
				list2.AddRange(CreatePositionsAround(((Component)list[i]).transform, range));
			}
			return list2;
		}

		private static List<Vector3> MergeClosestPositions(List<Vector3> positions, float distance, out int mergedCount)
		{
			//IL_00a2: 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_0127: 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_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			if (positions == null)
			{
				mergedCount = 0;
				return new List<Vector3>();
			}
			int count = positions.Count;
			bool flag = false;
			while (!flag)
			{
				Dictionary<Vector3, List<Vector3>> dictionary = new Dictionary<Vector3, List<Vector3>>();
				for (int i = 0; i < positions.Count; i++)
				{
					List<Vector3> list = positions.Where(delegate(Vector3 x)
					{
						//IL_0000: 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_0017: Unknown result type (might be due to invalid IL or missing references)
						//IL_001c: Unknown result type (might be due to invalid IL or missing references)
						Vector3 val2 = x - positions[i];
						return ((Vector3)(ref val2)).magnitude < distance;
					}).ToList();
					if (list.Count > 0 && !dictionary.ContainsKey(positions[i]))
					{
						dictionary.Add(positions[i], list);
					}
				}
				positions.Clear();
				List<Vector3> list2 = dictionary.Keys.ToList();
				for (int j = 0; j < list2.Count; j++)
				{
					Vector3 center = dictionary[list2[j]].Aggregate(Vector3.zero, (Vector3 result, Vector3 target) => result + target) / (float)dictionary[list2[j]].Count;
					if (!positions.Exists((Vector3 x) => x == center))
					{
						positions.Add(center);
					}
				}
				flag = positions.Select((Vector3 x) => positions.Where(delegate(Vector3 y)
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0011: 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)
					int result2;
					if (y != x)
					{
						Vector3 val = y - x;
						result2 = ((((Vector3)(ref val)).magnitude < distance) ? 1 : 0);
					}
					else
					{
						result2 = 0;
					}
					return (byte)result2 != 0;
				})).All((IEnumerable<Vector3> x) => !x.Any());
			}
			mergedCount = count - positions.Count;
			return positions;
		}

		public static List<Vector3> CreatePositionsAround(Transform transform, float range)
		{
			//IL_0031: 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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_00d6: 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_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] source = (Vector3[])(object)new Vector3[8]
			{
				new Vector3(-0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, -0.5f)
			};
			return source.Select((Vector3 x) => transform.TransformPoint(x * range)).ToList();
		}
	}
	public enum LightProbeVolumeType
	{
		Fixed,
		Float
	}
	[AddComponentMenu("Rendering/Light Probe Volume")]
	public class LightProbeVolume : TransformVolume
	{
		[SerializeField]
		private LightProbeVolumeType m_type = LightProbeVolumeType.Fixed;

		[SerializeField]
		private Vector3 m_densityFixed = Vector3.one;

		[SerializeField]
		private Vector3 m_densityFloat = Vector3.one;

		public LightProbeVolumeType Type
		{
			get
			{
				return m_type;
			}
			set
			{
				m_type = value;
			}
		}

		public Vector3 Density
		{
			get
			{
				//IL_0018: 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_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)
				return (m_type != 0) ? m_densityFloat : m_densityFixed;
			}
			set
			{
				//IL_0019: 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_000d: 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)
				if (m_type == LightProbeVolumeType.Fixed)
				{
					m_densityFixed = value;
				}
				else
				{
					m_densityFloat = value;
				}
			}
		}

		public static Color EditorColor => new Color(1f, 0.9f, 0.25f);

		public List<Vector3> CreatePositions()
		{
			return CreatePositions(m_type);
		}

		public List<Vector3> CreatePositions(LightProbeVolumeType type)
		{
			//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)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			return (type != 0) ? CreatePositionsFloat(((Component)this).transform, base.Origin, base.Size, Density) : CreatePositionsFixed(((Component)this).transform, base.Origin, base.Size, Density);
		}

		public static List<Vector3> CreatePositionsFixed(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_0053: 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_0079: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			Vector3 val = origin;
			float num = size.x / (float)Mathf.FloorToInt(density.x);
			float num2 = size.y / (float)Mathf.FloorToInt(density.y);
			float num3 = size.z / (float)Mathf.FloorToInt(density.z);
			val -= size * 0.5f;
			for (int i = 0; (float)i <= density.x; i++)
			{
				for (int j = 0; (float)j <= density.y; j++)
				{
					for (int k = 0; (float)k <= density.z; k++)
					{
						Vector3 val2 = val + new Vector3((float)i * num, (float)j * num2, (float)k * num3);
						val2 = volumeTransform.TransformPoint(val2);
						list.Add(val2);
					}
				}
			}
			return list;
		}

		public static List<Vector3> CreatePositionsFloat(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			Vector3 val = origin;
			int num = Mathf.FloorToInt(size.x / density.x);
			int num2 = Mathf.FloorToInt(size.y / density.y);
			int num3 = Mathf.FloorToInt(size.z / density.z);
			val -= size * 0.5f;
			val.x += (size.x - (float)num * density.x) * 0.5f;
			val.y += (size.y - (float)num2 * density.y) * 0.5f;
			val.z += (size.z - (float)num3 * density.z) * 0.5f;
			for (int i = 0; i <= num; i++)
			{
				for (int j = 0; j <= num2; j++)
				{
					for (int k = 0; k <= num3; k++)
					{
						Vector3 val2 = val + new Vector3((float)i * density.x, (float)j * density.y, (float)k * density.z);
						val2 = volumeTransform.TransformPoint(val2);
						list.Add(val2);
					}
				}
			}
			return list;
		}
	}
	[AddComponentMenu("")]
	public class TransformVolume : MonoBehaviour
	{
		[SerializeField]
		private Volume m_volume = new Volume(Vector3.zero, Vector3.one);

		public Volume Volume
		{
			get
			{
				return m_volume;
			}
			set
			{
				m_volume = value;
			}
		}

		public Vector3 Origin => m_volume.Origin;

		public Vector3 Size => m_volume.Size;

		public bool IsInBounds(Vector3[] points)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			Bounds bounds = GetBounds();
			return ((Bounds)(ref bounds)).Intersects(GetBounds(points));
		}

		public bool IsOnBorder(Vector3[] points)
		{
			if (points.All((Vector3 x) => !IsInVolume(x)))
			{
				return false;
			}
			return !points.All(IsInVolume);
		}

		public bool IsInVolume(Vector3[] points)
		{
			return points.All(IsInVolume);
		}

		public bool IsInVolume(Vector3 position)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			Plane val = default(Plane);
			for (int i = 0; i < 6; i++)
			{
				((Plane)(ref val))..ctor(GetSideDirection(i), GetSidePosition(i));
				if (((Plane)(ref val)).GetSide(position))
				{
					return false;
				}
			}
			return true;
		}

		public Vector3[] GetCorners()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] array = (Vector3[])(object)new Vector3[8]
			{
				new Vector3(-0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, -0.5f)
			};
			for (int i = 0; i < array.Length; i++)
			{
				ref Vector3 reference = ref array[i];
				reference.x *= m_volume.Size.x;
				ref Vector3 reference2 = ref array[i];
				reference2.y *= m_volume.Size.y;
				ref Vector3 reference3 = ref array[i];
				reference3.z *= m_volume.Size.z;
				ref Vector3 reference4 = ref array[i];
				reference4 = ((Component)this).transform.TransformPoint(m_volume.Origin + array[i]);
			}
			return array;
		}

		public Bounds GetBounds()
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			return GetBounds(GetCorners());
		}

		public Bounds GetBounds(Vector3[] points)
		{
			//IL_0002: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_0036: 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_0069: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = points.Aggregate(Vector3.zero, (Vector3 result, Vector3 point) => result + point) / (float)points.Length;
			Bounds result2 = default(Bounds);
			((Bounds)(ref result2))..ctor(val, Vector3.zero);
			for (int i = 0; i < points.Length; i++)
			{
				((Bounds)(ref result2)).Encapsulate(points[i]);
			}
			return result2;
		}

		public GameObject[] GetGameObjectsInBounds(LayerMask layerMask)
		{
			//IL_000e: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			MeshRenderer[] array = Object.FindObjectsOfType<MeshRenderer>();
			List<GameObject> list = new List<GameObject>();
			Bounds bounds = GetBounds();
			for (int i = 0; i < array.Length; i++)
			{
				if (!((Object)(object)((Component)array[i]).gameObject == (Object)(object)((Component)((Component)this).transform).gameObject) && !((Object)(object)((Component)array[i]).GetComponent<TransformVolume>() != (Object)null) && ((1 << ((Component)array[i]).gameObject.layer) & ((LayerMask)(ref layerMask)).value) != 0 && ((Bounds)(ref bounds)).Intersects(((Renderer)array[i]).bounds))
				{
					list.Add(((Component)array[i]).gameObject);
				}
			}
			return list.ToArray();
		}

		public Vector3 GetSideDirection(int side)
		{
			//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_000e: 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_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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_002f: 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_0040: 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_004d: 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_005f: 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_006c: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] array = (Vector3[])(object)new Vector3[6];
			Vector3 right = Vector3.right;
			Vector3 up = Vector3.up;
			Vector3 forward = Vector3.forward;
			array[0] = right;
			ref Vector3 reference = ref array[1];
			reference = -right;
			array[2] = up;
			ref Vector3 reference2 = ref array[3];
			reference2 = -up;
			array[4] = forward;
			ref Vector3 reference3 = ref array[5];
			reference3 = -forward;
			return ((Component)this).transform.TransformDirection(array[side]);
		}

		public Vector3 GetSidePosition(int side)
		{
			//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_000e: 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_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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_002f: 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_0040: 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_004d: 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_005f: 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_006c: 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_0084: 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_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)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] array = (Vector3[])(object)new Vector3[6];
			Vector3 right = Vector3.right;
			Vector3 up = Vector3.up;
			Vector3 forward = Vector3.forward;
			array[0] = right;
			ref Vector3 reference = ref array[1];
			reference = -right;
			array[2] = up;
			ref Vector3 reference2 = ref array[3];
			reference2 = -up;
			array[4] = forward;
			ref Vector3 reference3 = ref array[5];
			reference3 = -forward;
			return ((Component)this).transform.TransformPoint(array[side] * GetSizeAxis(side) + m_volume.Origin);
		}

		public float GetSizeAxis(int side)
		{
			//IL_0022: 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_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)
			//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)
			switch (side)
			{
			case 0:
			case 1:
				return m_volume.Size.x * 0.5f;
			case 2:
			case 3:
				return m_volume.Size.y * 0.5f;
			default:
				return m_volume.Size.z * 0.5f;
			}
		}

		public static Volume EditorVolumeControl(TransformVolume transformVolume, float handleSize, Color color)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_0052: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_010c: 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_0124: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Expected O, but got Unknown
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: 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_0170: 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_0148: Expected O, but got Unknown
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: 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_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: 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_023b: 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_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: 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_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: 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_01d4: Expected O, but got Unknown
			Vector3[] array = (Vector3[])(object)new Vector3[6];
			Transform transform = ((Component)transformVolume).transform;
			Handles.color = color;
			for (int i = 0; i < array.Length; i++)
			{
				ref Vector3 reference = ref array[i];
				reference = transformVolume.GetSidePosition(i);
			}
			ref Vector3 reference2 = ref array[0];
			reference2 = Handles.Slider(array[0], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference3 = ref array[1];
			reference3 = Handles.Slider(array[1], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference4 = ref array[2];
			reference4 = Handles.Slider(array[2], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference5 = ref array[3];
			reference5 = Handles.Slider(array[3], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference6 = ref array[4];
			reference6 = Handles.Slider(array[4], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference7 = ref array[5];
			reference7 = Handles.Slider(array[5], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			Vector3 origin = default(Vector3);
			origin.x = transform.InverseTransformPoint((array[0] + array[1]) * 0.5f).x;
			origin.y = transform.InverseTransformPoint((array[2] + array[3]) * 0.5f).y;
			origin.z = transform.InverseTransformPoint((array[4] + array[5]) * 0.5f).z;
			Vector3 size = default(Vector3);
			size.x = transform.InverseTransformPoint(array[0]).x - transform.InverseTransformPoint(array[1]).x;
			size.y = transform.InverseTransformPoint(array[2]).y - transform.InverseTransformPoint(array[3]).y;
			size.z = transform.InverseTransformPoint(array[4]).z - transform.InverseTransformPoint(array[5]).z;
			return new Volume(origin, size);
		}
	}
	[Serializable]
	public struct Volume
	{
		[SerializeField]
		private Vector3 m_origin;

		[SerializeField]
		private Vector3 m_size;

		public Vector3 Origin => m_origin;

		public Vector3 Size => m_size;

		public Volume(Vector3 origin, Vector3 size)
		{
			//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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			m_origin = origin;
			m_size = size;
		}

		public static bool operator ==(Volume left, Volume right)
		{
			return left.Equals(right);
		}

		public static bool operator !=(Volume left, Volume right)
		{
			return !left.Equals(right);
		}

		public bool Equals(Volume other)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			return Origin == other.Origin && Size == other.Size;
		}

		public override bool Equals(object obj)
		{
			if (object.ReferenceEquals(null, obj))
			{
				return false;
			}
			return obj is Volume && Equals((Volume)obj);
		}

		public override int GetHashCode()
		{
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Vector3 origin = Origin;
			int num = ((object)(Vector3)(ref origin)).GetHashCode() * 397;
			Vector3 size = Size;
			return num ^ ((object)(Vector3)(ref size)).GetHashCode();
		}

		public override string ToString()
		{
			//IL_0007: 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)
			return $"Origin: {Origin}, Size: {Size}";
		}
	}
}
namespace nrgill28.AtlasSampleScene
{
	public class CTF_CaptureZone : MonoBehaviour
	{
		public CTF_Manager Manager;

		public CTF_Team Team;

		public void OnTriggerEnter(Collider other)
		{
			CTF_Flag component = ((Component)other).GetComponent<CTF_Flag>();
			if (Object.op_Implicit((Object)(object)component) && component.Team != Team)
			{
				Manager.FlagCaptured(component);
			}
		}
	}
	public class CTF_Flag : FVRPhysicalObject
	{
		[Header("Flag stuffs")]
		public CTF_Team Team;

		public float RespawnDelay = 10f;

		public Vector3 FloorOffset = new Vector3(0f, 0.25f, 0f);

		private Vector3 _resetPosition;

		private Quaternion _resetRotation;

		private Transform _followTransform;

		private bool _isHeld;

		private bool _isTaken;

		private float _timer;

		private CTF_Sosig _heldBy;

		public override void Awake()
		{
			//IL_000e: 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_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)
			((FVRPhysicalObject)this).Awake();
			_resetPosition = ((Component)this).transform.position;
			_resetRotation = ((Component)this).transform.rotation;
		}

		private void Update()
		{
			if (_isTaken && !_isHeld)
			{
				_timer -= Time.deltaTime;
				if (_timer < 0f)
				{
					ReturnFlag();
				}
			}
		}

		public void Take()
		{
			_isHeld = true;
			_isTaken = true;
		}

		public void Drop()
		{
			//IL_001a: 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_0040: 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)
			((FVRInteractiveObject)this).IsHeld = false;
			_timer = RespawnDelay;
			NavMeshHit val = default(NavMeshHit);
			NavMesh.SamplePosition(((Component)this).transform.position, ref val, 100f, -1);
			((Component)this).transform.position = ((NavMeshHit)(ref val)).position + FloorOffset;
			((Component)this).transform.rotation = Quaternion.identity;
		}

		public void ReturnFlag()
		{
			//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)
			if (((FVRInteractiveObject)this).IsHeld)
			{
				((FVRInteractiveObject)this).ForceBreakInteraction();
			}
			if (Object.op_Implicit((Object)(object)_heldBy))
			{
				_heldBy.HeldFlag = null;
			}
			((Component)this).transform.SetPositionAndRotation(_resetPosition, _resetRotation);
			_isTaken = false;
		}

		private void OnTriggerEnter(Collider other)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			if (_isHeld)
			{
				return;
			}
			CTF_Sosig componentInParent = ((Component)other).GetComponentInParent<CTF_Sosig>();
			if (Object.op_Implicit((Object)(object)componentInParent) && (int)componentInParent.Sosig.BodyState == 0)
			{
				if (componentInParent.Team == Team)
				{
					ReturnFlag();
					return;
				}
				_heldBy = componentInParent;
				componentInParent.HeldFlag = this;
				Take();
			}
		}

		public override void BeginInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).BeginInteraction(hand);
			Take();
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).EndInteraction(hand);
			Drop();
		}
	}
	public class CTF_Manager : MonoBehaviour
	{
		[Header("References")]
		public Text[] ScoreTexts;

		public Transform[] AttackPoints;

		public Text StartButtonText;

		[Header("Red Team")]
		public CTF_Flag RedFlag;

		public int RedTeamSize;

		public Transform[] RedSpawns;

		public SosigEnemyID[] RedTeam;

		[Header("Blue Team")]
		public CTF_Flag BlueFlag;

		public int BlueTeamSize;

		public Transform[] BlueSpawns;

		public SosigEnemyID[] BlueTeam;

		private int _blueScore;

		private int _redScore;

		private bool _running;

		private readonly List<CTF_Sosig> _sosigs = new List<CTF_Sosig>();

		private readonly SpawnOptions _spawnOptions;

		public CTF_Manager()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			SpawnOptions val = new SpawnOptions();
			val.SpawnState = (SosigOrder)7;
			val.SpawnActivated = true;
			val.EquipmentMode = (EquipmentSlots)7;
			val.SpawnWithFullAmmo = true;
			_spawnOptions = val;
			((MonoBehaviour)this)..ctor();
		}

		private void Start()
		{
			UpdateScoreText();
		}

		public void ToggleGame()
		{
			if (_running)
			{
				EndGame();
				StartButtonText.text = "Start Game";
			}
			else
			{
				StartGame();
				StartButtonText.text = "Stop Game";
			}
		}

		private void StartGame()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			ResetGame();
			_running = true;
			GM.CurrentSceneSettings.SosigKillEvent += new SosigKill(CurrentSceneSettingsOnSosigKillEvent);
			((MonoBehaviour)this).StartCoroutine(DoInitialSpawns());
		}

		private void EndGame()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.SosigKillEvent -= new SosigKill(CurrentSceneSettingsOnSosigKillEvent);
			foreach (CTF_Sosig sosig in _sosigs)
			{
				sosig.Sosig.ClearSosig();
			}
			_running = false;
		}

		private void CurrentSceneSettingsOnSosigKillEvent(Sosig s)
		{
			CTF_Sosig cTF_Sosig = _sosigs.FirstOrDefault((CTF_Sosig x) => (Object)(object)x.Sosig == (Object)(object)s);
			if (Object.op_Implicit((Object)(object)cTF_Sosig))
			{
				((MonoBehaviour)this).StartCoroutine(RespawnSosig(cTF_Sosig));
			}
		}

		private void SpawnSosig(CTF_Team team)
		{
			//IL_001e: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			_spawnOptions.IFF = (int)team;
			_spawnOptions.SosigTargetPosition = SodaliteUtils.GetRandom<Transform>((IList<Transform>)AttackPoints).position;
			Transform transform;
			SosigEnemyID random;
			if (team == CTF_Team.Red)
			{
				transform = ((Component)SodaliteUtils.GetRandom<Transform>((IList<Transform>)RedSpawns)).transform;
				random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)RedTeam);
			}
			else
			{
				transform = ((Component)SodaliteUtils.GetRandom<Transform>((IList<Transform>)BlueSpawns)).transform;
				random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)BlueTeam);
			}
			Sosig val = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[random], _spawnOptions, transform.position, transform.rotation);
			CTF_Sosig cTF_Sosig = ((Component)val).gameObject.AddComponent<CTF_Sosig>();
			_sosigs.Add(cTF_Sosig);
			cTF_Sosig.Sosig = val;
			cTF_Sosig.Team = team;
		}

		private IEnumerator DoInitialSpawns()
		{
			int i = 0;
			while (i < Mathf.Max(RedTeamSize, BlueTeamSize))
			{
				if (i < RedTeamSize)
				{
					SpawnSosig(CTF_Team.Red);
				}
				if (i < BlueTeamSize)
				{
					SpawnSosig(CTF_Team.Blue);
				}
				i++;
				yield return (object)new WaitForSeconds(2.5f);
			}
		}

		private IEnumerator RespawnSosig(CTF_Sosig sosig)
		{
			yield return (object)new WaitForSeconds(5f);
			sosig.Sosig.ClearSosig();
			_sosigs.Remove(sosig);
			yield return (object)new WaitForSeconds(5f);
			if (_running)
			{
				int sosigsLeft = _sosigs.Count((CTF_Sosig x) => x.Team == sosig.Team);
				int teamSize = ((sosig.Team != 0) ? BlueTeamSize : RedTeamSize);
				if (sosigsLeft < teamSize)
				{
					SpawnSosig(sosig.Team);
				}
			}
		}

		public void ResetGame()
		{
			_blueScore = 0;
			_redScore = 0;
			UpdateScoreText();
			if (Object.op_Implicit((Object)(object)RedFlag))
			{
				RedFlag.ReturnFlag();
			}
			if (Object.op_Implicit((Object)(object)BlueFlag))
			{
				BlueFlag.ReturnFlag();
			}
		}

		public void FlagCaptured(CTF_Flag flag)
		{
			if (flag.Team == CTF_Team.Red)
			{
				_blueScore++;
			}
			else
			{
				_redScore++;
			}
			UpdateScoreText();
			flag.ReturnFlag();
		}

		public void UpdateScoreText()
		{
			Text[] scoreTexts = ScoreTexts;
			foreach (Text val in scoreTexts)
			{
				val.text = "<color=red>" + _redScore + "</color> - <color=blue>" + _blueScore + "</color>";
			}
		}

		private void OnDrawGizmos()
		{
			//IL_0001: 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_003b: 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_007d: 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)
			Gizmos.color = Color.red;
			Transform[] redSpawns = RedSpawns;
			foreach (Transform val in redSpawns)
			{
				Gizmos.DrawSphere(val.position, 0.15f);
			}
			Gizmos.color = Color.blue;
			Transform[] blueSpawns = BlueSpawns;
			foreach (Transform val2 in blueSpawns)
			{
				Gizmos.DrawSphere(val2.position, 0.15f);
			}
			Gizmos.color = Color.green;
			Transform[] attackPoints = AttackPoints;
			foreach (Transform val3 in attackPoints)
			{
				Gizmos.DrawSphere(val3.position, 0.15f);
			}
		}
	}
	public class CTF_Sosig : MonoBehaviour
	{
		public CTF_Team Team;

		public CTF_Flag HeldFlag;

		public Sosig Sosig;

		private void Awake()
		{
			Sosig = ((Component)this).GetComponent<Sosig>();
		}

		private void Update()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_0041: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)HeldFlag))
			{
				Vector3 val = ((Component)Sosig).transform.position - ((Component)Sosig).transform.forward * 0.1f;
				((Component)HeldFlag).transform.SetPositionAndRotation(val, ((Component)Sosig).transform.rotation);
			}
		}
	}
	public enum CTF_Team
	{
		Red,
		Blue
	}
	public class PopupTarget : MonoBehaviour, IFVRDamageable
	{
		[Flags]
		public enum TargetRange
		{
			Near = 1,
			Mid = 2,
			Far = 4,
			All = 7
		}

		public PopupTargetManager Manager;

		public TargetRange Range;

		public Transform Pivot;

		public Vector3 SetRotation;

		private Quaternion _startRotation;

		private Quaternion _endRotation;

		private bool _set;

		public bool Set
		{
			get
			{
				return _set;
			}
			set
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: 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_002d: Unknown result type (might be due to invalid IL or missing references)
				if (_set != value)
				{
					_set = value;
					((MonoBehaviour)this).StartCoroutine((!_set) ? RotateTo(_endRotation, _startRotation) : RotateTo(_startRotation, _endRotation));
				}
			}
		}

		private void Awake()
		{
			//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_0014: 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_0029: 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)
			_startRotation = Pivot.rotation;
			_endRotation = Quaternion.Euler(SetRotation + ((Quaternion)(ref _startRotation)).eulerAngles);
		}

		void IFVRDamageable.Damage(Damage dam)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			if (Set && (int)dam.Class == 1)
			{
				Set = false;
				Manager.TargetHit(this);
			}
		}

		private IEnumerator RotateTo(Quaternion from, Quaternion to)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			float elapsed = 0f;
			while (elapsed < 0.25f)
			{
				yield return null;
				elapsed += Time.deltaTime;
				Pivot.localRotation = Quaternion.Slerp(from, to, elapsed / 0.25f);
			}
			Pivot.rotation = to;
		}
	}
	public class PopupTargetManager : MonoBehaviour
	{
		public List<PopupTarget> Targets;

		private readonly List<PopupTarget> _setTargets = new List<PopupTarget>();

		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All));
		}

		private IEnumerator StartSetAsync(float minDelay, float maxDelay, int numTargets, PopupTarget.TargetRange ranges)
		{
			yield return (object)new WaitForSeconds(Random.Range(minDelay, maxDelay));
			IListExtensions.Shuffle<PopupTarget>((IList<PopupTarget>)Targets);
			_setTargets.Clear();
			foreach (PopupTarget target in Targets)
			{
				if ((target.Range & ranges) != 0)
				{
					target.Set = true;
					_setTargets.Add(target);
					numTargets--;
				}
				if (numTargets == 0)
				{
					break;
				}
			}
		}

		public void TargetHit(PopupTarget target)
		{
			if (_setTargets.Contains(target))
			{
				_setTargets.Remove(target);
				if (_setTargets.Count == 0)
				{
					((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All));
				}
			}
		}
	}
}
namespace Technie.PhysicsCreator
{
	public class AxisAlignedBoxFitter
	{
		public void Fit(Hull hull, Vector3[] meshVertices, int[] meshIndices)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] selectedVertices = FaceAlignmentBoxFitter.GetSelectedVertices(hull, meshVertices, meshIndices);
			ConstructionPlane plane = new ConstructionPlane(Vector3.zero, Vector3.up, Vector3.right);
			RotatedBox computedBox = RotatedBoxFitter.FindTightestBox(plane, selectedVertices);
			RotatedBoxFitter.ApplyToHull(computedBox, hull);
		}
	}
	public class Pose
	{
		public Vector3 forward;

		public Vector3 up;

		public Vector3 right;
	}
	public class Triangle
	{
		public Vector3 normal;

		public float area;

		public Vector3 center;

		public Triangle(Vector3 p0, Vector3 p1, Vector3 p2)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: 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_000f: 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_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_0018: 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_001e: 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)
			//IL_0040: 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_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_0048: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = p1 - p0;
			Vector3 val2 = p2 - p0;
			Vector3 val3 = Vector3.Cross(val, val2);
			area = ((Vector3)(ref val3)).magnitude * 0.5f;
			normal = ((Vector3)(ref val3)).normalized;
			center = (p0 + p1 + p2) / 3f;
		}
	}
	public class TriangleBucket
	{
		private List<Triangle> triangles;

		private Vector3 averagedNormal;

		private Vector3 averagedCenter;

		private float totalArea;

		public float Area => totalArea;

		public TriangleBucket(Triangle initialTriangle)
		{
			triangles = new List<Triangle>();
			triangles.Add(initialTriangle);
			CalculateNormal();
			CalcTotalArea();
		}

		public void Add(Triangle t)
		{
			triangles.Add(t);
			CalculateNormal();
			CalcTotalArea();
		}

		public void Add(TriangleBucket otherBucket)
		{
			foreach (Triangle triangle in otherBucket.triangles)
			{
				triangles.Add(triangle);
			}
			CalculateNormal();
			CalcTotalArea();
		}

		private void CalculateNormal()
		{
			//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_0029: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			averagedNormal = Vector3.zero;
			foreach (Triangle triangle in triangles)
			{
				averagedNormal += triangle.normal * triangle.area;
			}
			((Vector3)(ref averagedNormal)).Normalize();
		}

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

		public Vector3 GetAverageCenter()
		{
			//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)
			return triangles[0].center;
		}

		private void CalcTotalArea()
		{
			totalArea = 0f;
			foreach (Triangle triangle in triangles)
			{
				totalArea += triangle.area;
			}
		}
	}
	public class TriangleAreaSorter : IComparer<Triangle>
	{
		public int Compare(Triangle lhs, Triangle rhs)
		{
			if (lhs.area < rhs.area)
			{
				return 1;
			}
			if (lhs.area > rhs.area)
			{
				return -1;
			}
			return 0;
		}
	}
	public class TriangleBucketSorter : IComparer<TriangleBucket>
	{
		public int Compare(TriangleBucket lhs, TriangleBucket rhs)
		{
			if (lhs.Area < rhs.Area)
			{
				return 1;
			}
			if (lhs.Area > rhs.Area)
			{
				return -1;
			}
			return 0;
		}
	}
	public class FaceAlignmentBoxFitter
	{
		public void Fit(Hull hull, Vector3[] meshVertices, int[] meshIndices)
		{
			if (meshIndices.Length < 3)
			{
				return;
			}
			List<Triangle> list = FindTriangles(meshVertices, meshIndices, hull.selectedFaces);
			list.Sort(new TriangleAreaSorter());
			List<TriangleBucket> list2 = new List<TriangleBucket>();
			foreach (Triangle item in list)
			{
				TriangleBucket triangleBucket = FindBestBucket(item, 30f, list2);
				if (triangleBucket != null)
				{
					triangleBucket.Add(item);
					continue;
				}
				triangleBucket = new TriangleBucket(item);
				list2.Add(triangleBucket);
			}
			while (list2.Count > 3)
			{
				MergeClosestBuckets(list2);
			}
			list2.Sort(new TriangleBucketSorter());
			Vector3[] selectedVertices = GetSelectedVertices(hull, meshVertices, meshIndices);
			ConstructionPlane plane = CreateConstructionPlane(list2[0], (list2.Count <= 1) ? null : list2[1], (list2.Count <= 2) ? null : list2[2]);
			RotatedBox computedBox = RotatedBoxFitter.FindTightestBox(plane, selectedVertices);
			RotatedBoxFitter.ApplyToHull(computedBox, hull);
		}

		public static List<Triangle> FindTriangles(Vector3[] meshVertices, int[] meshIndices, List<int> selectedFaces)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			List<Triangle> list = new List<Triangle>();
			foreach (int selectedFace in selectedFaces)
			{
				int num = meshIndices[selectedFace * 3];
				int num2 = meshIndices[selectedFace * 3 + 1];
				int num3 = meshIndices[selectedFace * 3 + 2];
				Vector3 p = meshVertices[num];
				Vector3 p2 = meshVertices[num2];
				Vector3 p3 = meshVertices[num3];
				Triangle item = new Triangle(p, p2, p3);
				list.Add(item);
			}
			return list;
		}

		public static void FindTriangles(Hull hull, Vector3[] meshVertices, int[] meshIndices, out Vector3[] hullVertices, out int[] hullIndices)
		{
			//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)
			//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_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_0067: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			foreach (int selectedFace in hull.selectedFaces)
			{
				int num = meshIndices[selectedFace * 3];
				int num2 = meshIndices[selectedFace * 3 + 1];
				int num3 = meshIndices[selectedFace * 3 + 2];
				Vector3 item = meshVertices[num];
				Vector3 item2 = meshVertices[num2];
				Vector3 item3 = meshVertices[num3];
				list.Add(item);
				list.Add(item2);
				list.Add(item3);
			}
			hullVertices = list.ToArray();
			hullIndices = new int[hullVertices.Length];
			for (int i = 0; i < hullIndices.Length; i++)
			{
				hullIndices[i] = i;
			}
		}

		public static Vector3[] GetSelectedVertices(Hull hull, Vector3[] meshVertices, int[] meshIndices)
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<int, int> dictionary = new Dictionary<int, int>();
			foreach (int selectedFace in hull.selectedFaces)
			{
				int num = meshIndices[selectedFace * 3];
				int num2 = meshIndices[selectedFace * 3 + 1];
				int num3 = meshIndices[selectedFace * 3 + 2];
				dictionary[num] = num;
				dictionary[num2] = num2;
				dictionary[num3] = num3;
			}
			List<Vector3> list = new List<Vector3>();
			foreach (int key in dictionary.Keys)
			{
				list.Add(meshVertices[key]);
			}
			return list.ToArray();
		}

		private TriangleBucket FindBestBucket(Triangle tri, float thresholdAngleDeg, List<TriangleBucket> buckets)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_005a: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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)
			TriangleBucket result = null;
			float num = float.PositiveInfinity;
			foreach (TriangleBucket bucket in buckets)
			{
				float num2 = Vector3.Angle(tri.normal, bucket.GetAverageNormal());
				if (num2 < thresholdAngleDeg && num2 < num)
				{
					num = num2;
					result = bucket;
					continue;
				}
				float num3 = Vector3.Angle(tri.normal * -1f, bucket.GetAverageNormal());
				if (num3 < thresholdAngleDeg && num3 < num)
				{
					tri.normal *= -1f;
					num = num3;
					result = bucket;
				}
			}
			return result;
		}

		private void MergeClosestBuckets(List<TriangleBucket> buckets)
		{
			//IL_0033: 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)
			TriangleBucket triangleBucket = null;
			TriangleBucket triangleBucket2 = null;
			float num = float.PositiveInfinity;
			for (int i = 0; i < buckets.Count; i++)
			{
				for (int j = i + 1; j < buckets.Count; j++)
				{
					TriangleBucket triangleBucket3 = buckets[i];
					TriangleBucket triangleBucket4 = buckets[j];
					float num2 = Vector3.Angle(triangleBucket3.GetAverageNormal(), triangleBucket4.GetAverageNormal());
					if (num2 < num)
					{
						num = num2;
						triangleBucket = triangleBucket3;
						triangleBucket2 = triangleBucket4;
					}
				}
			}
			if (triangleBucket != null && triangleBucket2 != null)
			{
				buckets.Remove(triangleBucket2);
				triangleBucket.Add(triangleBucket2);
			}
		}

		private ConstructionPlane CreateConstructionPlane(TriangleBucket primaryBucket, TriangleBucket secondaryBucket, TriangleBucket tertiaryBucket)
		{
			//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)
			//IL_0049: 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_0050: 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_0054: 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_0016: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0025: 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_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)
			//IL_002d: 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_0068: 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_007c: 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_0080: 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)
			if (primaryBucket != null && secondaryBucket != null)
			{
				Vector3 averageNormal = primaryBucket.GetAverageNormal();
				Vector3 t = Vector3.Cross(averageNormal, secondaryBucket.GetAverageNormal());
				Vector3 averageCenter = primaryBucket.GetAverageCenter();
				return new ConstructionPlane(averageCenter, averageNormal, t);
			}
			if (primaryBucket != null)
			{
				Vector3 averageNormal2 = primaryBucket.GetAverageNormal();
				Vector3 averageCenter2 = primaryBucket.GetAverageCenter();
				Vector3 t2 = Vector3.Cross(averageNormal2, (!(Vector3.Dot(averageNormal2, Vector3.up) > 0.5f)) ? Vector3.up : Vector3.right);
				return new ConstructionPlane(averageCenter2, averageNormal2, t2);
			}
			return null;
		}
	}
	public class GizmoUtils
	{
		public static void ToggleGizmos(bool gizmosOn)
		{
			int num = (gizmosOn ? 1 : 0);
			Assembly assembly = Assembly.GetAssembly(typeof(Editor));
			Type type = assembly.GetType("UnityEditor.AnnotationUtility");
			if ((object)type == null)
			{
				return;
			}
			MethodInfo method = type.GetMethod("GetAnnotations", BindingFlags.Static | BindingFlags.NonPublic);
			MethodInfo method2 = type.GetMethod("SetGizmoEnabled", BindingFlags.Static | BindingFlags.NonPublic);
			MethodInfo method3 = type.GetMethod("SetIconEnabled", BindingFlags.Static | BindingFlags.NonPublic);
			object obj = method.Invoke(null, null);
			foreach (object item in (IEnumerable)obj)
			{
				Type type2 = item.GetType();
				FieldInfo field = type2.GetField("classID", BindingFlags.Instance | BindingFlags.Public);
				FieldInfo field2 = type2.GetField("scriptClass", BindingFlags.Instance | BindingFlags.Public);
				if ((object)field == null || (object)field2 == null)
				{
					continue;
				}
				int num2 = (int)field.GetValue(item);
				string text = (string)field2.GetValue(item);
				if (text == "HullPainter")
				{
					switch (method2.GetParameters().Length)
					{
					case 3:
						method2.Invoke(null, new object[3] { num2, text, num });
						break;
					case 4:
						method2.Invoke(null, new object[4] { num2, text, num, true });
						break;
					}
					int num3 = method3.GetParameters().Length;
					if (num3 == 3)
					{
						method3.Invoke(null, new object[3] { num2, text, num });
					}
				}
			}
		}
	}
	public class HullData : ScriptableObject
	{
	}
	public class HullMapping
	{
		public Hull sourceHull;

		public Collider generatedCollider;

		public MeshCollider[] autoGeneratedColliders;

		public HullPainterChild targetChild;

		public HullPainterChild[] targetAutoGeneratedChilds;

		public void AddAutoChild(HullPainterChild newChild, MeshCollider newCollider)
		{
			if ((Object)(object)newChild != (Object)null)
			{
				List<HullPainterChild> list = new List<HullPainterChild>();
				if (targetAutoGeneratedChilds != null)
				{
					list.AddRange(targetAutoGeneratedChilds);
				}
				if (!list.Contains(newChild))
				{
					list.Add(newChild);
					targetAutoGeneratedChilds = list.ToArray();
				}
			}
			if ((Object)(object)newCollider != (Object)null)
			{
				List<MeshCollider> list2 = new List<MeshCollider>();
				if (autoGeneratedColliders != null)
				{
					list2.AddRange(autoGeneratedColliders);
				}
				if (!list2.Contains(newCollider))
				{
					list2.Add(newCollider);
					autoGeneratedColliders = list2.ToArray();
				}
			}
		}
	}
	public class HullPainter : MonoBehaviour
	{
		public PaintingData paintingData;

		public HullData hullData;

		private List<HullMapping> hullMapping;

		private Mesh debugMesh;

		private void OnDestroy()
		{
			SceneView.RepaintAll();
		}

		public void CreateColliderComponents(Mesh[] autoHulls)
		{
			CreateHullMapping();
			foreach (Hull hull in paintingData.hulls)
			{
				UpdateCollider(hull);
			}
			foreach (Hull hull2 in paintingData.hulls)
			{
				CreateAutoHulls(hull2, autoHulls);
			}
		}

		public void RemoveAllColliders()
		{
			if (hullMapping == null)
			{
				return;
			}
			foreach (HullMapping item in hullMapping)
			{
				DestroyImmediateWithUndo((Object)(object)item.generatedCollider);
				if (item.autoGeneratedColliders != null)
				{
					MeshCollider[] autoGeneratedColliders = item.autoGeneratedColliders;
					foreach (MeshCollider obj in autoGeneratedColliders)
					{
						DestroyImmediateWithUndo((Object)(object)obj);
					}
				}
			}
			for (int num = hullMapping.Count - 1; num >= 0; num--)
			{
				if ((Object)(object)hullMapping[num].targetChild != (Object)null)
				{
					hullMapping.RemoveAt(num);
				}
			}
		}

		public void RemoveAllGenerated()
		{
			CreateHullMapping();
			foreach (HullMapping item in hullMapping)
			{
				DestroyImmediateWithUndo((Object)(object)item.generatedCollider);
				if ((Object)(object)item.targetChild != (Object)null)
				{
					DestroyImmediateWithUndo((Object)(object)((Component)item.targetChild).gameObject);
				}
				if (item.autoGeneratedColliders != null)
				{
					MeshCollider[] autoGeneratedColliders = item.autoGeneratedColliders;
					foreach (MeshCollider obj in autoGeneratedColliders)
					{
						DestroyImmediateWithUndo((Object)(object)obj);
					}
				}
				if (item.targetAutoGeneratedChilds == null)
				{
					continue;
				}
				HullPainterChild[] targetAutoGeneratedChilds = item.targetAutoGeneratedChilds;
				foreach (HullPainterChild hullPainterChild in targetAutoGeneratedChilds)
				{
					GameObject gameObject = ((Component)hullPainterChild).gameObject;
					DestroyImmediateWithUndo((Object)(object)hullPainterChild);
					if (gameObject.transform.childCount == 0 && gameObject.GetComponents<Component>().Length == 1)
					{
						DestroyImmediateWithUndo((Object)(object)gameObject);
					}
				}
			}
		}

		private static bool IsDeletable(GameObject obj)
		{
			Component[] components = obj.GetComponents<Component>();
			int num = 0;
			Component[] array = components;
			foreach (Component val in array)
			{
				if (val is Transform || val is Collider || val is HullPainter || val is HullPainterChild)
				{
					num++;
				}
			}
			return components.Length == num;
		}

		private static void DestroyImmediateWithUndo(Object obj)
		{
			if (!(obj == (Object)null))
			{
				Undo.DestroyObjectImmediate(obj);
			}
		}

		private void CreateHullMapping()
		{
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
			if (this.hullMapping == null)
			{
				this.hullMapping = new List<HullMapping>();
			}
			for (int num = this.hullMapping.Count - 1; num >= 0; num--)
			{
				HullMapping hullMapping = this.hullMapping[num];
				if (hullMapping == null || hullMapping.sourceHull == null || ((Object)(object)hullMapping.generatedCollider == (Object)null && (Object)(object)hullMapping.targetChild == (Object)null))
				{
					this.hullMapping.RemoveAt(num);
				}
			}
			foreach (Hull hull4 in paintingData.hulls)
			{
				if (IsMapped(hull4))
				{
					Collider val = FindExistingCollider(this.hullMapping, hull4);
					bool flag = hull4.type == HullType.ConvexHull && val is MeshCollider;
					bool flag2 = hull4.type == HullType.Box && val is BoxCollider;
					bool flag3 = hull4.type == HullType.Sphere && val is SphereCollider;
					bool flag4 = hull4.type == HullType.Face && val is MeshCollider;
					bool flag5 = hull4.type == HullType.FaceAsBox && val is BoxCollider;
					bool flag6 = hull4.type == HullType.Auto && val is MeshCollider && hull4.autoMeshes != null && hull4.autoMeshes.Length > 0;
					bool flag7 = flag || flag2 || flag3 || flag4 || flag5 || flag6;
					bool flag8 = (Object)(object)val == (Object)null || hull4.isChildCollider == ((Object)(object)((Component)val).transform.parent == (Object)(object)((Component)this).transform) || hull4.type == HullType.Auto;
					if (!flag7 || !flag8)
					{
						DestroyImmediateWithUndo((Object)(object)val);
						RemoveMapping(hull4);
					}
				}
			}
			List<Hull> list = new List<Hull>();
			List<Collider> list2 = new List<Collider>();
			List<HullPainterChild> list3 = new List<HullPainterChild>();
			foreach (Hull hull5 in paintingData.hulls)
			{
				if (!IsMapped(hull5))
				{
					list.Add(hull5);
				}
			}
			foreach (Collider item in FindLocal<Collider>())
			{
				if (!IsMapped(item))
				{
					list2.Add(item);
				}
			}
			foreach (HullPainterChild item2 in FindLocal<HullPainterChild>())
			{
				if (!IsMapped(item2))
				{
					list3.Add(item2);
				}
			}
			for (int num2 = list.Count - 1; num2 >= 0; num2--)
			{
				Hull hull = list[num2];
				bool flag9 = false;
				for (int num3 = list2.Count - 1; num3 >= 0; num3--)
				{
					Collider val2 = list2[num3];
					MeshCollider val3 = (MeshCollider)(object)((val2 is MeshCollider) ? val2 : null);
					BoxCollider val4 = (BoxCollider)(object)((val2 is BoxCollider) ? val2 : null);
					SphereCollider val5 = (SphereCollider)(object)((val2 is SphereCollider) ? val2 : null);
					HullPainterChild hullPainterChild = null;
					if ((Object)(object)((Component)val2).transform.parent == (Object)(object)((Component)this).transform)
					{
						hullPainterChild = ((Component)val2).gameObject.GetComponent<HullPainterChild>();
					}
					bool flag10 = hull.isChildCollider && (Object)(object)((Component)val2).transform.parent == (Object)(object)((Component)this).transform;
					if ((Object)(object)hullPainterChild != (Object)null && hullPainterChild.isAutoHull && hull.type == HullType.Auto && (Object)(object)val3 != (Object)null && hull.ContainsAutoMesh(val3.sharedMesh))
					{
						HullMapping hullMapping2 = FindMapping(hull);
						if (hullMapping2 == null)
						{
							hullMapping2 = new HullMapping();
							hullMapping2.sourceHull = hull;
							this.hullMapping.Add(hullMapping2);
						}
						hullMapping2.AddAutoChild(hullPainterChild, (MeshCollider)(object)((val2 is MeshCollider) ? val2 : null));
						hullPainterChild.parent = this;
						list2.RemoveAt(num3);
						list3.Remove(hullPainterChild);
						flag9 = true;
					}
					else if (flag10)
					{
						bool flag11 = hull.type == HullType.Box && val2 is BoxCollider && Approximately(((Bounds)(ref hull.collisionBox)).center, val4.center) && Approximately(((Bounds)(ref hull.collisionBox)).size, val4.size);
						bool flag12 = hull.type == HullType.Sphere && val2 is SphereCollider && hull.collisionSphere != null && Approximately(hull.collisionSphere.center, val5.center) && Approximately(hull.collisionSphere.radius, val5.radius);
						bool flag13 = hull.type == HullType.ConvexHull && val2 is MeshCollider && (Object)(object)val3.sharedMesh == (Object)(object)hull.collisionMesh;
						bool flag14 = hull.type == HullType.Face && val2 is MeshCollider && (Object)(object)val3.sharedMesh == (Object)(object)hull.faceCollisionMesh;
						bool flag15 = hull.type == HullType.FaceAsBox && val2 is BoxCollider && Approximately(hull.faceBoxCenter, val4.center) && Approximately(hull.faceBoxSize, val4.size);
						if (flag11 || flag12 || flag13 || flag14 || flag15)
						{
							AddMapping(hull, val2, hullPainterChild);
							list.RemoveAt(num2);
							list2.RemoveAt(num3);
							for (int i = 0; i < list3.Count; i++)
							{
								if ((Object)(object)list3[i] == (Object)(object)hullPainterChild)
								{
									list3.RemoveAt(i);
									break;
								}
							}
							break;
						}
					}
				}
				if (flag9)
				{
					list.RemoveAt(num2);
				}
			}
			for (int num4 = list.Count - 1; num4 >= 0; num4--)
			{
				Hull hull2 = list[num4];
				if (hull2.isChildCollider)
				{
					for (int num5 = list3.Count - 1; num5 >= 0; num5--)
					{
						HullPainterChild child = list3[num5];
						HullMapping hullMapping3 = FindMapping(child);
						if (hullMapping3 != null && hullMapping3.sourceHull != null)
						{
							if ((Object)(object)hullMapping3.generatedCollider == (Object)null)
							{
								RecreateChildCollider(hullMapping3);
							}
							list.RemoveAt(num4);
							list3.RemoveAt(num5);
							break;
						}
					}
				}
			}
			for (int num6 = list.Count - 1; num6 >= 0; num6--)
			{
				Hull hull3 = list[num6];
				if (hull3.isChildCollider && hull3.type == HullType.Auto)
				{
					bool flag16 = false;
					for (int num7 = list3.Count - 1; num7 >= 0; num7--)
					{
						HullPainterChild hullPainterChild2 = list3[num7];
						if (hullPainterChild2.isAutoHull && ((Object)((Component)hullPainterChild2).gameObject).name.StartsWith(hull3.name))
						{
							HullMapping hullMapping4 = FindMapping(hull3);
							if (hullMapping4 == null)
							{
								hullMapping4 = new HullMapping();
								hullMapping4.sourceHull = hull3;
								this.hullMapping.Add(hullMapping4);
							}
							hullMapping4.AddAutoChild(hullPainterChild2, null);
							list3.RemoveAt(num7);
							flag16 = true;
						}
					}
					if (flag16)
					{
						list.RemoveAt(num6);
					}
				}
			}
			foreach (HullMapping item3 in this.hullMapping)
			{
				if ((Object)(object)item3.targetChild != (Object)null && (Object)(object)item3.generatedCollider == (Object)null)
				{
					RecreateChildCollider(item3);
				}
			}
			foreach (HullMapping item4 in this.hullMapping)
			{
				if ((Object)(object)item4.targetChild == (Object)null && (Object)(object)item4.generatedCollider != (Object)null && (Object)(object)((Component)item4.generatedCollider).transform.parent == (Object)(object)((Component)this).transform)
				{
					HullPainterChild hullPainterChild3 = AddComponent<HullPainterChild>(((Component)item4.generatedCollider).gameObject);
					hullPainterChild3.parent = this;
					item4.targetChild = hullPainterChild3;
				}
			}
			foreach (Hull item5 in list)
			{
				if (item5.type == HullType.Box)
				{
					CreateCollider<BoxCollider>(item5);
				}
				else if (item5.type == HullType.Sphere)
				{
					CreateCollider<SphereCollider>(item5);
				}
				else if (item5.type == HullType.ConvexHull)
				{
					CreateCollider<MeshCollider>(item5);
				}
				else if (item5.type == HullType.Face)
				{
					CreateCollider<MeshCollider>(item5);
				}
				else if (item5.type == HullType.FaceAsBox)
				{
					CreateCollider<BoxCollider>(item5);
				}
			}
			foreach (Collider item6 in list2)
			{
				if ((Object)(object)item6 == (Object)null)
				{
					continue;
				}
				if ((Object)(object)((Component)item6).gameObject == (Object)(object)((Component)this).gameObject)
				{
					DestroyImmediateWithUndo((Object)(object)item6);
					continue;
				}
				GameObject gameObject = ((Component)item6).gameObject;
				DestroyImmediateWithUndo((Object)(object)item6);
				DestroyImmediateWithUndo((Object)(object)gameObject.GetComponent<HullPainterChild>());
				if (IsDeletable(gameObject))
				{
					DestroyImmediateWithUndo((Object)(object)gameObject);
				}
			}
			foreach (HullPainterChild item7 in list3)
			{
				if (!((Object)(object)item7 == (Object)null))
				{
					GameObject gameObject2 = ((Component)item7).gameObject;
					DestroyImmediateWithUndo((Object)(object)item7);
					DestroyImmediateWithUndo((Object)(object)gameObject2.GetComponent<Collider>());
					if (IsDeletable(gameObject2))
					{
						DestroyImmediateWithUndo((Object)(object)gameObject2);
					}
				}
			}
		}

		private static bool Approximately(Vector3 lhs, Vector3 rhs)
		{
			return Mathf.Approximately(lhs.x, rhs.x) && Mathf.Approximately(lhs.y, rhs.y) && Mathf.Approximately(lhs.z, rhs.z);
		}

		private static bool Approximately(float lhs, float rhs)
		{
			return Mathf.Approximately(lhs, rhs);
		}

		private void CreateCollider<T>(Hull sourceHull) where T : Collider
		{
			//IL_0031: 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_0051: Unknown result type (might be due to invalid IL or missing references)
			if (sourceHull.isChildCollider)
			{
				GameObject val = CreateGameObject(sourceHull.name);
				val.transform.SetParent(((Component)this).transform, false);
				val.transform.localPosition = Vector3.zero;
				val.transform.localRotation = Quaternion.identity;
				val.transform.localScale = Vector3.one;
				HullPainterChild hullPainterChild = AddComponent<HullPainterChild>(val);
				hullPainterChild.parent = this;
				T val2 = AddComponent<T>(val);
				AddMapping(sourceHull, (Collider)(object)val2, hullPainterChild);
			}
			else
			{
				T val3 = AddComponent<T>(((Component)this).gameObject);
				AddMapping(sourceHull, (Collider)(object)val3, null);
			}
		}

		private void RecreateChildCollider(HullMapping mapping)
		{
			if (mapping != null && mapping.sourceHull != null && mapping.sourceHull.isChildCollider)
			{
				if (mapping.sourceHull.type == HullType.Box)
				{
					RecreateChildCollider<BoxCollider>(mapping);
				}
				else if (mapping.sourceHull.type == HullType.Sphere)
				{
					RecreateChildCollider<SphereCollider>(mapping);
				}
				else if (mapping.sourceHull.type == HullType.ConvexHull)
				{
					RecreateChildCollider<MeshCollider>(mapping);
				}
				else if (mapping.sourceHull.type == HullType.Face)
				{
					RecreateChildCollider<MeshCollider>(mapping);
				}
				else if (mapping.sourceHull.type == HullType.FaceAsBox)
				{
					RecreateChildCollider<BoxCollider>(mapping);
				}
			}
		}

		private void RecreateChildCollider<T>(HullMapping mapping) where T : Collider
		{
			if (mapping.sourceHull != null && mapping.sourceHull.isChildCollider)
			{
				T val = AddComponent<T>(((Component)mapping.targetChild).gameObject);
				mapping.generatedCollider = (Collider)(object)val;
			}
		}

		private void UpdateCollider(Hull hull)
		{
			//IL_0028: 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_00ca: 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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0091: 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_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			Collider val = null;
			if (hull.type == HullType.Box)
			{
				Collider obj = FindExistingCollider(hullMapping, hull);
				BoxCollider val2 = (BoxCollider)(object)((obj is BoxCollider) ? obj : null);
				val2.center = ((Bounds)(ref hull.collisionBox)).center;
				val2.size = ((Bounds)(ref hull.collisionBox)).size + ((!hull.enableInflation) ? Vector3.zero : (Vector3.one * hull.inflationAmount));
				if (hull.isChildCollider)
				{
					((Component)val2).transform.localPosition = hull.boxPosition;
					((Component)val2).transform.localRotation = hull.boxRotation;
				}
				val = (Collider)(object)val2;
			}
			else if (hull.type == HullType.Sphere)
			{
				Collider obj2 = FindExistingCollider(hullMapping, hull);
				SphereCollider val3 = (SphereCollider)(object)((obj2 is SphereCollider) ? obj2 : null);
				val3.center = hull.collisionSphere.center;
				val3.radius = hull.collisionSphere.radius + ((!hull.enableInflation) ? 0f : hull.inflationAmount);
				val = (Collider)(object)val3;
			}
			else if (hull.type == HullType.ConvexHull)
			{
				Collider obj3 = FindExistingCollider(hullMapping, hull);
				MeshCollider val4 = (MeshCollider)(object)((obj3 is MeshCollider) ? obj3 : null);
				val4.sharedMesh = hull.collisionMesh;
				val4.convex = true;
				val4.inflateMesh = hull.enableInflation;
				val4.skinWidth = hull.inflationAmount;
				val = (Collider)(object)val4;
			}
			else if (hull.type == HullType.Face)
			{
				Collider obj4 = FindExistingCollider(hullMapping, hull);
				MeshCollider val5 = (MeshCollider)(object)((obj4 is MeshCollider) ? obj4 : null);
				val5.sharedMesh = hull.faceCollisionMesh;
				val5.convex = true;
				val5.inflateMesh = hull.enableInflation;
				val5.skinWidth = hull.inflationAmount;
				val = (Collider)(object)val5;
			}
			else if (hull.type == HullType.FaceAsBox)
			{
				Collider obj5 = FindExistingCollider(hullMapping, hull);
				BoxCollider val6 = (BoxCollider)(object)((obj5 is BoxCollider) ? obj5 : null);
				val6.center = hull.faceBoxCenter;
				val6.size = hull.faceBoxSize + ((!hull.enableInflation) ? Vector3.zero : (Vector3.one * hull.inflationAmount));
				if (hull.isChildCollider)
				{
					((Component)val6).transform.localRotation = hull.faceAsBoxRotation;
				}
				val = (Collider)(object)val6;
			}
			else if (hull.type != HullType.Auto)
			{
			}
			if ((Object)(object)val != (Object)null)
			{
				val.material = hull.material;
				val.isTrigger = hull.isTrigger;
				if (hull.isChildCollider)
				{
					((Object)((Component)val).gameObject).name = hull.name;
				}
			}
		}

		public void SetAllTypes(HullType newType)
		{
			foreach (Hull hull in paintingData.hulls)
			{
				hull.type = newType;
			}
		}

		public void SetAllMaterials(PhysicMaterial newMaterial)
		{
			foreach (Hull hull in paintingData.hulls)
			{
				hull.material = newMaterial;
			}
		}

		public void SetAllAsChild(bool isChild)
		{
			foreach (Hull hull in paintingData.hulls)
			{
				hull.isChildCollider = isChild;
			}
		}

		public void SetAllAsTrigger(bool isTrigger)
		{
			foreach (Hull hull in paintingData.hulls)
			{
				hull.isTrigger = isTrigger;
			}
		}

		private List<T> FindLocal<T>() where T : Component
		{
			List<T> list = new List<T>();
			list.AddRange(((Component)this).gameObject.GetComponents<T>());
			for (int i = 0; i < ((Component)this).transform.childCount; i++)
			{
				list.AddRange(((Component)((Component)this).transform.GetChild(i)).GetComponents<T>());
			}
			return list;
		}

		private bool IsMapped(Hull hull)
		{
			if (hullMapping == null)
			{
				return false;
			}
			foreach (HullMapping item in hullMapping)
			{
				if (item.sourceHull == hull)
				{
					return true;
				}
			}
			return false;
		}

		private bool IsMapped(Collider col)
		{
			if (hullMapping == null)
			{
				return false;
			}
			foreach (HullMapping item in hullMapping)
			{
				if ((Object)(object)item.generatedCollider == (Object)(object)col)
				{
					return true;
				}
			}
			return false;
		}

		private bool IsMapped(HullPainterChild child)
		{
			if (hullMapping == null)
			{
				return false;
			}
			foreach (HullMapping item in hullMapping)
			{
				if ((Object)(object)item.targetChild == (Object)(object)child)
				{
					return true;
				}
			}
			return false;
		}

		private void AddMapping(Hull hull, Collider col, HullPainterChild painterChild)
		{
			HullMapping hullMapping = new HullMapping();
			hullMapping.sourceHull = hull;
			hullMapping.generatedCollider = col;
			hullMapping.targetChild = painterChild;
			HullMapping item = hullMapping;
			this.hullMapping.Add(item);
		}

		private void RemoveMapping(Hull hull)
		{
			for (int i = 0; i < hullMapping.Count; i++)
			{
				if (hullMapping[i].sourceHull == hull)
				{
					hullMapping.RemoveAt(i);
					break;
				}
			}
		}

		private HullMapping FindMapping(HullPainterChild child)
		{
			if (hullMapping == null)
			{
				return null;
			}
			foreach (HullMapping item in hullMapping)
			{
				if ((Object)(object)item.targetChild == (Object)(object)child)
				{
					return item;
				}
			}
			return null;
		}

		private HullMapping FindMapping(Hull hull)
		{
			if (hullMapping == null)
			{
				return null;
			}
			foreach (HullMapping item in hullMapping)
			{
				if (item.sourceHull == hull)
				{
					return item;
				}
			}
			return null;
		}

		public Hull FindSourceHull(HullPainterChild child)
		{
			if (hullMapping == null)
			{
				return null;
			}
			foreach (HullMapping item in hullMapping)
			{
				if ((Object)(object)item.targetChild == (Object)(object)child)
				{
					return item.sourceHull;
				}
				HullPainterChild[] targetAutoGeneratedChilds = item.targetAutoGeneratedChilds;
				foreach (HullPainterChild hullPainterChild in targetAutoGeneratedChilds)
				{
					if ((Object)(object)hullPainterChild == (Object)(object)child)
					{
						return item.sourceHull;
					}
				}
			}
			return null;
		}

		private static Collider FindExistingCollider(List<HullMapping> mappings, Hull hull)
		{
			foreach (HullMapping mapping in mappings)
			{
				if (mapping.sourceHull == hull)
				{
					return mapping.generatedCollider;
				}
			}
			return null;
		}

		private void CreateAutoHulls(Hull hull, Mesh[] autoHulls)
		{
			if (hull.type != HullType.Auto)
			{
				return;
			}
			HullMapping hullMapping = FindMapping(hull);
			if (hullMapping == null)
			{
				hullMapping = new HullMapping();
				hullMapping.sourceHull = hull;
				this.hullMapping.Add(hullMapping);
			}
			Mesh[] autoMeshes = hull.autoMeshes;
			List<MeshCollider> list = new List<MeshCollider>();
			if (hullMapping.targetAutoGeneratedChilds != null)
			{
				for (int i = 0; i < hullMapping.targetAutoGeneratedChilds.Length; i++)
				{
					if (hullMapping.autoGeneratedColliders != null && i < hullMapping.autoGeneratedColliders.Length)
					{
						list.Add(hullMapping.autoGeneratedColliders[i]);
						continue;
					}
					MeshCollider val = ((Component)hullMapping.targetAutoGeneratedChilds[i]).gameObject.AddComponent<MeshCollider>();
					val.convex = true;
					list.Add(val);
				}
			}
			for (int num = list.Count - 1; num >= 0; num--)
			{
				bool flag = (Object)(object)((Component)list[num]).transform != (Object)(object)((Component)this).transform;
				if (flag != Object.op_Implicit((Object)(object)((Component)this).transform) && hull.isChildCollider)
				{
					if (flag)
					{
						Object.DestroyImmediate((Object)(object)((Component)list[num]).gameObject);
					}
					else
					{
						Object.DestroyImmediate((Object)(object)list[num]);
					}
					list.RemoveAt(num);
				}
			}
			for (int j = 0; j < autoMeshes.Length; j++)
			{
				Mesh sharedMesh = autoMeshes[j];
				MeshCollider val2;
				if (j < list.Count)
				{
					val2 = list[j];
				}
				else if (hull.isChildCollider)
				{
					GameObject val3 = CreateGameObject("New child");
					val3.transform.SetParent(((Component)this).transform, false);
					HullPainterChild hullPainterChild = val3.AddComponent<HullPainterChild>();
					hullPainterChild.parent = this;
					hullPainterChild.isAutoHull = true;
					val2 = val3.AddComponent<MeshCollider>();
					list.Add(val2);
				}
				else
				{
					val2 = ((Component)this).gameObject.AddComponent<MeshCollider>();
					list.Add(val2);
				}
				val2.sharedMesh = sharedMesh;
				val2.convex = true;
				((Collider)val2).isTrigger = hull.isTrigger;
				((Collider)val2).material = hull.material;
			}
			if (hull.isChildCollider)
			{
				for (int k = 0; k < list.Count; k++)
				{
					((Object)((Component)list[k]).gameObject).name = $"{hull.name}.{k + 1}";
				}
			}
			List<HullPainterChild> list2 = new List<HullPainterChild>();
			foreach (MeshCollider item in list)
			{
				list2.Add(((Component)item).GetComponent<HullPainterChild>());
			}
			hullMapping.autoGeneratedColliders = list.ToArray();
			hullMapping.targetAutoGeneratedChilds = list2.ToArray();
		}

		private static GameObject CreateGameObject(string goName)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			GameObject val = new GameObject(goName);
			Undo.RegisterCreatedObjectUndo((Object)(object)val, "Created " + goName);
			return val;
		}

		private static T AddComponent<T>(GameObject targetObj) where T : Component
		{
			return (T)(object)Undo.AddComponent(targetObj, typeof(T));
		}

		private void OnDrawGizmos()
		{
		}
	}
	public class HullPainterChild : MonoBehaviour
	{
		public HullPainter parent;

		public bool isAutoHull;
	}
}
public class CuttableMesh
{
	private MeshRenderer inputMeshRenderer;

	private bool hasUvs;

	private bool hasUv1s;

	private bool hasColours;

	private List<CuttableSubMesh> subMeshes;

	public CuttableMesh(Mesh inputMesh)
	{
		Init(inputMesh, ((Object)inputMesh).name);
	}

	public CuttableMesh(MeshRenderer input)
	{
		inputMeshRenderer = input;
		MeshFilter component = ((Component)input).GetComponent<MeshFilter>();
		Mesh sharedMesh = component.sharedMesh;
		Init(sharedMesh, ((Object)input).name);
	}

	public CuttableMesh(CuttableMesh inputMesh, List<CuttableSubMesh> newSubMeshes)
	{
		inputMeshRenderer = inputMesh.inputMeshRenderer;
		hasUvs = inputMesh.hasUvs;
		hasUv1s = inputMesh.hasUv1s;
		hasColours = inputMesh.hasColours;
		subMeshes = new List<CuttableSubMesh>();
		subMeshes.AddRange(newSubMeshes);
	}

	private void Init(Mesh inputMesh, string debugName)
	{
		subMeshes = new List<CuttableSubMesh>();
		if (inputMesh.isReadable)
		{
			Vector3[] vertices = inputMesh.vertices;
			Vector3[] normals = inputMesh.normals;
			Vector2[] uv = inputMesh.uv;
			Vector2[] uv2 = inputMesh.uv2;
			Color32[] colors = inputMesh.colors32;
			hasUvs = uv != null && uv.Length > 0;
			hasUv1s = uv2 != null && uv2.Length > 0;
			hasColours = colors != null && colors.Length > 0;
			for (int i = 0; i < inputMesh.subMeshCount; i++)
			{
				int[] indices = inputMesh.GetIndices(i);
				CuttableSubMesh item = new CuttableSubMesh(indices, vertices, normals, colors, uv, uv2);
				subMeshes.Add(item);
			}
		}
		else
		{
			Debug.LogError((object)("CuttableMesh's input mesh is not readable: " + debugName), (Object)(object)inputMesh);
		}
	}

	public void Add(CuttableMesh other)
	{
		if (subMeshes.Count != other.subMeshes.Count)
		{
			throw new Exception("Mismatched submesh count");
		}
		for (int i = 0; i < subMeshes.Count; i++)
		{
			subMeshes[i].Add(other.subMeshes[i]);
		}
	}

	public int NumSubMeshes()
	{
		return subMeshes.Count;
	}

	public bool HasUvs()
	{
		return hasUvs;
	}

	public bool HasColours()
	{
		return hasColours;
	}

	public List<CuttableSubMesh> GetSubMeshes()
	{
		return subMeshes;
	}

	public CuttableSubMesh GetSubMesh(int index)
	{
		return subMeshes[index];
	}

	public Transform GetTransform()
	{
		if ((Object)(object)inputMeshRenderer != (Object)null)
		{
			return ((Component)inputMeshRenderer).transform;
		}
		return null;
	}

	public MeshRenderer ConvertToRenderer(string newObjectName)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//IL_003d: Unknown result typ

Nik_Stratagems.dll

Decompiled a week ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

[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 Nikpo.Nik_Stratagems
{
	[BepInPlugin("Nikpo.Nik_Stratagems", "Nik_Stratagems", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class Nik_StratagemsPlugin : 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(), "Nikpo.Nik_Stratagems");
			OtherLoader.RegisterDirectLoad(BasePath, "Nikpo.Nik_Stratagems", "", "", "modmas2024_item03", "");
		}
	}
}
namespace Nikpo
{
	public class ObjectLevelRotation : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.rotation = Quaternion.identity;
		}
	}
	public class ObjectLookAtPlayer : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0011: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
			((Component)this).transform.localEulerAngles = new Vector3(0f, ((Component)this).transform.localEulerAngles.y, 0f);
		}
	}
	public class UILookAtPlayer : MonoBehaviour
	{
		public Transform canvasToCheck;

		public float scaleFactor = 0.05f;

		public float minScale = 0.5f;

		public float maxScale = 2f;

		public float dotFadeThreshold = -0.8f;

		public float fadeSpeed = 0.1f;

		public float dotProductValue;

		private CanvasGroup canvasGroup;

		private void Start()
		{
			canvasGroup = ((Component)this).GetComponent<CanvasGroup>();
		}

		private void LateUpdate()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_005d: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_0095: 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_00a5: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
			float num = Vector3.Distance(((Component)this).transform.position, GM.CurrentPlayerBody.Head.position);
			num *= scaleFactor;
			num = Mathf.Clamp(num, minScale, maxScale);
			((Component)this).transform.localScale = Vector3.one * num;
			float x = ((Component)this).transform.localScale.x;
			Vector3 forward = canvasToCheck.forward;
			Vector3 normalized = ((Vector3)(ref forward)).normalized;
			Vector3 forward2 = GM.CurrentPlayerBody.Head.forward;
			Vector3 normalized2 = ((Vector3)(ref forward2)).normalized;
			dotProductValue = Vector3.Dot(normalized, normalized2);
			if (x <= minScale)
			{
				FadeOut();
			}
			else if (dotProductValue <= dotFadeThreshold)
			{
				FadeIn();
			}
			else
			{
				FadeOut();
			}
		}

		private void FadeIn()
		{
			canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 1f, fadeSpeed);
		}

		private void FadeOut()
		{
			canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 0.2f, fadeSpeed);
		}
	}
}

NSV.dll

Decompiled a week 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 H3VRUtils.MonoScripts.VisualModifiers;
using HarmonyLib;
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 LauncherHandle : MonoBehaviour
	{
		public GameObject LCH;

		public string GunName;

		public FVRPhysicalObject obj;

		public CarlGustaf Gun;

		public WorkingRigidbodies WR;

		private void Start()
		{
			//IL_0061: 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_00c4: 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)
			LCH = GameObject.Find(GunName);
			Gun = LCH.GetComponent<CarlGustaf>();
			WR = LCH.GetComponent<WorkingRigidbodies>();
			if ((Object)(object)WR != (Object)null)
			{
				((Component)this).gameObject.transform.position = ((Component)WR.G).transform.position;
				((Component)this).gameObject.transform.eulerAngles = ((Component)WR.GP).transform.eulerAngles;
				ConfigurableJoint val = ((Component)this).gameObject.AddComponent<ConfigurableJoint>();
				((Joint)val).connectedBody = WR.G;
				((Joint)val).autoConfigureConnectedAnchor = false;
				((Joint)val).connectedAnchor = new Vector3(0f, 0f, 0f);
				((Joint)val).anchor = new Vector3(0f, 0f, 0f);
				val.xMotion = (ConfigurableJointMotion)0;
				val.yMotion = (ConfigurableJointMotion)0;
				val.zMotion = (ConfigurableJointMotion)0;
				val.angularXMotion = (ConfigurableJointMotion)2;
				val.angularYMotion = (ConfigurableJointMotion)2;
				val.angularZMotion = (ConfigurableJointMotion)2;
			}
		}

		private void Update()
		{
			if ((Object)(object)LCH == (Object)null || (Object)(object)Gun == (Object)null || (Object)(object)WR == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			else if ((Object)(object)LCH != (Object)null && (Object)(object)Gun != (Object)null && (Object)(object)WR != (Object)null && (Object)(object)((FVRInteractiveObject)obj).m_hand != (Object)null && ((FVRInteractiveObject)obj).m_hand.Input.TriggerPressed)
			{
				Gun.TryToFire();
			}
		}
	}
	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 BelfFedMGLifter : MonoBehaviour
	{
		public FVRFireArmTopCover cover;

		public FVRFoldingStockXAxis lifter;

		public BoxCollider col;

		public OpenBoltReceiver gun;

		public float a = 45f;

		private void Update()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_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)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			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 < 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);
			}
		}
	}
	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 ClosedBoltDoubleSideHandleRot : MonoBehaviour
	{
		public GameObject LeftHandle;

		public GameObject RightHandle;

		public FVRInteractiveObject bolt;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: 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_0134: 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_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)bolt.m_hand != (Object)null)
			{
				if (Vector3.Distance(((Component)bolt.m_hand).transform.position, LeftHandle.transform.position) > Vector3.Distance(((Component)bolt.m_hand).transform.position, RightHandle.transform.position))
				{
					RightHandle.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
					LeftHandle.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
				else if (Vector3.Distance(((Component)bolt.m_hand).transform.position, LeftHandle.transform.position) < Vector3.Distance(((Component)bolt.m_hand).transform.position, RightHandle.transform.position))
				{
					LeftHandle.transform.localEulerAngles = new Vector3(0f, 270f, 0f);
					RightHandle.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
				else if (Vector3.Distance(((Component)bolt.m_hand).transform.position, LeftHandle.transform.position) == Vector3.Distance(((Component)bolt.m_hand).transform.position, RightHandle.transform.position))
				{
					LeftHandle.transform.localEulerAngles = new Vector3(0f, 270f, 0f);
					RightHandle.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
				}
			}
			else if ((Object)(object)bolt.m_hand == (Object)null)
			{
				LeftHandle.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				RightHandle.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class Lookat : MonoBehaviour
	{
		public GameObject mark;

		public Transform nearestAI;

		public SosigLink[] currentAI = null;

		public GameObject lookAtObj;

		public LAPD2019Laser laser;

		public Transform player;

		private void OnTriggerEnter(Collider other)
		{
			currentAI = ((Component)other).gameObject.GetComponents<SosigLink>();
		}

		private void Update()
		{
			//IL_004f: 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_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			if (currentAI == null || (Object)(object)nearestAI == (Object)null)
			{
				laser.TurnOff();
				mark.SetActive(false);
				mark.transform.localPosition = new Vector3(0f, 0f, 0f);
				lookAtObj.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if ((Object)(object)nearestAI != (Object)null)
			{
				laser.TurnOn();
				mark.SetActive(true);
				mark.transform.position = ((Component)nearestAI).transform.position;
				AxisLookAt(lookAtObj.transform, nearestAI.position, Vector3.forward);
			}
			AxisLookAt(mark.transform, lookAtObj.transform.position, Vector3.forward);
			if (currentAI != null)
			{
				nearestAI = GetNearestGameObject(player, currentAI);
			}
		}

		private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis)
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_0061: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = tr_self.rotation;
			Vector3 val = lookPos - tr_self.position;
			Vector3 val2 = tr_self.rotation * directionAxis;
			Vector3 val3 = Vector3.Cross(val2, val);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num = Vector3.Angle(val2, val);
			tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation;
			tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f);
		}

		public Transform GetNearestGameObject(Transform player, SosigLink[] objects)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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)
			Transform val = null;
			if (objects == null || (Object)(object)val == (Object)null)
			{
			}
			if (objects.Length > 0)
			{
				val = ((Component)objects[0]).transform;
				float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position);
				for (int i = 1; i < objects.Length; i++)
				{
					float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position);
					if (num > num2)
					{
						num = num2;
						val = ((Component)objects[i]).transform;
					}
				}
			}
			return val;
		}
	}
	public class Slotarea : MonoBehaviour
	{
		public GameObject parent;

		public void OnTriggerStay(Collider other)
		{
			//IL_002d: 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_006e: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)other).gameObject;
			FVRPhysicalObject component = gameObject.GetComponent<FVRPhysicalObject>();
			if (!((Object)(object)component != (Object)null) || !((Object)(object)gameObject != (Object)(object)parent) || (int)component.QBSlotType != 0 || ((FVRInteractiveObject)component).m_isHeld || !((Object)(object)component.m_quickbeltSlot == (Object)null))
			{
				return;
			}
			float num = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.LeftHand).transform.position);
			float num2 = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.RightHand).transform.position);
			if (num < 0.25f || num2 < 0.25f)
			{
				Rigidbody component2 = gameObject.GetComponent<Rigidbody>();
				if ((Object)(object)component2 != (Object)null)
				{
					gameObject.transform.SetParent(parent.transform);
					component2.useGravity = false;
					component2.isKinematic = true;
				}
			}
		}

		public void OnTriggerExit(Collider other)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)other).gameObject;
			FVRPhysicalObject component = gameObject.GetComponent<FVRPhysicalObject>();
			if ((Object)(object)component != (Object)null && (Object)(object)gameObject != (Object)(object)parent && (int)component.QBSlotType == 0 && ((FVRInteractiveObject)component).m_isHeld && (Object)(object)component.m_quickbeltSlot == (Object)null)
			{
				Rigidbody component2 = gameObject.GetComponent<Rigidbody>();
				if ((Object)(object)component2 != (Object)null)
				{
					gameObject.transform.SetParent(parent.transform);
					component2.useGravity = true;
					component2.isKinematic = false;
				}
			}
		}

		private void Update()
		{
		}
	}
	public class DynamoFlashLight : MonoBehaviour
	{
		public float magnith = 2.5f;

		public float pullmag = 25000f;

		public Collider col;

		public GameObject r0;

		public AudioEvent AudioSt;

		public GameObject Audio;

		public AudioSource Audios;

		public Rigidbody R;

		public RotateOverTime Magni;

		public RotateOverTime Magni2;

		public Rigidbody str1;

		public Rigidbody str2;

		public Rigidbody ring;

		public Rigidbody base1;

		public Rigidbody base2;

		public GameObject ringobj;

		public GameObject ringbase;

		public Light spotlight;

		public Material MatBody;

		public Material MatLens;

		public FVRPhysicalObject Mainobj;

		public FVRPhysicalObject Pullobj;

		public float MovSpeed;

		public float LocalVel;

		public float LastAV;

		public bool pulled = false;

		public float weight = 0f;

		private void Start()
		{
			pulled = false;
			Audio.SetActive(false);
			MatBody.SetFloat("_EmissionWeight", 0f);
			MatLens.SetFloat("_EmissionWeight", 0f);
			spotlight.intensity = 0f;
			Magni.angularVelocity.x = 0f;
			Magni.angularVelocity.y = 0f;
			Magni.angularVelocity.z = 0f;
			Magni2.angularVelocity.x = 0f;
			Magni2.angularVelocity.y = 0f;
			Magni2.angularVelocity.z = 0f;
		}

		private void Update()
		{
			//IL_0170: 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_0190: 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_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			Magni2.angularVelocity.x = 0f;
			Magni2.angularVelocity.y = 0f;
			Magni2.angularVelocity.z = Magni.angularVelocity.z * 100f;
			str1.isKinematic = false;
			str2.isKinematic = false;
			ring.isKinematic = false;
			base1.isKinematic = false;
			base2.isKinematic = false;
			if ((Object)(object)((FVRInteractiveObject)Mainobj).m_hand == (Object)null)
			{
				col.enabled = false;
			}
			else if ((Object)(object)((FVRInteractiveObject)Mainobj).m_hand != (Object)null)
			{
				col.enabled = true;
			}
			if ((Object)(object)((FVRInteractiveObject)Mainobj).m_hand == (Object)null || (Object)(object)((FVRInteractiveObject)Pullobj).m_hand == (Object)null)
			{
				LocalVel = 0f;
				LastAV = 0f;
			}
			else if ((Object)(object)((FVRInteractiveObject)Mainobj).m_hand != (Object)null && (Object)(object)((FVRInteractiveObject)Pullobj).m_hand != (Object)null)
			{
				r0.transform.localEulerAngles = new Vector3(0f, 0f, Vector3.Distance(ringobj.transform.position, ringbase.transform.position) * 5000f);
				LocalVel = (Vector3.Distance(ringobj.transform.position, ringbase.transform.position) - LastAV) * Time.deltaTime;
				LastAV = LocalVel;
				LocalVel = (Vector3.Distance(ringobj.transform.position, ringbase.transform.position) - LastAV) * Time.deltaTime;
				LastAV = LocalVel;
				if (LocalVel > magnith)
				{
					Magni.angularVelocity.x = 0f;
					Magni.angularVelocity.y = 0f;
					Magni.angularVelocity.z = Magni.angularVelocity.z + LocalVel * pullmag * Time.deltaTime;
				}
			}
			spotlight.intensity = Magni.angularVelocity.z * 0.025f;
			weight = spotlight.intensity * 0.4f;
			if (weight > 1f)
			{
				weight = 1f;
			}
			else if (weight < 0f)
			{
				weight = 0f;
			}
			MatBody.SetFloat("_EmissionWeight", weight);
			MatLens.SetFloat("_EmissionWeight", weight);
			if (spotlight.intensity > 3f)
			{
				spotlight.intensity = 3f;
			}
			else if (spotlight.intensity < 0f)
			{
				spotlight.intensity = 0f;
			}
			if (Magni.angularVelocity.z > 0f)
			{
				Audio.SetActive(true);
				Audios.volume = Magni.angularVelocity.z * 0.1f;
				Audios.pitch = 0.1f + Magni.angularVelocity.z * 0.01f;
			}
			else if (Magni.angularVelocity.z <= 0f)
			{
				Audio.SetActive(false);
				Audios.pitch = 0f;
				Audios.volume = 0f;
			}
			else if (Magni.angularVelocity.z > 1000f)
			{
				Magni.angularVelocity.z = 1000f;
			}
			if (Magni.angularVelocity.z > 0f)
			{
				Magni.angularVelocity.z = Magni.angularVelocity.z - 2.5f * Time.deltaTime;
			}
			else if (Magni.angularVelocity.z < 0f)
			{
				Magni.angularVelocity.z = 0f;
			}
			if (Audios.volume > 1f)
			{
				Audios.volume = 1f;
			}
			else if (Audios.volume < 0f)
			{
				Audios.volume = 0f;
			}
			if (Audios.pitch > 2f)
			{
				Audios.pitch = 2f;
			}
			if (Audios.pitch < 0f)
			{
				Audios.pitch = 0f;
			}
		}

		private void OnDestroy()
		{
			Object.Destroy((Object)(object)((Component)str1).gameObject);
			Object.Destroy((Object)(object)((Component)str2).gameObject);
			Object.Destroy((Object)(object)((Component)ring).gameObject);
			Object.Destroy((Object)(object)((Component)R).gameObject);
			Object.Destroy((Object)(object)((Component)base1).gameObject);
			Object.Destroy((Object)(object)((Component)base2).gameObject);
		}
	}
}
[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 LeverActionHandle : MonoBehaviour
	{
		public LeverActionFirearm LAF;

		public FVRAlternateGrip LAFFore;

		public FVRFireArmChamber chamber;

		public FVRPhysicalObject lever;

		public FVRPhysicalObject leverfore;

		public Collider levercol;

		public Collider forecol;

		public Collider LAFcol;

		public Collider LAFforecol;

		public HingeJoint HJ;

		public JointLimits JL;

		private void Start()
		{
			//IL_0028: 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)
			((JointLimits)(ref JL)).max = 0f;
			((JointLimits)(ref JL)).min = 0f;
			LAF.m_curLeverPos = (ZPos)2;
			LAF.m_lastLeverPos = (ZPos)2;
		}

		private void Update()
		{
			//IL_0008: 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_0022: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			HJ.limits = JL;
			if (((Component)lever).transform.localEulerAngles.x < 15f && ((Component)lever).transform.localEulerAngles.x >= 10f)
			{
				LAF.m_curLeverPos = (ZPos)2;
			}
			else if (((Component)lever).transform.localEulerAngles.x < 50f && ((Component)lever).transform.localEulerAngles.x > 40f)
			{
				LAF.m_curLeverPos = (ZPos)1;
			}
			else if (((Component)lever).transform.localEulerAngles.x <= 78f && ((Component)lever).transform.localEulerAngles.x > 73f)
			{
				LAF.m_curLeverPos = (ZPos)0;
			}
			LAF.m_lastLeverPos = LAF.m_curLeverPos;
			if ((Object)(object)((FVRInteractiveObject)LAF).m_hand != (Object)null)
			{
				if ((Object)(object)((FVRInteractiveObject)leverfore).m_hand != (Object)null)
				{
					((FVRInteractiveObject)LAFFore).BeginInteraction(((FVRInteractiveObject)leverfore).m_hand);
					((FVRInteractiveObject)leverfore).ForceBreakInteraction();
				}
				if ((Object)(object)((FVRInteractiveObject)LAFFore).m_hand == (Object)null)
				{
					if (chamber.IsFull && !chamber.IsSpent && !LAF.m_isLeverReleasePressed)
					{
						levercol.enabled = false;
						forecol.enabled = false;
						LAFcol.enabled = true;
						LAFforecol.enabled = true;
						((JointLimits)(ref JL)).max = 0f;
					}
					else if (!chamber.IsFull || chamber.IsSpent || LAF.m_isLeverReleasePressed)
					{
						levercol.enabled = true;
						forecol.enabled = true;
						LAFcol.enabled = false;
						LAFforecol.enabled = false;
						((FVRInteractiveObject)lever).BeginInteraction(((FVRInteractiveObject)LAF).m_hand);
						((FVRInteractiveObject)LAF).ForceBreakInteraction();
						((JointLimits)(ref JL)).max = 68f;
					}
				}
				else if ((Object)(object)((FVRInteractiveObject)LAFFore).m_hand != (Object)null)
				{
					if (chamber.IsFull && !chamber.IsSpent && !LAF.m_isLeverReleasePressed)
					{
						levercol.enabled = false;
						forecol.enabled = false;
						LAFcol.enabled = true;
						LAFforecol.enabled = true;
						((JointLimits)(ref JL)).max = 0f;
					}
					else if (!chamber.IsFull || chamber.IsSpent || LAF.m_isLeverReleasePressed)
					{
						levercol.enabled = true;
						forecol.enabled = true;
						LAFcol.enabled = false;
						LAFforecol.enabled = false;
						((FVRInteractiveObject)lever).BeginInteraction(((FVRInteractiveObject)LAF).m_hand);
						((FVRInteractiveObject)LAF).ForceBreakInteraction();
						((FVRInteractiveObject)leverfore).BeginInteraction(((FVRInteractiveObject)LAFFore).m_hand);
						((FVRInteractiveObject)LAFFore).ForceBreakInteraction();
						((JointLimits)(ref JL)).max = 68f;
					}
				}
			}
			else if ((Object)(object)((FVRInteractiveObject)lever).m_hand != (Object)null)
			{
				if ((Object)(object)((FVRInteractiveObject)LAFFore).m_hand != (Object)null)
				{
					((FVRInteractiveObject)leverfore).BeginInteraction(((FVRInteractiveObject)LAFFore).m_hand);
					((FVRInteractiveObject)LAFFore).ForceBreakInteraction();
				}
				if ((Object)(object)((FVRInteractiveObject)leverfore).m_hand == (Object)null)
				{
					if (chamber.IsFull && !chamber.IsSpent)
					{
						levercol.enabled = false;
						forecol.enabled = false;
						LAFcol.enabled = true;
						LAFforecol.enabled = true;
						((FVRInteractiveObject)LAF).BeginInteraction(((FVRInteractiveObject)lever).m_hand);
						((FVRInteractiveObject)lever).ForceBreakInteraction();
						((JointLimits)(ref JL)).max = 0f;
					}
					else if (!chamber.IsFull || chamber.IsSpent)
					{
						levercol.enabled = true;
						forecol.enabled = true;
						LAFcol.enabled = false;
						LAFforecol.enabled = false;
						((JointLimits)(ref JL)).max = 68f;
					}
				}
				else if ((Object)(object)((FVRInteractiveObject)leverfore).m_hand == (Object)null)
				{
					if (chamber.IsFull && !chamber.IsSpent)
					{
						levercol.enabled = false;
						forecol.enabled = false;
						LAFcol.enabled = true;
						LAFforecol.enabled = true;
						((FVRInteractiveObject)LAF).BeginInteraction(((FVRInteractiveObject)lever).m_hand);
						((FVRInteractiveObject)lever).ForceBreakInteraction();
						((FVRInteractiveObject)LAFFore).BeginInteraction(((FVRInteractiveObject)leverfore).m_hand);
						((FVRInteractiveObject)leverfore).ForceBreakInteraction();
						((JointLimits)(ref JL)).max = 0f;
					}
					else if (!chamber.IsFull || chamber.IsSpent)
					{
						levercol.enabled = true;
						forecol.enabled = true;
						LAFcol.enabled = false;
						LAFforecol.enabled = false;
						((JointLimits)(ref JL)).max = 68f;
					}
				}
			}
			else if ((Object)(object)((FVRInteractiveObject)lever).m_hand == (Object)null && (Object)(object)((FVRInteractiveObject)LAF).m_hand == (Object)null)
			{
				forecol.enabled = false;
				LAFforecol.enabled = true;
			}
		}
	}
	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);
			}
		}
	}
	public class FireRopeOB : MonoBehaviour
	{
		public OpenBoltReceiver gun;

		public GameObject trigger;

		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 (trigger.transform.localPosition.z >= 0.1f)
			{
				gun.Fire();
			}
			else if (!(trigger.transform.localPosition.z < 0.1f))
			{
			}
		}
	}
	public class KeepMeAlive : MonoBehaviour
	{
		public Rigidbody rb;

		private void Start()
		{
		}

		private void Update()
		{
			rb.isKinematic = false;
		}
	}
	public class MountedMG : MonoBehaviour
	{
		public GameObject elev;

		public GameObject hori;

		public GameObject XGEO;

		public GameObject YGEO;

		public WaggleJoint X;

		public WaggleJoint Y;

		public Rigidbody j1;

		public Rigidbody j2;

		public Rigidbody j3;

		public GameObject trig;

		public ClosedBoltWeapon gun;

		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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: 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_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: 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_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: 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_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_057e: Unknown result type (might be due to invalid IL or missing references)
			if (trig.transform.localPosition.x > 1f)
			{
				gun.Fire();
			}
			if (trig.transform.localPosition.x < 1f)
			{
			}
			j1.isKinematic = false;
			j2.isKinematic = false;
			j3.isKinematic = false;
			if (elev.transform.localPosition.y < 0.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				X.angleLimitLeft = 15f;
				X.angleLimitRight = 15f;
			}
			if (elev.transform.localPosition.y > 0.5f && elev.transform.localPosition.y < 1.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(15f, 0f, 0f);
				X.angleLimitLeft = 0f;
				X.angleLimitRight = 30f;
			}
			if (elev.transform.localPosition.y > 1.5f && elev.transform.localPosition.y < 2.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				X.angleLimitLeft = 15f;
				X.angleLimitRight = 15f;
			}
			if (elev.transform.localPosition.y > 2.5f && elev.transform.localPosition.y < 3.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(345f, 0f, 0f);
				X.angleLimitLeft = 30f;
				X.angleLimitRight = 0f;
			}
			if (elev.transform.localPosition.y > 3.5f && elev.transform.localPosition.y < 4.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				X.angleLimitLeft = 15f;
				X.angleLimitRight = 15f;
			}
			if (hori.transform.localPosition.y < 0.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
				Y.angleLimitLeft = 15f;
				Y.angleLimitRight = 15f;
			}
			if (hori.transform.localPosition.y > 0.5f && hori.transform.localPosition.y < 1.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(15f, 90f, 0f);
				Y.angleLimitLeft = 0f;
				Y.angleLimitRight = 30f;
			}
			if (hori.transform.localPosition.y > 1.5f && hori.transform.localPosition.y < 2.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
				Y.angleLimitLeft = 15f;
				Y.angleLimitRight = 15f;
			}
			if (hori.transform.localPosition.y > 2.5f && hori.transform.localPosition.y < 3.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(345f, 90f, 0f);
				Y.angleLimitLeft = 30f;
				Y.angleLimitRight = 0f;
			}
			if (hori.transform.localPosition.y > 3.5f && hori.transform.localPosition.y < 4.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
				Y.angleLimitLeft = 15f;
				Y.angleLimitRight = 15f;
			}
		}
	}
	public class Tripod : MonoBehaviour
	{
		public GameObject hinge;

		public GameObject trigger;

		public GameObject sliderot;

		public string gunname;

		public string gunnamebackup;

		public string gunnameold;

		public Transform slidemonut;

		public OpenBoltReceiver gun;

		private void Start()
		{
		}

		private void OnTriggerStay(Collider other)
		{
			//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_00a6: 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_011c: 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_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_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			if (hinge.transform.localEulerAngles.x > 45f)
			{
				if (!(((Object)((Component)other).gameObject).name == gunname) && !(((Object)((Component)other).gameObject).name == gunnamebackup) && !(((Object)((Component)other).gameObject).name == gunnameold))
				{
					return;
				}
				((Component)other).gameObject.transform.SetParent(slidemonut);
				((Component)other).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
				((Component)other).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				gun = ((Component)other).gameObject.GetComponent<OpenBoltReceiver>();
				Rigidbody component = ((Component)other).gameObject.GetComponent<Rigidbody>();
				component.isKinematic = true;
				component.useGravity = false;
				if ((Object)(object)gun != (Object)null)
				{
					if (trigger.transform.localEulerAngles.x > 45f)
					{
						gun.ReleaseSeer();
						gun.Fire();
					}
					else if (trigger.transform.localEulerAngles.x < 45f)
					{
						gun.EngageSeer();
					}
					if (gun.Chamber.IsFull)
					{
						sliderot.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
					}
					else if (!gun.Chamber.IsFull)
					{
						sliderot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					}
				}
			}
			else if (((Object)((Component)other).gameObject).name == gunname || ((Object)((Component)other).gameObject).name == gunnamebackup || ((Object)((Component)other).gameObject).name == gunnameold)
			{
				Rigidbody component2 = ((Component)other).gameObject.GetComponent<Rigidbody>();
				component2.isKinematic = false;
				component2.useGravity = true;
				((Component)other).gameObject.transform.SetParent((Transform)null);
				gun = null;
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if (((Object)((Component)other).gameObject).name == gunname || ((Object)((Component)other).gameObject).name == gunnamebackup || ((Object)((Component)other).gameObject).name == gunnameold)
			{
				Rigidbody component = ((Component)other).gameObject.GetComponent<Rigidbody>();
				component.isKinematic = false;
				component.useGravity = true;
				((Component)other).gameObject.transform.SetParent((Transform)null);
				gun = null;
			}
		}

		private void Update()
		{
			if (!((Object)(object)gun == (Object)null))
			{
			}
		}
	}
	public class barrelc : MonoBehaviour
	{
		public FVRFireArmAttachmentMount mount;

		public GameObject plate;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (plate.transform.localEulerAngles.y < 45f)
			{
				if (mount.HasAttachmentsOnIt())
				{
					((Component)mount.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
			}
			else if (mount.HasAttachmentsOnIt())
			{
				((Component)mount.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
			}
		}
	}
	public class gunpodtrigger : MonoBehaviour
	{
		public FVRInteractiveObject obj;

		public GameObject trigger;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_00a4: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)obj.m_hand != (Object)null)
			{
				if (obj.m_hand.Input.TriggerPressed)
				{
					trigger.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
				}
				else
				{
					trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
			}
			else
			{
				trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class barrelchange : MonoBehaviour
	{
		public OpenBoltReceiver gun;

		public FVRFireArmAttachmentMount mount;

		private void Start()
		{
		}

		private void Update()
		{
			if (mount.HasAttachmentsOnIt())
			{
				if (!(((Object)((Component)mount.AttachmentsList[0]).gameObject).name == "MG3Barrel(Clone)"))
				{
					gun.m_fireSelectorMode = 0;
				}
			}
			else
			{
				gun.m_fireSelectorMode = 0;
			}
		}
	}
	public class BarrelLatch : MonoBehaviour
	{
		public Collider boltgrab;

		public GameObject knob;

		public GameObject bolt;

		public GameObject grab;

		public GameObject barrel;

		public float speed = 0f;

		public float speed_multi = 0.001f;

		public float fore = 0.2344f;

		public float rear = 0f;

		public WaggleJoint dustcover;

		public bool islocked = true;

		public GameObject audioopen;

		public GameObject audioclose;

		public GameObject audioflipopen;

		public GameObject audioflipclose;

		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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			if (barrel.transform.localPosition.z > 0.2f && bolt.transform.localPosition.z > 0.2f && dustcover.hingeGraphic.localRotation.x >= 20f)
			{
				dustcover.angleLimitLeft = 115f;
				dustcover.angleLimitRight = -115f;
				audioflipclose.SetActive(true);
				audioflipopen.SetActive(false);
			}
			if (barrel.transform.localPosition.z <= 0.2f || bolt.transform.localPosition.z <= 0.2f)
			{
				dustcover.angleLimitLeft = 100f;
				dustcover.angleLimitRight = 0f;
				audioflipclose.SetActive(false);
				audioflipopen.SetActive(true);
			}
			if (grab.transform.localEulerAngles.x < 45f && !islocked)
			{
				if (barrel.transform.localPosition.z < fore)
				{
					boltgrab.enabled = false;
					audioopen.SetActive(false);
					speed += speed_multi;
					if (speed > 1f)
					{
						speed = 1f;
					}
					barrel.transform.localPosition = Vector3.MoveTowards(barrel.transform.localPosition, new Vector3(0f, 0f, fore), speed);
				}
				if (barrel.transform.localPosition.z >= fore)
				{
					barrel.transform.localPosition = new Vector3(0f, 0f, fore);
					speed = 0f;
					audioopen.SetActive(true);
					boltgrab.enabled = true;
				}
			}
			if (grab.transform.localPosition.x > 45f && barrel.transform.localPosition.z < 0.01f && knob.transform.localEulerAngles.x < 45f)
			{
				barrel.transform.localPosition = new Vector3(0f, 0f, rear);
				islocked = true;
				audioclose.SetActive(true);
			}
			if (knob.transform.localEulerAngles.x > 45f)
			{
				islocked = false;
				audioclose.SetActive(false);
			}
		}
	}
}
namespace JerryAr.NSV
{
	[BepInPlugin("JerryAr.NSV", "NSV", "0.12.25")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class NSVPlugin : 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.NSV");
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.NSV", "", "", "modmas2024_item51", "");
		}
	}
}
namespace JerryComponent
{
	public class ChargingHandleSwing : MonoBehaviour
	{
		public GameObject CH;

		public FVRPhysicalObject ChargingHandle;

		public Transform CHroot;

		public LineRenderer LR;

		public OpenBoltReceiverBolt bolt;

		public float z = 0f;

		public AudioEvent boltout;

		public bool sound = false;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0018: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			LR.SetPosition(0, ((Component)ChargingHandle).gameObject.transform.position);
			LR.SetPosition(1, CHroot.position);
			if (!((Object)(object)((FVRInteractiveObject)ChargingHandle).m_hand != (Object)null))
			{
				return;
			}
			z = Vector3.Distance(CH.transform.position, CHroot.position);
			if (z < 0.5f)
			{
				((Component)bolt).transform.localPosition = new Vector3(0f, 0f, 2f - 4f * z);
			}
			if (z < 0.5f)
			{
				sound = false;
			}
			if (z > 0.6f)
			{
				if (!sound)
				{
					SM.PlayCoreSound((FVRPooledAudioType)0, boltout, ((Component)bolt).gameObject.transform.position);
					sound = true;
				}
				bolt.SetBoltToRear();
			}
		}
	}
	public class EjectionPort : MonoBehaviour
	{
		public OpenBoltReceiver gun;

		public GameObject Y;

		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_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_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_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_005c: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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)
			if (Y.transform.localEulerAngles.y > 0f && Y.transform.localEulerAngles.y < 45f)
			{
				gun.EjectionSpeed = new Vector3(Y.transform.localEulerAngles.y * 0.1f, 0f, 5f);
			}
			else if (Y.transform.localEulerAngles.y > 315f && Y.transform.localEulerAngles.y < 360f)
			{
				gun.EjectionSpeed = new Vector3((Y.transform.localEulerAngles.y - 360f) * 0.1f, 0f, 5f);
			}
		}
	}
	public class HMGGrip : MonoBehaviour
	{
		public GameObject HMG;

		public string GunName;

		public FVRPhysicalObject obj;

		public OpenBoltReceiver Gun;

		public WorkingRigidbodies WR;

		private void Start()
		{
			//IL_0061: 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_00c4: 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)
			HMG = GameObject.Find(GunName);
			Gun = HMG.GetComponent<OpenBoltReceiver>();
			WR = HMG.GetComponent<WorkingRigidbodies>();
			if ((Object)(object)WR != (Object)null)
			{
				((Component)this).gameObject.transform.position = ((Component)WR.G).transform.position;
				((Component)this).gameObject.transform.eulerAngles = ((Component)WR.GP).transform.eulerAngles;
				ConfigurableJoint val = ((Component)this).gameObject.AddComponent<ConfigurableJoint>();
				((Joint)val).connectedBody = WR.G;
				((Joint)val).autoConfigureConnectedAnchor = false;
				((Joint)val).connectedAnchor = new Vector3(0f, 0f, 0f);
				((Joint)val).anchor = new Vector3(0f, 0f, 0f);
				val.xMotion = (ConfigurableJointMotion)0;
				val.yMotion = (ConfigurableJointMotion)0;
				val.zMotion = (ConfigurableJointMotion)0;
				val.angularXMotion = (ConfigurableJointMotion)2;
				val.angularYMotion = (ConfigurableJointMotion)2;
				val.angularZMotion = (ConfigurableJointMotion)2;
			}
		}

		private void Update()
		{
			//IL_00bc: 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_00f5: 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)
			if ((Object)(object)HMG == (Object)null || (Object)(object)Gun == (Object)null || (Object)(object)WR == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			else
			{
				if (!((Object)(object)HMG != (Object)null) || !((Object)(object)Gun != (Object)null) || !((Object)(object)WR != (Object)null) || !((Object)(object)((FVRInteractiveObject)obj).m_hand != (Object)null))
				{
					return;
				}
				if (((FVRInteractiveObject)obj).m_hand.Input.TriggerPressed)
				{
					if (((Component)WR.TC).transform.localEulerAngles.x < 10f)
					{
						Gun.ReleaseSeer();
					}
					else if (((Component)WR.TC).transform.localEulerAngles.x > 10f)
					{
						Gun.EngageSeer();
					}
				}
				else if (!((FVRInteractiveObject)obj).m_hand.Input.TriggerPressed)
				{
					Gun.EngageSeer();
				}
			}
		}
	}
	public class OnlyOne : MonoBehaviour
	{
		private void Start()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			int num = 0;
			Object[] array = Object.FindObjectsOfType(typeof(FVRPhysicalObject));
			for (int i = 0; i < array.Length; i++)
			{
				FVRPhysicalObject val = (FVRPhysicalObject)array[i];
				num++;
				if (((Object)((Component)val).gameObject).name == ((Object)((Component)this).gameObject).name && !((Object)(object)((Component)val).gameObject == (Object)(object)((Component)this).gameObject) && (Object)(object)((Component)val).gameObject != (Object)(object)((Component)this).gameObject)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
		}

		private void Update()
		{
		}
	}
	public class SpringTopCover : MonoBehaviour
	{
		public GameObject topcover;

		public HingeJoint joint;

		public GameObject latch;

		public GameObject magwell;

		public GameObject Audioholder;

		public GameObject latchon;

		public GameObject latchoff;

		private JointSpring open;

		private JointSpring close;

		private bool TCclosed = true;

		private void Start()
		{
			open.spring = 50f;
			close.spring = 50f;
			open.damper = 1f;
			close.damper = 1f;
			open.targetPosition = 45f;
			close.targetPosition = 0f;
		}

		private void Update()
		{
			//IL_0027: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: 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)
			if (TCclosed)
			{
				topcover.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				magwell.SetActive(false);
				Audioholder.SetActive(true);
			}
			else if (!TCclosed)
			{
				magwell.SetActive(true);
				Audioholder.SetActive(false);
			}
			if (latch.transform.localEulerAngles.x < 25f)
			{
				latchon.SetActive(false);
				latchoff.SetActive(true);
				joint.spring = close;
				if (topcover.transform.localEulerAngles.x < 5f)
				{
					TCclosed = true;
				}
			}
			else if (latch.transform.localEulerAngles.x > 25f)
			{
				latchon.SetActive(true);
				latchoff.SetActive(false);
				TCclosed = false;
				joint.spring = open;
			}
		}
	}
	public class WorkingRigidbodies : MonoBehaviour
	{
		public Transform GP;

		public Rigidbody G;

		public Rigidbody X;

		public Rigidbody Y;

		public Rigidbody TC;

		public Rigidbody CH;

		private void Start()
		{
		}

		private void Update()
		{
			G.isKinematic = false;
			X.isKinematic = false;
			Y.isKinematic = false;
			TC.isKinematic = false;
			CH.isKinematic = false;
		}

		private void OnDestroy()
		{
			Object.Destroy((Object)(object)((Component)G).gameObject);
			Object.Destroy((Object)(object)((Component)X).gameObject);
			Object.Destroy((Object)(object)((Component)Y).gameObject);
			Object.Destroy((Object)(object)((Component)TC).gameObject);
			Object.Destroy((Object)(object)((Component)CH).gameObject);
		}
	}
	public class magphys : MonoBehaviour
	{
		public FVRFireArmMagazine mag;

		public GameObject phys;

		public Collider col1;

		public Collider col2;

		public Collider col3;

		private void Start()
		{
		}

		private void Update()
		{
			if ((Object)(object)mag.FireArm != (Object)null)
			{
				phys.SetActive(false);
				col1.enabled = false;
				col2.enabled = false;
				col3.enabled = false;
				col1.isTrigger = true;
				col2.isTrigger = true;
				col3.isTrigger = true;
			}
			else if ((Object)(object)mag.FireArm == (Object)null)
			{
				phys.SetActive(true);
				col1.enabled = true;
				col2.enabled = true;
				col3.enabled = true;
				col1.isTrigger = false;
				col2.isTrigger = false;
				col3.isTrigger = false;
			}
		}
	}
	public class AmmoBackPack : MonoBehaviour, IFVRDamageable
	{
		public Vector3 refv = Vector3.zero;

		public Transform belthold;

		public Transform beltexport;

		public SnapToPointRigidbody ltp;

		public Collider col;

		public GameObject main;

		public Rigidbody joint1;

		public Rigidbody joint2;

		public Rigidbody joint3;

		public Rigidbody joint4;

		public Rigidbody joint5;

		public Rigidbody joint6;

		public Rigidbody joint7;

		public Rigidbody SJroot;

		public string beltname;

		public GameObject newprefab;

		public GameObject brokenprefab;

		public GameObject beltlock;

		public GameObject belthead;

		public GameObject beltPieceObj;

		public FVRFireArmMagazine beltPiece;

		public float _damageRequired = 10000f;

		public float _damageReceived;

		private void Start()
		{
			newprefab.SetActive(true);
			brokenprefab.SetActive(false);
			beltPieceObj = GameObject.Find(beltname);
			if ((Object)(object)beltPieceObj != (Object)null)
			{
				beltPiece = beltPieceObj.GetComponent<FVRFireArmMagazine>();
				belthead = ((Component)beltPiece.RoundEjectionPos).gameObject;
			}
		}

		public void Damage(Damage dam)
		{
			//IL_0013: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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)
			if (!newprefab.activeInHierarchy)
			{
				return;
			}
			Vector3 val = dam.point + dam.hitNormal * Random.Range(0.002f, 0.008f);
			_damageReceived += dam.Dam_Blunt;
			if (_damageReceived >= _damageRequired)
			{
				((Behaviour)ltp).enabled = false;
				newprefab.SetActive(false);
				brokenprefab.SetActive(true);
				if ((Object)(object)beltPiece != (Object)null)
				{
					beltPiece.m_numRounds = 0;
					beltPiece.m_capacity = 0;
					belthead.SetActive(false);
				}
			}
		}

		private void Update()
		{
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: 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_0231: Unknown result type (might be due to invalid IL or missing references)
			col.enabled = true;
			col.isTrigger = false;
			((Component)col).gameObject.layer = 0;
			SJroot.isKinematic = false;
			joint1.isKinematic = false;
			joint2.isKinematic = false;
			joint3.isKinematic = false;
			joint4.isKinematic = false;
			joint5.isKinematic = false;
			joint6.isKinematic = false;
			joint7.isKinematic = false;
			if ((Object)(object)beltPieceObj == (Object)null || (Object)(object)beltPiece == (Object)null || (Object)(object)belthead == (Object)null)
			{
			}
			if ((Object)(object)beltPieceObj != (Object)null && (Object)(object)beltPiece != (Object)null && (Object)(object)belthead != (Object)null)
			{
				beltlock.transform.position = belthead.transform.position;
				beltlock.transform.eulerAngles = belthead.transform.eulerAngles;
				if ((Object)(object)beltPieceObj.GetComponent<Rigidbody>() != (Object)null)
				{
					beltPieceObj.GetComponent<Rigidbody>().useGravity = false;
				}
				else if (!((Object)(object)beltPieceObj.GetComponent<Rigidbody>() == (Object)null))
				{
				}
				if ((Object)(object)beltPiece.FireArm != (Object)null && Vector3.Distance(((Component)beltPiece.FireArm).transform.position, ((Component)beltexport).transform.position) > 1.5f)
				{
					beltPiece.FireArm.EjectMag(false);
				}
				if ((Object)(object)((FVRInteractiveObject)beltPiece).m_hand == (Object)null && (Object)(object)beltPiece.FireArm == (Object)null)
				{
					beltPieceObj.transform.position = belthold.position;
					beltPieceObj.transform.eulerAngles = belthold.eulerAngles;
				}
			}
			if ((Object)(object)main == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)SJroot).gameObject);
				Object.Destroy((Object)(object)((Component)joint1).gameObject);
				Object.Destroy((Object)(object)((Component)joint2).gameObject);
				Object.Destroy((Object)(object)((Component)joint3).gameObject);
				Object.Destroy((Object)(object)((Component)joint4).gameObject);
				Object.Destroy((Object)(object)((Component)joint5).gameObject);
				Object.Destroy((Object)(object)((Component)joint6).gameObject);
				Object.Destroy((Object)(object)((Component)joint7).gameObject);
				if ((Object)(object)beltPieceObj != (Object)null && (Object)(object)beltPiece != (Object)null)
				{
					beltPiece.m_numRounds = 0;
					beltPiece.m_capacity = 0;
					belthead.SetActive(false);
				}
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	public class AutoGrabMagWell : MonoBehaviour
	{
		public GameObject rot;

		public FVRFireArm gun;

		public MagFold fold;

		private void Awake()
		{
		}

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0052: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: 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 be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
				if (gun.Magazine.IsBeltBox && GM.CurrentMovementManager.Hands[1].Input.IsGrabbing && rot.transform.localEulerAngles.y < 45f)
				{
					if ((Object)(object)GM.CurrentMovementManager.Hands[1].CurrentInteractable == (Object)null)
					{
						GM.CurrentMovementManager.Hands[1].ForceSetInteractable((FVRInteractiveObject)(object)fold);
						((FVRInteractiveObject)fold).BeginInteraction(GM.CurrentMovementManager.Hands[1]);
					}
				}
				else if (gun.Magazine.IsBeltBox && !GM.CurrentMovementManager.Hands[1].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_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_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_014e: 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)
			//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_01ec: 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_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: 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_01b1: 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_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			follower.transform.localPosition = new Vector3((float)followerX, 0f, 0f);
			if (!((FVRFireArm)gun).HasBelt && ((Component)cover).transform.localEulerAngles.x >= 45f)
			{
				((Collider)col).enabled = true;
				if ((Object)(object)((FVRFireArm)gun).Magazine != (Object)null && !((FVRFireArm)gun).Magazine.IsBeltBox)
				{
					((Collider)col).enabled = false;
				}
			}
			else 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;
			}
			lifter.rotAngle = ((Component)lifter).transform.localEulerAngles.x;
			if (((Component)lifter).transform.localEulerAngles.x < 45f && (Object)(object)((FVRInteractiveObject)lifter).m_hand == (Object)null)
			{
				((Component)lifter).transform.localEulerAngles = new Vector3(((Component)lifter).transform.localEulerAngles.x + 500f * Time.deltaTime, 0f, 0f);
			}
			if (((Component)lifter).transform.localEulerAngles.x > 45f)
			{
				((Component)lifter).transform.localEulerAngles = new Vector3(45f, 0f, 0f);
			}
			if (((Component)lifter).transform.localEulerAngles.x < 0f)
			{
				((Component)lifter).transform.localEulerAngles = new Vector3(0f, 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 BeltAppear2 : MonoBehaviour
	{
		public FVRFireArmTopCover cover;

		public FVRFoldingStockXAxis lifter;

		public BoxCollider col;

		public OpenBoltReceiver gun;

		public float a = 45f;

		private void Start()
		{
		}

		private void Awake()
		{
		}

		private void Update()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_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)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			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 < 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);
			}
		}
	}
	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 BeltGrab : MonoBehaviour
	{
		public FVRFireArm gun;

		public GameObject grabpos;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)gun.Magazine != (Object)null && gun.Magazine.IsBeltBox)
			{
				if ((Object)(object)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).m_hand != (Object)null)
				{
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride).transform.position = grabpos.transform.position;
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride_Touch).transform.position = grabpos.transform.position;
				}
				else
				{
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride).transform.localPosition = new Vector3(0f, 0f, 0f);
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride_Touch).transform.localPosition = new Vector3(0f, 0f, 0f);
				}
			}
		}
	}
	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 Control_Enable_Rev : MonoBehaviour
	{
		public GameObject objToRead;

		public GameObject objToAffect;

		private void Start()
		{
		}

		private void Update()
		{
			if (objToRead.activeInHierarchy)
			{
				objToAffect.SetActive(false);
			}
			else
			{
				objToAffect.SetActive(true);
			}
		}
	}
	public class DoveTail : MonoBehaviour
	{
		public GameObject topcoverRot;

		public Collider topCover;

		public GameObject dovetail;

		public WaggleJoint wag;

		public GameObject switchToRelease;

		public GameObject barrel;

		public GameObject grip;

		public GameObject stock;

		public GameObject lockpiece;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0049: 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_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: 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_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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: 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)
			if (barrel.activeInHierarchy && grip.activeInHierarchy && stock.activeInHierarchy)
			{
				dovetail.SetActive(true);
				if (switchToRelease.transform.localEulerAngles.x > 45f)
				{
					topCover.enabled = true;
					if (topcoverRot.transform.localEulerAngles.x < 2f)
					{
						wag.angleLimitLeft = 32f;
						wag.angleLimitRight = 0f;
					}
					else if (topcoverRot.transform.localEulerAngles.x > 2f)
					{
						wag.angleLimitLeft = 10f;
						wag.angleLimitRight = 0f;
					}
				}
				else
				{
					if (!(switchToRelease.transform.localEulerAngles.x < 45f))
					{
						return;
					}
					topCover.enabled = false;
					if (topcoverRot.transform.localEulerAngles.x < 2f)
					{
						if (lockpiece.transform.localEulerAngles.x > 45f)
						{
							wag.angleLimitLeft = 32f;
							wag.angleLimitRight = 0f;
						}
						else if (lockpiece.transform.localEulerAngles.x < 45f)
						{
							wag.angleLimitLeft = 32f;
							wag.angleLimitRight = -32f;
						}
					}
					else if (topcoverRot.transform.localEulerAngles.x > 2f)
					{
						wag.angleLimitLeft = 10f;
						wag.angleLimitRight = 0f;
					}
				}
			}
			else
			{
				wag.angleLimitLeft = 32f;
				wag.angleLimitRight = -32f;
				dovetail.SetActive(false);
				topCover.enabled = true;
			}
		}
	}
	public class MagFold : FVRInteractiveObject
	{
		public enum StockPos
		{
			Closed,
			Mid,
			Open
		}

		public Transform Root;

		public Transform Stock;

		public float rotAngle;

		public float MinRot;

		public float MaxRot;

		public StockPos m_curPos;

		public StockPos m_lastPos;

		public bool isMinClosed = true;

		publi

OSS_Bigot_M1911A1_MODMAS.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using UnityEngine;
using UnityEngine.UI;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class Rotate : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
		((Component)this).transform.Rotate(0f, 1f, 0f);
	}
}
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoStopLoopedEffect : MonoBehaviour
{
	public float effectDuration = 2.5f;

	private float d;

	private void OnEnable()
	{
		d = effectDuration;
	}

	private void Update()
	{
		if (!(d > 0f))
		{
			return;
		}
		d -= Time.deltaTime;
		if (d <= 0f)
		{
			((Component)this).GetComponent<ParticleSystem>().Stop(true);
			CFX_Demo_Translate component = ((Component)this).gameObject.GetComponent<CFX_Demo_Translate>();
			if ((Object)(object)component != (Object)null)
			{
				((Behaviour)component).enabled = false;
			}
		}
	}
}
public class CFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class CFX_Demo_RotateCamera : MonoBehaviour
{
	public static bool rotating = true;

	public float speed = 30f;

	public Transform rotationCenter;

	private void Update()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		if (rotating)
		{
			((Component)this).transform.RotateAround(rotationCenter.position, Vector3.up, speed * Time.deltaTime);
		}
	}
}
public class CFX_Demo_Translate : MonoBehaviour
{
	public float speed = 30f;

	public Vector3 rotation = Vector3.forward;

	public Vector3 axis = Vector3.forward;

	public bool gravity;

	private Vector3 dir;

	private void Start()
	{
		//IL_002f: 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_0040: 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)
		dir = new Vector3(Random.Range(0f, 360f), Random.Range(0f, 360f), Random.Range(0f, 360f));
		((Vector3)(ref dir)).Scale(rotation);
		((Component)this).transform.localEulerAngles = dir;
	}

	private void Update()
	{
		//IL_0008: 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_001d: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.Translate(axis * speed * Time.deltaTime, (Space)1);
	}
}
public class WFX_Demo : MonoBehaviour
{
	public float cameraSpeed = 10f;

	public bool orderedSpawns = true;

	public float step = 1f;

	public float range = 5f;

	private float order = -5f;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject[] ParticleExamples;

	private int exampleIndex;

	private string randomSpawnsDelay = "0.5";

	private bool randomSpawns;

	private bool slowMo;

	private bool rotateCam = true;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	public GameObject m4;

	public GameObject m4fps;

	private bool rotate_m4 = true;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = spawnParticle();
			if (!((Object)val2).name.StartsWith("WFX_MF"))
			{
				val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
			}
		}
	}

	public GameObject spawnParticle()
	{
		//IL_0064: 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)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		SetActiveCrossVersions(val, active: true);
		return val;
	}

	private void SetActiveCrossVersions(GameObject obj, bool active)
	{
		obj.SetActive(active);
		for (int i = 0; i < obj.transform.childCount; i++)
		{
			((Component)obj.transform.GetChild(i)).gameObject.SetActive(active);
		}
	}

	private void OnGUI()
	{
		//IL_0019: 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_02ef: 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_0321: 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_033a: Unknown result type (might be due to invalid IL or missing references)
		//IL_033f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(5f, 20f, (float)(Screen.width - 10), 60f));
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Effect: " + ((Object)ParticleExamples[exampleIndex]).name, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(280f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevParticle();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextParticle();
		}
		GUILayout.FlexibleSpace();
		GUILayout.Label("Click on the ground to spawn the selected effect", (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.FlexibleSpace();
		if (GUILayout.Button((!rotateCam) ? "Rotate Camera" : "Pause Camera", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }))
		{
			rotateCam = !rotateCam;
		}
		if (GUILayout.Button((!((Component)this).GetComponent<Renderer>().enabled) ? "Show Ground" : "Hide Ground", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) }))
		{
			((Component)this).GetComponent<Renderer>().enabled = !((Component)this).GetComponent<Renderer>().enabled;
		}
		if (GUILayout.Button((!slowMo) ? "Slow Motion" : "Normal Speed", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }))
		{
			slowMo = !slowMo;
			if (slowMo)
			{
				Time.timeScale = 0.33f;
			}
			else
			{
				Time.timeScale = 1f;
			}
		}
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Ground texture: " + groundTextureStr, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevTexture();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextTexture();
		}
		GUILayout.EndHorizontal();
		GUILayout.EndArea();
		if (!m4.GetComponent<Renderer>().enabled)
		{
			return;
		}
		GUILayout.BeginArea(new Rect(5f, (float)(Screen.height - 100), (float)(Screen.width - 10), 90f));
		rotate_m4 = GUILayout.Toggle(rotate_m4, "AutoRotate Weapon", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(250f) });
		GUI.enabled = !rotate_m4;
		float x = m4.transform.localEulerAngles.x;
		x = ((!(x > 90f)) ? x : (x - 180f));
		float y = m4.transform.localEulerAngles.y;
		float z = m4.transform.localEulerAngles.z;
		x = GUILayout.HorizontalSlider(x, 0f, 179f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		y = GUILayout.HorizontalSlider(y, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		z = GUILayout.HorizontalSlider(z, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		if (GUI.changed)
		{
			if (x > 90f)
			{
				x += 180f;
			}
			m4.transform.localEulerAngles = new Vector3(x, y, z);
			Debug.Log((object)x);
		}
		GUILayout.EndArea();
	}

	private IEnumerator RandomSpawnsCoroutine()
	{
		while (true)
		{
			GameObject particles = spawnParticle();
			if (orderedSpawns)
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(order, particles.transform.position.y, 0f);
				order -= step;
				if (order < 0f - range)
				{
					order = range;
				}
			}
			else
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(Random.Range(0f - range, range), 0f, Random.Range(0f - range, range)) + new Vector3(0f, particles.transform.position.y, 0f);
			}
			yield return (object)new WaitForSeconds(float.Parse(randomSpawnsDelay));
		}
	}

	private void Update()
	{
		//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_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		if (rotateCam)
		{
			((Component)Camera.main).transform.RotateAround(Vector3.zero, Vector3.up, cameraSpeed * Time.deltaTime);
		}
		if (rotate_m4)
		{
			m4.transform.Rotate(new Vector3(0f, 40f, 0f) * Time.deltaTime, (Space)0);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			((Component)this).GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			((Component)this).GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			((Component)this).GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			((Component)this).GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		showHideStuff();
	}

	private void showHideStuff()
	{
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			SetActiveCrossVersions(walls, active: true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			SetActiveCrossVersions(walls, active: false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_DeleteAfterDelay : MonoBehaviour
{
	public float delay = 1f;

	private void Update()
	{
		delay -= Time.deltaTime;
		if (delay < 0f)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class WFX_Demo_New : MonoBehaviour
{
	public Renderer groundRenderer;

	public Collider groundCollider;

	[Space]
	[Space]
	public Image slowMoBtn;

	public Text slowMoLabel;

	public Image camRotBtn;

	public Text camRotLabel;

	public Image groundBtn;

	public Text groundLabel;

	[Space]
	public Text EffectLabel;

	public Text EffectIndexLabel;

	public GameObject[] AdditionalEffects;

	public GameObject ground;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject m4;

	public GameObject m4fps;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	private GameObject[] ParticleExamples;

	private int exampleIndex;

	private bool slowMo;

	private Vector3 defaultCamPosition;

	private Quaternion defaultCamRotation;

	private List<GameObject> onScreenParticles = new List<GameObject>();

	private void Awake()
	{
		//IL_0063: 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_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)
		List<GameObject> list = new List<GameObject>();
		int childCount = ((Component)this).transform.childCount;
		for (int i = 0; i < childCount; i++)
		{
			GameObject gameObject = ((Component)((Component)this).transform.GetChild(i)).gameObject;
			list.Add(gameObject);
		}
		list.AddRange(AdditionalEffects);
		ParticleExamples = list.ToArray();
		defaultCamPosition = ((Component)Camera.main).transform.position;
		defaultCamRotation = ((Component)Camera.main).transform.rotation;
		((MonoBehaviour)this).StartCoroutine("CheckForDeletedParticles");
		UpdateUI();
	}

	private void Update()
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		else if (Input.GetKeyDown((KeyCode)127))
		{
			destroyParticles();
		}
		if (Input.GetMouseButtonDown(0))
		{
			RaycastHit val = default(RaycastHit);
			if (groundCollider.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
			{
				GameObject val2 = spawnParticle();
				if (!((Object)val2).name.StartsWith("WFX_MF"))
				{
					val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
				}
			}
		}
		float axis = Input.GetAxis("Mouse ScrollWheel");
		if (axis != 0f)
		{
			((Component)Camera.main).transform.Translate(Vector3.forward * ((!(axis < 0f)) ? 1f : (-1f)), (Space)1);
		}
		if (Input.GetMouseButtonDown(2))
		{
			((Component)Camera.main).transform.position = defaultCamPosition;
			((Component)Camera.main).transform.rotation = defaultCamRotation;
		}
	}

	public void OnToggleGround()
	{
		//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_004c: 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)
		Color white = Color.white;
		groundRenderer.enabled = !groundRenderer.enabled;
		white.a = ((!groundRenderer.enabled) ? 0.33f : 1f);
		((Graphic)groundBtn).color = white;
		((Graphic)groundLabel).color = white;
	}

	public void OnToggleCamera()
	{
		//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_003a: 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)
		Color white = Color.white;
		CFX_Demo_RotateCamera.rotating = !CFX_Demo_RotateCamera.rotating;
		white.a = ((!CFX_Demo_RotateCamera.rotating) ? 0.33f : 1f);
		((Graphic)camRotBtn).color = white;
		((Graphic)camRotLabel).color = white;
	}

	public void OnToggleSlowMo()
	{
		//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_005c: 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)
		Color white = Color.white;
		slowMo = !slowMo;
		if (slowMo)
		{
			Time.timeScale = 0.33f;
			white.a = 1f;
		}
		else
		{
			Time.timeScale = 1f;
			white.a = 0.33f;
		}
		((Graphic)slowMoBtn).color = white;
		((Graphic)slowMoLabel).color = white;
	}

	public void OnPreviousEffect()
	{
		prevParticle();
	}

	public void OnNextEffect()
	{
		nextParticle();
	}

	private void UpdateUI()
	{
		EffectLabel.text = ((Object)ParticleExamples[exampleIndex]).name;
		EffectIndexLabel.text = string.Format("{0}/{1}", (exampleIndex + 1).ToString("00"), ParticleExamples.Length.ToString("00"));
	}

	public GameObject spawnParticle()
	{
		//IL_0025: 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_0037: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: 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)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		val.transform.position = new Vector3(0f, val.transform.position.y, 0f);
		val.SetActive(true);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		ParticleSystem component = val.GetComponent<ParticleSystem>();
		if ((Object)(object)component != (Object)null)
		{
			MainModule main = component.main;
			if (((MainModule)(ref main)).loop)
			{
				((Component)component).gameObject.AddComponent<CFX_AutoStopLoopedEffect>();
				((Component)component).gameObject.AddComponent<CFX_AutoDestructShuriken>();
			}
		}
		onScreenParticles.Add(val);
		return val;
	}

	private IEnumerator CheckForDeletedParticles()
	{
		while (true)
		{
			yield return (object)new WaitForSeconds(5f);
			for (int num = onScreenParticles.Count - 1; num >= 0; num--)
			{
				if ((Object)(object)onScreenParticles[num] == (Object)null)
				{
					onScreenParticles.RemoveAt(num);
				}
			}
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		UpdateUI();
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		UpdateUI();
		showHideStuff();
	}

	private void destroyParticles()
	{
		for (int num = onScreenParticles.Count - 1; num >= 0; num--)
		{
			if ((Object)(object)onScreenParticles[num] != (Object)null)
			{
				Object.Destroy((Object)(object)onScreenParticles[num]);
			}
			onScreenParticles.RemoveAt(num);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			ground.GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			ground.GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			ground.GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			ground.GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void showHideStuff()
	{
		//IL_004d: 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)
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
			((Component)Camera.main).transform.position = new Vector3(-2.482457f, 3.263842f, -0.004924395f);
			((Component)Camera.main).transform.eulerAngles = new Vector3(20f, 90f, 0f);
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			walls.SetActive(true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			walls.SetActive(false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class WFX_Demo_Wall : MonoBehaviour
{
	public WFX_Demo_New demo;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = demo.spawnParticle();
			val2.transform.position = ((RaycastHit)(ref val)).point;
			val2.transform.rotation = Quaternion.FromToRotation(Vector3.forward, ((RaycastHit)(ref val)).normal);
		}
	}
}
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoDestructShuriken : MonoBehaviour
{
	public bool OnlyDeactivate;

	private void OnEnable()
	{
		((MonoBehaviour)this).StartCoroutine("CheckIfAlive");
	}

	private IEnumerator CheckIfAlive()
	{
		do
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		while (((Component)this).GetComponent<ParticleSystem>().IsAlive(true));
		if (OnlyDeactivate)
		{
			((Component)this).gameObject.SetActive(false);
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(Light))]
public class CFX_LightIntensityFade : MonoBehaviour
{
	public float duration = 1f;

	public float delay = 0f;

	public float finalIntensity = 0f;

	private float baseIntensity;

	public bool autodestruct;

	private float p_lifetime = 0f;

	private float p_delay;

	private void Start()
	{
		baseIntensity = ((Component)this).GetComponent<Light>().intensity;
	}

	private void OnEnable()
	{
		p_lifetime = 0f;
		p_delay = delay;
		if (delay > 0f)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = false;
		}
	}

	private void Update()
	{
		if (p_delay > 0f)
		{
			p_delay -= Time.deltaTime;
			if (p_delay <= 0f)
			{
				((Behaviour)((Component)this).GetComponent<Light>()).enabled = true;
			}
		}
		else if (p_lifetime / duration < 1f)
		{
			((Component)this).GetComponent<Light>().intensity = Mathf.Lerp(baseIntensity, finalIntensity, p_lifetime / duration);
			p_lifetime += Time.deltaTime;
		}
		else if (autodestruct)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(MeshFilter))]
public class WFX_BulletHoleDecal : MonoBehaviour
{
	private static Vector2[] quadUVs = (Vector2[])(object)new Vector2[4]
	{
		new Vector2(0f, 0f),
		new Vector2(0f, 1f),
		new Vector2(1f, 0f),
		new Vector2(1f, 1f)
	};

	public float lifetime = 10f;

	public float fadeoutpercent = 80f;

	public Vector2 frames;

	public bool randomRotation = false;

	public bool deactivate = false;

	private float life;

	private float fadeout;

	private Color color;

	private float orgAlpha;

	private void Awake()
	{
		//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)
		color = ((Component)this).GetComponent<Renderer>().material.GetColor("_TintColor");
		orgAlpha = color.a;
	}

	private void OnEnable()
	{
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		int num = Random.Range(0, (int)(frames.x * frames.y));
		int num2 = (int)((float)num % frames.x);
		int num3 = (int)((float)num / frames.y);
		Vector2[] array = (Vector2[])(object)new Vector2[4];
		for (int i = 0; i < 4; i++)
		{
			array[i].x = (quadUVs[i].x + (float)num2) * (1f / frames.x);
			array[i].y = (quadUVs[i].y + (float)num3) * (1f / frames.y);
		}
		((Component)this).GetComponent<MeshFilter>().mesh.uv = array;
		if (randomRotation)
		{
			((Component)this).transform.Rotate(0f, 0f, Random.Range(0f, 360f), (Space)1);
		}
		life = lifetime;
		fadeout = life * (fadeoutpercent / 100f);
		color.a = orgAlpha;
		((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine("holeUpdate");
	}

	private IEnumerator holeUpdate()
	{
		while (life > 0f)
		{
			life -= Time.deltaTime;
			if (life <= fadeout)
			{
				color.a = Mathf.Lerp(0f, orgAlpha, life / fadeout);
				((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
			}
			yield return null;
		}
	}
}
[RequireComponent(typeof(Light))]
public class WFX_LightFlicker : MonoBehaviour
{
	public float time = 0.05f;

	private float timer;

	private void Start()
	{
		timer = time;
		((MonoBehaviour)this).StartCoroutine("Flicker");
	}

	private IEnumerator Flicker()
	{
		while (true)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = !((Behaviour)((Component)this).GetComponent<Light>()).enabled;
			do
			{
				timer -= Time.deltaTime;
				yield return null;
			}
			while (timer > 0f);
			timer = time;
		}
	}
}
public class CFX_SpawnSystem : MonoBehaviour
{
	private static CFX_SpawnSystem instance;

	public GameObject[] objectsToPreload = (GameObject[])(object)new GameObject[0];

	public int[] objectsToPreloadTimes = new int[0];

	public bool hideObjectsInHierarchy = false;

	public bool spawnAsChildren = true;

	public bool onlyGetInactiveObjects = false;

	public bool instantiateIfNeeded = false;

	private bool allObjectsLoaded;

	private Dictionary<int, List<GameObject>> instantiatedObjects = new Dictionary<int, List<GameObject>>();

	private Dictionary<int, int> poolCursors = new Dictionary<int, int>();

	public static bool AllObjectsLoaded => instance.allObjectsLoaded;

	public static GameObject GetNextObject(GameObject sourceObj, bool activateObject = true)
	{
		int instanceID = ((Object)sourceObj).GetInstanceID();
		if (!instance.poolCursors.ContainsKey(instanceID))
		{
			Debug.LogError((object)("[CFX_SpawnSystem.GetNextObject()] Object hasn't been preloaded: " + ((Object)sourceObj).name + " (ID:" + instanceID + ")\n"), (Object)(object)instance);
			return null;
		}
		int num = instance.poolCursors[instanceID];
		GameObject val = null;
		if (instance.onlyGetInactiveObjects)
		{
			int num2 = num;
			while (true)
			{
				val = instance.instantiatedObjects[instanceID][num];
				instance.increasePoolCursor(instanceID);
				num = instance.poolCursors[instanceID];
				if ((Object)(object)val != (Object)null && !val.activeSelf)
				{
					break;
				}
				if (num == num2)
				{
					if (instance.instantiateIfNeeded)
					{
						Debug.Log((object)("[CFX_SpawnSystem.GetNextObject()] A new instance has been created for \"" + ((Object)sourceObj).name + "\" because no active instance were found in the pool.\n"), (Object)(object)instance);
						PreloadObject(sourceObj);
						List<GameObject> list = instance.instantiatedObjects[instanceID];
						val = list[list.Count - 1];
						break;
					}
					Debug.LogWarning((object)("[CFX_SpawnSystem.GetNextObject()] There are no active instances available in the pool for \"" + ((Object)sourceObj).name + "\"\nYou may need to increase the preloaded object count for this prefab?"), (Object)(object)instance);
					return null;
				}
			}
		}
		else
		{
			val = instance.instantiatedObjects[instanceID][num];
			instance.increasePoolCursor(instanceID);
		}
		if (activateObject && (Object)(object)val != (Object)null)
		{
			val.SetActive(true);
		}
		return val;
	}

	public static void PreloadObject(GameObject sourceObj, int poolSize = 1)
	{
		instance.addObjectToPool(sourceObj, poolSize);
	}

	public static void UnloadObjects(GameObject sourceObj)
	{
		instance.removeObjectsFromPool(sourceObj);
	}

	private void addObjectToPool(GameObject sourceObject, int number)
	{
		int instanceID = ((Object)sourceObject).GetInstanceID();
		if (!instantiatedObjects.ContainsKey(instanceID))
		{
			instantiatedObjects.Add(instanceID, new List<GameObject>());
			poolCursors.Add(instanceID, 0);
		}
		for (int i = 0; i < number; i++)
		{
			GameObject val = Object.Instantiate<GameObject>(sourceObject);
			val.SetActive(false);
			CFX_AutoDestructShuriken[] componentsInChildren = val.GetComponentsInChildren<CFX_AutoDestructShuriken>(true);
			CFX_AutoDestructShuriken[] array = componentsInChildren;
			foreach (CFX_AutoDestructShuriken cFX_AutoDestructShuriken in array)
			{
				cFX_AutoDestructShuriken.OnlyDeactivate = true;
			}
			CFX_LightIntensityFade[] componentsInChildren2 = val.GetComponentsInChildren<CFX_LightIntensityFade>(true);
			CFX_LightIntensityFade[] array2 = componentsInChildren2;
			foreach (CFX_LightIntensityFade cFX_LightIntensityFade in array2)
			{
				cFX_LightIntensityFade.autodestruct = false;
			}
			instantiatedObjects[instanceID].Add(val);
			if (hideObjectsInHierarchy)
			{
				((Object)val).hideFlags = (HideFlags)1;
			}
			if (spawnAsChildren)
			{
				val.transform.parent = ((Component)this).transform;
			}
		}
	}

	private void removeObjectsFromPool(GameObject sourceObject)
	{
		int instanceID = ((Object)sourceObject).GetInstanceID();
		if (!instantiatedObjects.ContainsKey(instanceID))
		{
			Debug.LogWarning((object)("[CFX_SpawnSystem.removeObjectsFromPool()] There aren't any preloaded object for: " + ((Object)sourceObject).name + " (ID:" + instanceID + ")\n"), (Object)(object)((Component)this).gameObject);
			return;
		}
		for (int num = instantiatedObjects[instanceID].Count - 1; num >= 0; num--)
		{
			GameObject val = instantiatedObjects[instanceID][num];
			instantiatedObjects[instanceID].RemoveAt(num);
			Object.Destroy((Object)(object)val);
		}
		instantiatedObjects.Remove(instanceID);
		poolCursors.Remove(instanceID);
	}

	private void increasePoolCursor(int uniqueId)
	{
		instance.poolCursors[uniqueId]++;
		if (instance.poolCursors[uniqueId] >= instance.instantiatedObjects[uniqueId].Count)
		{
			instance.poolCursors[uniqueId] = 0;
		}
	}

	private void Awake()
	{
		if ((Object)(object)instance != (Object)null)
		{
			Debug.LogWarning((object)"CFX_SpawnSystem: There should only be one instance of CFX_SpawnSystem per Scene!\n", (Object)(object)((Component)this).gameObject);
		}
		instance = this;
	}

	private void Start()
	{
		allObjectsLoaded = false;
		for (int i = 0; i < objectsToPreload.Length; i++)
		{
			PreloadObject(objectsToPreload[i], objectsToPreloadTimes[i]);
		}
		allObjectsLoaded = true;
	}
}
namespace Billiam_J_McGoonigan.OSS_Bigot_M1911A1_MODMAS;

[BepInPlugin("Billiam_J_McGoonigan.OSS_Bigot_M1911A1_MODMAS", "OSS_Bigot_M1911A1_MODMAS", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class OSS_Bigot_M1911A1_MODMASPlugin : 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(), "Billiam_J_McGoonigan.OSS_Bigot_M1911A1_MODMAS");
		OtherLoader.RegisterDirectLoad(BasePath, "Billiam_J_McGoonigan.OSS_Bigot_M1911A1_MODMAS", "", "", "modmasitem29", "");
	}
}
public class ExtrudeRandomEdges : MonoBehaviour
{
	private pb_Object pb;

	private pb_Face lastExtrudedFace = null;

	public float distance = 1f;

	private void Start()
	{
		pb = pb_ShapeGenerator.PlaneGenerator(1f, 1f, 0, 0, (Axis)2, false);
		pb.SetFaceMaterial(pb.faces, pb_Constant.DefaultMaterial);
		lastExtrudedFace = pb.faces[0];
	}

	private void OnGUI()
	{
		if (GUILayout.Button("Extrude Random Edge", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			ExtrudeEdge();
		}
	}

	private void ExtrudeEdge()
	{
		//IL_0096: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: 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_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: 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)
		pb_Face sourceFace = lastExtrudedFace;
		List<pb_WingedEdge> wingedEdges = pb_WingedEdge.GetWingedEdges(pb, false);
		IEnumerable<pb_WingedEdge> source = wingedEdges.Where((pb_WingedEdge x) => x.face == sourceFace);
		List<pb_Edge> list = (from x in source
			where x.opposite == null
			select x into y
			select y.edge.local).ToList();
		int index = Random.Range(0, list.Count);
		pb_Edge val = list[index];
		Vector3 val2 = (pb.vertices[val.x] + pb.vertices[val.y]) * 0.5f - pb_Math.Average<int>((IList<int>)sourceFace.distinctIndices, (Func<int, Vector3>)((int x) => pb.vertices[x]), (IList<int>)null);
		((Vector3)(ref val2)).Normalize();
		pb_Edge[] selectedEdges = default(pb_Edge[]);
		pbMeshOps.Extrude(pb, (pb_Edge[])(object)new pb_Edge[1] { val }, 0f, false, true, ref selectedEdges);
		lastExtrudedFace = pb.faces.Last();
		pb.SetSelectedEdges((IEnumerable<pb_Edge>)selectedEdges);
		pb_Object_Utility.TranslateVertices(pb, pb.SelectedTriangles, val2 * distance);
		pb.ToMesh();
		pb.Refresh((RefreshMask)255);
	}
}
public class HighlightNearestFace : MonoBehaviour
{
	public float travel = 50f;

	public float speed = 0.2f;

	private pb_Object target;

	private pb_Face nearest = null;

	private void Start()
	{
		//IL_0061: 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_00c0: 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)
		target = pb_ShapeGenerator.PlaneGenerator(travel, travel, 25, 25, (Axis)2, false);
		target.SetFaceMaterial(target.faces, pb_Constant.DefaultMaterial);
		((Component)target).transform.position = new Vector3(travel * 0.5f, 0f, travel * 0.5f);
		target.ToMesh();
		target.Refresh((RefreshMask)255);
		Camera main = Camera.main;
		((Component)main).transform.position = new Vector3(25f, 40f, 0f);
		((Component)main).transform.localRotation = Quaternion.Euler(new Vector3(65f, 0f, 0f));
	}

	private void Update()
	{
		//IL_0048: 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_0085: 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_00a2: 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_00f3: 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)
		float num = Time.time * speed;
		Vector3 position = default(Vector3);
		((Vector3)(ref position))..ctor(Mathf.PerlinNoise(num, num) * travel, 2f, Mathf.PerlinNoise(num + 1f, num + 1f) * travel);
		((Component)this).transform.position = position;
		if ((Object)(object)target == (Object)null)
		{
			Debug.LogWarning((object)"Missing the ProBuilder Mesh target!");
			return;
		}
		Vector3 val = ((Component)target).transform.InverseTransformPoint(((Component)this).transform.position);
		if (nearest != null)
		{
			target.SetFaceColor(nearest, Color.white);
		}
		int num2 = target.faces.Length;
		float num3 = float.PositiveInfinity;
		nearest = target.faces[0];
		for (int i = 0; i < num2; i++)
		{
			float num4 = Vector3.Distance(val, FaceCenter(target, target.faces[i]));
			if (num4 < num3)
			{
				num3 = num4;
				nearest = target.faces[i];
			}
		}
		target.SetFaceColor(nearest, Color.blue);
		target.RefreshColors();
	}

	private Vector3 FaceCenter(pb_Object pb, pb_Face face)
	{
		//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_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_00c6: Unknown result type (might be due to invalid IL or missing references)
		Vector3[] vertices = pb.vertices;
		Vector3 zero = Vector3.zero;
		int[] distinctIndices = face.distinctIndices;
		foreach (int num in distinctIndices)
		{
			zero.x += vertices[num].x;
			zero.y += vertices[num].y;
			zero.z += vertices[num].z;
		}
		float num2 = face.distinctIndices.Length;
		zero.x /= num2;
		zero.y /= num2;
		zero.z /= num2;
		return zero;
	}
}
public class SpringUVController : MonoBehaviour
{
	[Serializable]
	public class ScaleConnection
	{
		public float UVScale;

		public float localTransformScale;
	}

	private Transform tr;

	private MeshRenderer mRenderer;

	public ScaleConnection scalesAtFullPressure;

	public ScaleConnection scalesAtFullTension;

	public string MaterialTextureName;

	private void Start()
	{
		tr = ((Component)this).transform;
		mRenderer = ((Component)tr).GetComponent<MeshRenderer>();
	}

	private void Update()
	{
		//IL_0025: 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)
		ClampScales();
		float num = EvaluateUVScales();
		((Renderer)mRenderer).material.SetTextureScale(MaterialTextureName, new Vector2(1f, num));
		((Renderer)mRenderer).material.SetTextureOffset(MaterialTextureName, new Vector2(0f, 0f - num + num * 0.5f + 0.5f));
	}

	private void ClampScales()
	{
		//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_0054: 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_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		if (tr.localScale.z < scalesAtFullPressure.localTransformScale)
		{
			tr.localScale = new Vector3(1f, 1f, scalesAtFullPressure.localTransformScale);
		}
		else if (tr.localScale.z > scalesAtFullTension.localTransformScale)
		{
			tr.localScale = new Vector3(1f, 1f, scalesAtFullTension.localTransformScale);
		}
	}

	private float EvaluateUVScales()
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.InverseLerp(scalesAtFullPressure.localTransformScale, scalesAtFullTension.localTransformScale, tr.localScale.z);
		return Mathf.Lerp(scalesAtFullPressure.UVScale, scalesAtFullTension.UVScale, num);
	}
}
public enum ControlMode
{
	simple = 1,
	touch
}
public class VehicleControl : MonoBehaviour
{
	[Serializable]
	public class CarWheels
	{
		public ConnectWheel wheels;
	}

	[Serializable]
	public class ConnectWheel
	{
		public bool frontWheelDrive = true;

		public Transform frontRight;

		public Transform frontLeft;

		public WheelSetting frontSetting;

		public bool backWheelDrive = true;

		public Transform backRight;

		public Transform backLeft;

		public WheelSetting rearSetting;
	}

	[Serializable]
	public class WheelSetting
	{
		public float Radius = 0.4f;

		public float Weight = 1000f;

		public float Distance = 0.2f;
	}

	[Serializable]
	public class CarLights
	{
		public Light[] brakeLights;

		public Light[] reverseLights;
	}

	[Serializable]
	public class CarSounds
	{
		public AudioSource IdleEngine;

		public AudioSource LowEngine;

		public AudioSource HighEngine;

		public float minPitch = 1f;

		public float maxPitch = 10f;

		public AudioSource nitro;

		public AudioSource switchGear;
	}

	[Serializable]
	public class CarParticles
	{
		public GameObject brakeParticlePerfab;

		public ParticleSystem shiftParticle1;

		public ParticleSystem shiftParticle2;

		private GameObject[] wheelParticle = (GameObject[])(object)new GameObject[4];
	}

	[Serializable]
	public class CarSetting
	{
		public bool showNormalGizmos = false;

		public Transform carSteer;

		public HitGround[] hitGround;

		public List<Transform> cameraSwitchView;

		public float springs = 25000f;

		public float dampers = 1500f;

		public float carPower = 120f;

		public float shiftPower = 150f;

		public float brakePower = 8000f;

		public Vector3 shiftCentre = new Vector3(0f, -0.8f, 0f);

		public float maxSteerAngle = 25f;

		public float shiftDownRPM = 1500f;

		public float shiftUpRPM = 2500f;

		public float idleRPM = 500f;

		public float stiffness = 2f;

		public bool automaticGear = true;

		public float[] gears = new float[6] { -10f, 9f, 6f, 4.5f, 3f, 2.5f };

		public float LimitBackwardSpeed = 60f;

		public float LimitForwardSpeed = 220f;
	}

	[Serializable]
	public class HitGround
	{
		public string tag = "street";

		public bool grounded = false;

		public AudioClip brakeSound;

		public AudioClip groundSound;

		public Color brakeColor;
	}

	private class WheelComponent
	{
		public Transform wheel;

		public WheelCollider collider;

		public Vector3 startPos;

		public float rotation = 0f;

		public float rotation2 = 0f;

		public float maxSteer;

		public bool drive;

		public float pos_y = 0f;

		public WheelSetting settings;
	}

	public ControlMode controlMode = ControlMode.simple;

	public bool activeControl = false;

	public CarWheels carWheels;

	public CarLights carLights;

	public CarSounds carSounds;

	public CarParticles carParticles;

	public CarSetting carSetting;

	[HideInInspector]
	public float steer = 0f;

	[HideInInspector]
	public float accel = 0f;

	[HideInInspector]
	public bool brake;

	private bool shifmotor;

	[HideInInspector]
	public float curTorque = 100f;

	[HideInInspector]
	public float powerShift = 100f;

	[HideInInspector]
	public bool shift;

	private float torque = 100f;

	[HideInInspector]
	public float speed = 0f;

	private float lastSpeed = -10f;

	private bool shifting = false;

	private float[] efficiencyTable = new float[22]
	{
		0.6f, 0.65f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 1f, 1f, 0.95f,
		0.8f, 0.7f, 0.6f, 0.5f, 0.45f, 0.4f, 0.36f, 0.33f, 0.3f, 0.2f,
		0.1f, 0.05f
	};

	private float efficiencyTableStep = 250f;

	private float Pitch;

	private float PitchDelay;

	private float shiftTime = 0f;

	private float shiftDelay = 0f;

	[HideInInspector]
	public int currentGear = 0;

	[HideInInspector]
	public bool NeutralGear = true;

	[HideInInspector]
	public float motorRPM = 0f;

	[HideInInspector]
	public bool Backward = false;

	[HideInInspector]
	public float accelFwd = 0f;

	[HideInInspector]
	public float accelBack = 0f;

	[HideInInspector]
	public float steerAmount = 0f;

	private float wantedRPM = 0f;

	private float w_rotate;

	private float slip;

	private float slip2 = 0f;

	private GameObject[] Particle = (GameObject[])(object)new GameObject[4];

	private Vector3 steerCurAngle;

	private Rigidbody myRigidbody;

	private WheelComponent[] wheels;

	public bool isOn = true;

	public bool isForciblyOff = false;

	private WheelComponent SetWheelComponent(Transform wheel, float maxSteer, bool drive, float pos_y, WheelSetting setting)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		//IL_0035: 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_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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		WheelComponent wheelComponent = new WheelComponent();
		GameObject val = new GameObject(((Object)wheel).name + "WheelCollider");
		val.transform.parent = ((Component)this).transform;
		val.transform.position = wheel.position;
		val.transform.eulerAngles = ((Component)this).transform.eulerAngles;
		pos_y = val.transform.localPosition.y;
		WheelCollider val2 = (WheelCollider)val.AddComponent(typeof(WheelCollider));
		wheelComponent.wheel = wheel;
		wheelComponent.collider = val.GetComponent<WheelCollider>();
		wheelComponent.drive = drive;
		wheelComponent.pos_y = pos_y;
		wheelComponent.maxSteer = maxSteer;
		wheelComponent.startPos = val.transform.localPosition;
		wheelComponent.settings = setting;
		return wheelComponent;
	}

	private void Awake()
	{
		//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_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_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_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_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: 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_0228: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		if (carSetting.automaticGear)
		{
			NeutralGear = false;
		}
		myRigidbody = ((Component)((Component)this).transform).GetComponent<Rigidbody>();
		wheels = new WheelComponent[4];
		wheels[0] = SetWheelComponent(carWheels.wheels.frontRight, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontRight.position.y, carWheels.wheels.frontSetting);
		wheels[1] = SetWheelComponent(carWheels.wheels.frontLeft, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontLeft.position.y, carWheels.wheels.frontSetting);
		wheels[2] = SetWheelComponent(carWheels.wheels.backRight, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backRight.position.y, carWheels.wheels.rearSetting);
		wheels[3] = SetWheelComponent(carWheels.wheels.backLeft, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backLeft.position.y, carWheels.wheels.rearSetting);
		if (Object.op_Implicit((Object)(object)carSetting.carSteer))
		{
			steerCurAngle = carSetting.carSteer.localEulerAngles;
		}
		WheelComponent[] array = wheels;
		foreach (WheelComponent wheelComponent in array)
		{
			WheelCollider collider = wheelComponent.collider;
			collider.suspensionDistance = wheelComponent.settings.Distance;
			JointSpring suspensionSpring = collider.suspensionSpring;
			suspensionSpring.spring = carSetting.springs;
			suspensionSpring.damper = carSetting.dampers;
			collider.suspensionSpring = suspensionSpring;
			collider.radius = wheelComponent.settings.Radius;
			collider.mass = wheelComponent.settings.Weight;
			WheelFrictionCurve val = collider.forwardFriction;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 5000f;
			((WheelFrictionCurve)(ref val)).extremumSlip = 2f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 20f;
			((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness;
			collider.forwardFriction = val;
			val = collider.sidewaysFriction;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 7500f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 2f;
			((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness;
			collider.sidewaysFriction = val;
		}
	}

	public void TurnOnEngine(bool forcibly)
	{
		if (!isForciblyOff)
		{
			isOn = true;
		}
		else if (forcibly)
		{
			isForciblyOff = false;
			isOn = true;
		}
	}

	public void TurnOffEngine(bool forcibly)
	{
		isForciblyOff = forcibly;
		isOn = false;
	}

	public void ShiftTo(int newGear)
	{
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		currentGear = newGear;
		if (currentGear == 0)
		{
			NeutralGear = true;
		}
		else
		{
			NeutralGear = false;
		}
		if (currentGear == -1)
		{
			currentGear = 0;
		}
	}

	public void ShiftUp(bool ignoreDelay)
	{
		float timeSinceLevelLoad = Time.timeSinceLevelLoad;
		if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || currentGear >= carSetting.gears.Length - 1)
		{
			return;
		}
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		if (!carSetting.automaticGear)
		{
			if (currentGear == 0)
			{
				if (NeutralGear)
				{
					currentGear++;
					NeutralGear = false;
				}
				else
				{
					NeutralGear = true;
				}
			}
			else
			{
				currentGear++;
			}
		}
		else
		{
			currentGear++;
		}
		shiftDelay = timeSinceLevelLoad + 1f;
		shiftTime = 1.5f;
	}

	public void ShiftDown(bool ignoreDelay)
	{
		float timeSinceLevelLoad = Time.timeSinceLevelLoad;
		if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || (currentGear <= 0 && !NeutralGear))
		{
			return;
		}
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		if (!carSetting.automaticGear)
		{
			if (currentGear == 1)
			{
				if (!NeutralGear)
				{
					currentGear--;
					NeutralGear = true;
				}
			}
			else if (currentGear == 0)
			{
				NeutralGear = false;
			}
			else
			{
				currentGear--;
			}
		}
		else
		{
			currentGear--;
		}
		shiftDelay = timeSinceLevelLoad + 0.1f;
		shiftTime = 2f;
	}

	private void OnCollisionEnter(Collision collision)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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_0092: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: 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)((Component)collision.transform.root).GetComponent<VehicleControl>()))
		{
			VehicleControl component = ((Component)collision.transform.root).GetComponent<VehicleControl>();
			Vector3 relativeVelocity = collision.relativeVelocity;
			component.slip2 = Mathf.Clamp(((Vector3)(ref relativeVelocity)).magnitude, 0f, 10f);
			myRigidbody.angularVelocity = new Vector3((0f - myRigidbody.angularVelocity.x) * 0.5f, myRigidbody.angularVelocity.y * 0.5f, (0f - myRigidbody.angularVelocity.z) * 0.5f);
			myRigidbody.velocity = new Vector3(myRigidbody.velocity.x, myRigidbody.velocity.y * 0.5f, myRigidbody.velocity.z);
		}
	}

	private void OnCollisionStay(Collision collision)
	{
		if (Object.op_Implicit((Object)(object)((Component)collision.transform.root).GetComponent<VehicleControl>()))
		{
			((Component)collision.transform.root).GetComponent<VehicleControl>().slip2 = 5f;
		}
	}

	private void Update()
	{
	}

	private void FixedUpdate()
	{
		//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_00b6: 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_0704: Unknown result type (might be due to invalid IL or missing references)
		//IL_0709: Unknown result type (might be due to invalid IL or missing references)
		//IL_0751: Unknown result type (might be due to invalid IL or missing references)
		//IL_075a: Unknown result type (might be due to invalid IL or missing references)
		//IL_075f: Unknown result type (might be due to invalid IL or missing references)
		//IL_079b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0acf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ee6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ef2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f0c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f17: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f25: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b3b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d23: Unknown result type (might be due to invalid IL or missing references)
		if (!isOn)
		{
			accel = 0f;
		}
		Vector3 velocity = myRigidbody.velocity;
		speed = ((Vector3)(ref velocity)).magnitude * 2.7f;
		if (speed < lastSpeed - 10f && slip < 10f)
		{
			slip = lastSpeed / 15f;
		}
		lastSpeed = speed;
		if (slip2 != 0f)
		{
			slip2 = Mathf.MoveTowards(slip2, 0f, 0.1f);
		}
		myRigidbody.centerOfMass = carSetting.shiftCentre;
		if (!carWheels.wheels.frontWheelDrive && !carWheels.wheels.backWheelDrive)
		{
			accel = 0f;
		}
		if (Object.op_Implicit((Object)(object)carSetting.carSteer))
		{
			carSetting.carSteer.localEulerAngles = new Vector3(steerCurAngle.x, steerCurAngle.y, steerCurAngle.z + steer * -120f);
		}
		if (carSetting.automaticGear && currentGear == 1 && accel < 0f)
		{
			if (speed < 5f)
			{
				ShiftDown(ignoreDelay: false);
			}
		}
		else if (carSetting.automaticGear && currentGear == 0 && accel > 0f)
		{
			if (speed < 5f)
			{
				ShiftUp(ignoreDelay: false);
			}
		}
		else if (carSetting.automaticGear && motorRPM > carSetting.shiftUpRPM && accel > 0f && speed > 10f && !brake)
		{
			ShiftUp(ignoreDelay: false);
		}
		else if (carSetting.automaticGear && motorRPM < carSetting.shiftDownRPM && currentGear > 1)
		{
			ShiftDown(ignoreDelay: false);
		}
		if (speed < 1f)
		{
			Backward = true;
		}
		if (currentGear != 0 || !Backward)
		{
			Backward = false;
		}
		Light[] brakeLights = carLights.brakeLights;
		foreach (Light val in brakeLights)
		{
			if (brake || accel < 0f || speed < 1f)
			{
				val.intensity = Mathf.MoveTowards(val.intensity, 8f, 0.5f);
			}
			else
			{
				val.intensity = Mathf.MoveTowards(val.intensity, 0f, 0.5f);
			}
			((Behaviour)val).enabled = val.intensity != 0f;
		}
		Light[] reverseLights = carLights.reverseLights;
		foreach (Light val2 in reverseLights)
		{
			if (speed > 2f && currentGear == 0)
			{
				val2.intensity = Mathf.MoveTowards(val2.intensity, 8f, 0.5f);
			}
			else
			{
				val2.intensity = Mathf.MoveTowards(val2.intensity, 0f, 0.5f);
			}
			((Behaviour)val2).enabled = val2.intensity != 0f;
		}
		wantedRPM = 5500f * accel * 0.1f + wantedRPM * 0.9f;
		float num = 0f;
		int num2 = 0;
		bool flag = false;
		int num3 = 0;
		WheelComponent[] array = wheels;
		WheelHit val4 = default(WheelHit);
		foreach (WheelComponent wheelComponent in array)
		{
			WheelCollider collider = wheelComponent.collider;
			if (wheelComponent.drive)
			{
				num = ((!NeutralGear && brake && currentGear < 2) ? (num + accel * carSetting.idleRPM) : (NeutralGear ? (num + carSetting.idleRPM * accel) : (num + collider.rpm)));
				num2++;
			}
			if (brake || accel < 0f)
			{
				if (accel < 0f || (brake && (wheelComponent == wheels[2] || wheelComponent == wheels[3])))
				{
					if (brake && accel > 0f)
					{
						slip = Mathf.Lerp(slip, 5f, accel * 0.01f);
					}
					else if (speed > 1f)
					{
						slip = Mathf.Lerp(slip, 1f, 0.002f);
					}
					else
					{
						slip = Mathf.Lerp(slip, 1f, 0.02f);
					}
					wantedRPM = 0f;
					collider.brakeTorque = carSetting.brakePower;
					wheelComponent.rotation = w_rotate;
				}
			}
			else
			{
				float brakeTorque;
				if (accel == 0f || NeutralGear)
				{
					float num5 = (collider.brakeTorque = 1000f);
					brakeTorque = num5;
				}
				else
				{
					float num5 = (collider.brakeTorque = 0f);
					brakeTorque = num5;
				}
				collider.brakeTorque = brakeTorque;
				slip = ((!(speed > 0f)) ? (slip = Mathf.Lerp(slip, 0.01f, 0.02f)) : ((!(speed > 100f)) ? (slip = Mathf.Lerp(slip, 1.5f, 0.02f)) : (slip = Mathf.Lerp(slip, 1f + Mathf.Abs(steer), 0.02f))));
				w_rotate = wheelComponent.rotation;
			}
			WheelFrictionCurve val3 = collider.forwardFriction;
			((WheelFrictionCurve)(ref val3)).asymptoteValue = 5000f;
			((WheelFrictionCurve)(ref val3)).extremumSlip = 2f;
			((WheelFrictionCurve)(ref val3)).asymptoteSlip = 20f;
			((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2);
			collider.forwardFriction = val3;
			val3 = collider.sidewaysFriction;
			((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2);
			((WheelFrictionCurve)(ref val3)).extremumSlip = 0.2f + Mathf.Abs(steer);
			collider.sidewaysFriction = val3;
			if (shift && currentGear > 1 && speed > 50f && shifmotor && Mathf.Abs(steer) < 0.2f)
			{
				if (powerShift == 0f)
				{
					shifmotor = false;
				}
				powerShift = Mathf.MoveTowards(powerShift, 0f, Time.deltaTime * 10f);
				carSounds.nitro.volume = Mathf.Lerp(carSounds.nitro.volume, 1f, Time.deltaTime * 10f);
				if (!carSounds.nitro.isPlaying)
				{
					((Component)carSounds.nitro).GetComponent<AudioSource>().Play();
				}
				curTorque = ((!(powerShift > 0f)) ? carSetting.carPower : carSetting.shiftPower);
				carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f);
				carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f);
			}
			else
			{
				if (powerShift > 20f)
				{
					shifmotor = true;
				}
				carSounds.nitro.volume = Mathf.MoveTowards(carSounds.nitro.volume, 0f, Time.deltaTime * 2f);
				if (carSounds.nitro.volume == 0f)
				{
					carSounds.nitro.Stop();
				}
				powerShift = Mathf.MoveTowards(powerShift, 100f, Time.deltaTime * 5f);
				curTorque = carSetting.carPower;
				carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, 0f, Time.deltaTime * 10f);
				carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, 0f, Time.deltaTime * 10f);
			}
			wheelComponent.rotation = Mathf.Repeat(wheelComponent.rotation + Time.deltaTime * collider.rpm * 360f / 60f, 360f);
			wheelComponent.rotation2 = Mathf.Lerp(wheelComponent.rotation2, collider.steerAngle, 0.1f);
			wheelComponent.wheel.localRotation = Quaternion.Euler(wheelComponent.rotation, wheelComponent.rotation2, 0f);
			Vector3 localPosition = wheelComponent.wheel.localPosition;
			if (collider.GetGroundHit(ref val4))
			{
				if (Object.op_Implicit((Object)(object)carParticles.brakeParticlePerfab))
				{
					if ((Object)(object)Particle[num3] == (Object)null)
					{
						Particle[num3] = Object.Instantiate<GameObject>(carParticles.brakeParticlePerfab, wheelComponent.wheel.position, Quaternion.identity);
						((Object)Particle[num3]).name = "WheelParticle";
						Particle[num3].transform.parent = ((Component)this).transform;
						Particle[num3].AddComponent<AudioSource>();
						Particle[num3].GetComponent<AudioSource>().maxDistance = 50f;
						Particle[num3].GetComponent<AudioSource>().spatialBlend = 1f;
						Particle[num3].GetComponent<AudioSource>().dopplerLevel = 5f;
						Particle[num3].GetComponent<AudioSource>().rolloffMode = (AudioRolloffMode)2;
					}
					ParticleSystem component = Particle[num3].GetComponent<ParticleSystem>();
					bool flag2 = false;
					for (int l = 0; l < carSetting.hitGround.Length; l++)
					{
						if (((Component)((WheelHit)(ref val4)).collider).CompareTag(carSetting.hitGround[l].tag))
						{
							flag2 = carSetting.hitGround[l].grounded;
							if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.5f) && speed > 1f)
							{
								Particle[num3].GetComponent<AudioSource>().clip = carSetting.hitGround[l].brakeSound;
							}
							else if ((Object)(object)Particle[num3].GetComponent<AudioSource>().clip != (Object)(object)carSetting.hitGround[l].groundSound && !Particle[num3].GetComponent<AudioSource>().isPlaying)
							{
								Particle[num3].GetComponent<AudioSource>().clip = carSetting.hitGround[l].groundSound;
							}
							Particle[num3].GetComponent<ParticleSystem>().startColor = carSetting.hitGround[l].brakeColor;
						}
					}
					if (flag2 && speed > 5f && !brake)
					{
						component.enableEmission = true;
						Particle[num3].GetComponent<AudioSource>().volume = 0.5f;
						if (!Particle[num3].GetComponent<AudioSource>().isPlaying)
						{
							Particle[num3].GetComponent<AudioSource>().Play();
						}
					}
					else if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && speed > 1f)
					{
						if (accel < 0f || ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && (wheelComponent == wheels[2] || wheelComponent == wheels[3])))
						{
							if (!Particle[num3].GetComponent<AudioSource>().isPlaying)
							{
								Particle[num3].GetComponent<AudioSource>().Play();
							}
							component.enableEmission = true;
							Particle[num3].GetComponent<AudioSource>().volume = 10f;
						}
					}
					else
					{
						component.enableEmission = false;
						Particle[num3].GetComponent<AudioSource>().volume = Mathf.Lerp(Particle[num3].GetComponent<AudioSource>().volume, 0f, Time.deltaTime * 10f);
					}
				}
				localPosition.y -= Vector3.Dot(wheelComponent.wheel.position - ((WheelHit)(ref val4)).point, ((Component)this).transform.TransformDirection(0f, 1f, 0f) / ((Component)this).transform.lossyScale.x) - collider.radius;
				localPosition.y = Mathf.Clamp(localPosition.y, -10f, wheelComponent.pos_y);
				flag = flag || wheelComponent.drive;
			}
			else
			{
				if ((Object)(object)Particle[num3] != (Object)null)
				{
					ParticleSystem component2 = Particle[num3].GetComponent<ParticleSystem>();
					component2.enableEmission = false;
				}
				localPosition.y = wheelComponent.startPos.y - wheelComponent.settings.Distance;
				myRigidbody.AddForce(Vector3.down * 5000f);
			}
			num3++;
			wheelComponent.wheel.localPosition = localPosition;
		}
		if (num2 > 1)
		{
			num /= (float)num2;
		}
		motorRPM = 0.95f * motorRPM + 0.05f * Mathf.Abs(num * carSetting.gears[currentGear]);
		if (motorRPM > 5500f)
		{
			motorRPM = 5200f;
		}
		int num7 = (int)(motorRPM / efficiencyTableStep);
		if (num7 >= efficiencyTable.Length)
		{
			num7 = efficiencyTable.Length - 1;
		}
		if (num7 < 0)
		{
			num7 = 0;
		}
		float num8 = curTorque * carSetting.gears[currentGear] * efficiencyTable[num7];
		WheelComponent[] array2 = wheels;
		foreach (WheelComponent wheelComponent2 in array2)
		{
			WheelCollider collider2 = wheelComponent2.collider;
			if (wheelComponent2.drive)
			{
				if (Mathf.Abs(collider2.rpm) > Mathf.Abs(wantedRPM))
				{
					collider2.motorTorque = 0f;
				}
				else
				{
					float motorTorque = collider2.motorTorque;
					if (!brake && accel != 0f && !NeutralGear)
					{
						if ((speed < carSetting.LimitForwardSpeed && currentGear > 0) || (speed < carSetting.LimitBackwardSpeed && currentGear == 0))
						{
							collider2.motorTorque = motorTorque * 0.9f + num8 * 1f;
						}
						else
						{
							collider2.motorTorque = 0f;
							collider2.brakeTorque = 2000f;
						}
					}
					else
					{
						collider2.motorTorque = 0f;
					}
				}
			}
			if (brake || slip2 > 2f)
			{
				collider2.steerAngle = Mathf.Lerp(collider2.steerAngle, steer * wheelComponent2.maxSteer, 0.02f);
				continue;
			}
			float num9 = Mathf.Clamp(speed / carSetting.maxSteerAngle, 1f, carSetting.maxSteerAngle);
			collider2.steerAngle = steer * (wheelComponent2.maxSteer / num9);
		}
		Pitch = Mathf.Clamp(1.2f + (motorRPM - carSetting.idleRPM) / (carSetting.shiftUpRPM - carSetting.idleRPM), 1f, 10f);
		shiftTime = Mathf.MoveTowards(shiftTime, 0f, 0.1f);
		if (Pitch == 1f)
		{
			carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1f, 0.1f);
			carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f);
			carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.1f);
		}
		else
		{
			carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1.8f - Pitch, 0.1f);
			if ((Pitch > PitchDelay || accel > 0f) && shiftTime == 0f)
			{
				carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0f, 0.2f);
				carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 1f, 0.1f);
			}
			else
			{
				carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f);
				carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.2f);
			}
			carSounds.HighEngine.pitch = Pitch;
			carSounds.LowEngine.pitch = Pitch;
			PitchDelay = Pitch;
		}
		if (!isOn)
		{
			carSounds.IdleEngine.volume = 0f;
			carSounds.LowEngine.volume = 0f;
			carSounds.HighEngine.volume = 0f;
		}
	}

	private void OnDrawGizmos()
	{
		//IL_0026: 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_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: 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_0061: 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_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00b1: Unknown result type (might be due to invalid IL or missing references)
		if (carSetting.showNormalGizmos && !Application.isPlaying)
		{
			Matrix4x4 matrix = Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.lossyScale);
			Gizmos.matrix = matrix;
			Gizmos.color = new Color(1f, 0f, 0f, 0.5f);
			Gizmos.DrawCube(Vector3.up / 1.5f, new Vector3(2.5f, 2f, 6f));
			Gizmos.DrawSphere(carSetting.shiftCentre / ((Component)this).transform.lossyScale.x, 0.2f);
		}
	}
}

Pancerovka27ALauncher.dll

Decompiled a week ago
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

[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 Volks.Pancerovka27ALauncher;

[BepInPlugin("Volks.Pancerovka27ALauncher", "Pancerovka27ALauncher", "1.0.1")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Pancerovka27ALauncherPlugin : 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(), "Volks.Pancerovka27ALauncher");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.Pancerovka27ALauncher", "", "", "modmas2024_item68", "");
	}
}
public class FlipGrip : FVRAlternateGrip
{
	private float curXRot;

	private float m_curFlipLerp;

	private float m_tarFlipLerp;

	private float m_lastFlipLerp;

	public float XRotUp;

	public float XRotDown;

	public bool IsUp { get; private set; }

	public override void Awake()
	{
		((FVRAlternateGrip)this).Awake();
		if (IsUp)
		{
			curXRot = XRotUp;
			m_curFlipLerp = 1f;
			m_tarFlipLerp = 1f;
			m_lastFlipLerp = 1f;
		}
		else
		{
			curXRot = XRotDown;
			m_curFlipLerp = 0f;
			m_tarFlipLerp = 0f;
			m_lastFlipLerp = 0f;
		}
	}

	public override void UpdateInteraction(FVRViveHand hand)
	{
		//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_0067: 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)
		Vector2 touchpadAxes = hand.Input.TouchpadAxes;
		if (hand.IsInStreamlinedMode)
		{
			if (hand.Input.BYButtonDown)
			{
				IsUp = !IsUp;
				Flip();
			}
		}
		else if (hand.Input.TouchpadDown && ((Vector2)(ref touchpadAxes)).magnitude > 0.25f && Vector2.Angle(touchpadAxes, Vector2.up) <= 45f)
		{
			Flip();
		}
		((FVRAlternateGrip)this).UpdateInteraction(hand);
	}

	private void Flip()
	{
		if (IsUp)
		{
			curXRot = XRotUp;
			m_tarFlipLerp = 1f;
		}
		else
		{
			curXRot = XRotDown;
			m_tarFlipLerp = 0f;
		}
	}
}
public class GripRotation : FVRAlternateGrip
{
	[Header("Grip Rotation")]
	public Vector3 rotationDirection = Vector3.up;
}
public enum E_InteractionType
{
	None = -1,
	Holding,
	Touchpad,
	TouchpadUp,
	TouchpadDown,
	TouchpadLeft,
	TouchpadRight,
	AXButton,
	BYButton,
	Trigger,
	Simple,
	TriggerTouched,
	GripPressed
}
public class Safety_RPG : SimpleLauncher
{
	private int m_fireSelectorMode;

	public int FireSelectorModeIndex => m_fireSelectorMode;

	private void Start()
	{
	}

	private void Update()
	{
	}
}
public class RKGChute : PinnedGrenade
{
	public GameObject objectToEnable;

	public float delay = 1f;

	public float dragFactor = 5f;

	public Vector3 targetDirection = Vector3.right;

	public float rotationSpeed = 5f;

	private bool isTimerStarted = false;

	private Rigidbody rb;

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

	public override void FVRUpdate()
	{
		((PinnedGrenade)this).FVRUpdate();
		if (base.m_isPinPulled && base.m_isLeverReleased && !((FVRInteractiveObject)this).IsHeld && !isTimerStarted)
		{
			((MonoBehaviour)this).StartCoroutine(EnableObjectAfterDelay());
		}
		if ((Object)(object)objectToEnable != (Object)null && objectToEnable.activeSelf)
		{
			AlignToWorldDirection();
		}
	}

	private IEnumerator EnableObjectAfterDelay()
	{
		isTimerStarted = true;
		yield return (object)new WaitForSeconds(delay);
		if ((Object)(object)objectToEnable != (Object)null)
		{
			objectToEnable.SetActive(true);
			Debug.Log((object)"Parachute deployed.");
		}
	}

	private void AlignToWorldDirection()
	{
		//IL_0023: 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)
		//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_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_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_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_007a: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)rb == (Object)null))
		{
			rb.velocity *= 1f - Time.deltaTime * dragFactor;
			Vector3 normalized = ((Vector3)(ref targetDirection)).normalized;
			Quaternion val = Quaternion.LookRotation(normalized, Vector3.up);
			((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val, rotationSpeed * Time.deltaTime);
		}
	}
}
public class DM34Destroy : MonoBehaviour
{
	public FVRPhysicalObject triggerDestroy;

	public FVRFireArmChamber chamber;

	private bool isTimerStarted;

	public float timeBeforedestruction;

	private float timer = 1f;

	private void FixedUpdate()
	{
		if (!chamber.IsFull && !isTimerStarted)
		{
			isTimerStarted = true;
			timer = timeBeforedestruction;
		}
		if (((FVRInteractiveObject)triggerDestroy).IsHeld)
		{
			timer = timeBeforedestruction;
		}
		if (isTimerStarted)
		{
			timer -= Time.fixedDeltaTime;
		}
		if (timer <= 0f)
		{
			Object.Destroy((Object)(object)((Component)triggerDestroy).gameObject);
		}
	}
}
public class EnableEngine : MonoBehaviour
{
	public FVRFireArmChamber chamber;

	public GameObject objectToEnable;

	private void FixedUpdate()
	{
		if (!chamber.IsFull)
		{
			objectToEnable.SetActive(true);
		}
	}
}
public class Semtex : PinnedGrenade
{
	[Header("Semtex Values")]
	public bool isSticky;

	public LayerMask stickyMask;

	[Header("Semtex Extras (Leave Empty If Not Needed)")]
	[Tooltip("If not null, will play audio clip placed inside of source. Used for a stick sound if you want.")]
	public AudioSource StickSource;

	public override void OnCollisionEnter(Collision collision)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		if (collision.gameObject.layer == LayerMask.op_Implicit(stickyMask) && !((FVRInteractiveObject)this).IsHeld)
		{
			((Component)this).transform.parent = collision.transform;
			((Component)this).GetComponent<Rigidbody>().isKinematic = true;
			if ((Object)(object)StickSource != (Object)null)
			{
				StickSource.Play();
			}
		}
		((PinnedGrenade)this).OnCollisionEnter(collision);
	}
}
public class Semtex_Updated : PinnedGrenade
{
	[Header("Semtex Values")]
	public bool isSticky;

	public LayerMask stickyMask;

	[Header("Semtex Extras (Leave Empty If Not Needed)")]
	[Tooltip("If not null, will play audio clip placed inside of source. Used for a stick sound if you want.")]
	public AudioSource StickSource;

	private Transform fakeParent;

	private Vector3 pos;

	private Vector3 fw;

	private Vector3 up;

	private void FixedUpdate()
	{
		//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_0029: 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_0040: 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_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_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: 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)
		if ((Object)(object)fakeParent != (Object)null)
		{
			Vector3 position = ((Component)fakeParent).transform.TransformPoint(pos);
			Vector3 val = ((Component)fakeParent).transform.TransformDirection(fw);
			Vector3 val2 = ((Component)fakeParent).transform.TransformDirection(up);
			Quaternion rotation = Quaternion.LookRotation(val, val2);
			((Component)this).transform.position = position;
			((Component)this).transform.rotation = rotation;
		}
	}

	public override void OnCollisionEnter(Collision collision)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		if (((1 << collision.gameObject.layer) & LayerMask.op_Implicit(stickyMask)) != 0 && !((FVRInteractiveObject)this).IsHeld)
		{
			((Component)this).transform.position = ((ContactPoint)(ref collision.contacts[0])).point;
			((Component)this).transform.rotation = Quaternion.LookRotation(((ContactPoint)(ref collision.contacts[0])).normal);
			pos = ((Component)fakeParent).transform.InverseTransformPoint(((Component)this).transform.position);
			fw = ((Component)fakeParent).transform.InverseTransformDirection(((Component)this).transform.forward);
			up = ((Component)fakeParent).transform.InverseTransformDirection(((Component)this).transform.up);
			((Component)this).GetComponent<Rigidbody>().isKinematic = true;
			if ((Object)(object)StickSource != (Object)null)
			{
				StickSource.Play();
			}
		}
		((PinnedGrenade)this).OnCollisionEnter(collision);
	}

	public override void BeginInteraction(FVRViveHand hand)
	{
		((PinnedGrenade)this).BeginInteraction(hand);
		fakeParent = null;
	}
}

PitScripts.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using Microsoft.CodeAnalysis;
using Sodalite.Api;
using Sodalite.Utilities;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("localpcnerd")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Scripts for Pit map and gamemode.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PitScripts")]
[assembly: AssemblyTitle("PitScripts")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class PitController : MonoBehaviour
{
	[Header("Timer")]
	public bool runTimer;

	public float curTime;

	public float finalTime;

	[HideInInspector]
	public float savedBestTimeSosig;

	[HideInInspector]
	public float savedBestTimeTarget;

	[Header("UI")]
	public Text[] timers;

	public Text sosigRecord;

	public Text targetRecord;

	public GameObject useSosigButton;

	public GameObject useTargetButton;

	[Header("Zones")]
	public PitZone[] zones;

	public int zoneInd;

	public int activeZone;

	[Header("Triggers")]
	public PitTrigger[] triggers;

	public bool canFinishCourse;

	[Header("Audio")]
	public AudioSource source;

	public AudioClip zoneFinishClip;

	public AudioClip triggerStartClip;

	public AudioClip triggerFinishClip;

	[Header("Targets")]
	public GameObject targetPrefab;

	public GameObject friendlyTargetPrefab;

	public bool useTargets;

	[Header("Sosigs")]
	public SosigEnemyID[] enemySosigIDs;

	public SosigEnemyID[] friendlySosigIDs;

	public void Start()
	{
		savedBestTimeSosig = PlayerPrefs.GetFloat("savedBestTimeSosig", 6030f);
		savedBestTimeTarget = PlayerPrefs.GetFloat("savedBestTimeTarget", 6030f);
		GM.CurrentPlayerBody.SetPlayerIFF(0);
	}

	public void OnStart()
	{
		curTime = 0f;
		finalTime = 0f;
		runTimer = true;
		zoneInd = 0;
		zones[zoneInd].StartZone();
		PlayClip(1);
	}

	public void OnFinish()
	{
		PlayClip(2);
		runTimer = false;
		finalTime = curTime;
		((MonoBehaviour)this).StartCoroutine(delayResetFinish());
		UpdateSavedScores();
	}

	public void UpdateUI()
	{
		Text[] array = timers;
		foreach (Text val in array)
		{
			int num = Mathf.FloorToInt(curTime / 60f);
			int num2 = Mathf.FloorToInt(curTime - (float)(num * 60));
			int num3 = Mathf.FloorToInt(curTime % 1f * 100f);
			string text = $"{num:00}:{num2:00}:{num3:00}";
			val.text = text;
		}
		int num4 = Mathf.FloorToInt(savedBestTimeSosig / 60f);
		int num5 = Mathf.FloorToInt(savedBestTimeSosig - (float)(num4 * 60));
		int num6 = Mathf.FloorToInt(savedBestTimeSosig % 1f * 100f);
		string text2 = $"{num4:00}:{num5:00}:{num6:00}";
		sosigRecord.text = text2;
		int num7 = Mathf.FloorToInt(savedBestTimeTarget / 60f);
		int num8 = Mathf.FloorToInt(savedBestTimeTarget - (float)(num7 * 60));
		int num9 = Mathf.FloorToInt(savedBestTimeTarget % 1f * 100f);
		string text3 = $"{num7:00}:{num8:00}:{num9:00}";
		targetRecord.text = text3;
	}

	public void ResetSavedTimes()
	{
		PlayerPrefs.DeleteKey("savedBestTimeSosig");
		savedBestTimeSosig = 3060f;
		PlayerPrefs.DeleteKey("savedBestTimeTarget");
		savedBestTimeTarget = 3060f;
	}

	public void PlayClip(int ind)
	{
		switch (ind)
		{
		case 0:
			source.PlayOneShot(zoneFinishClip);
			break;
		case 1:
			source.PlayOneShot(triggerStartClip);
			break;
		case 2:
			source.PlayOneShot(triggerFinishClip);
			break;
		}
	}

	public void UpdateSavedScores()
	{
		if (useTargets)
		{
			if (finalTime < savedBestTimeTarget)
			{
				savedBestTimeTarget = finalTime;
				PlayerPrefs.SetFloat("savedBestTimeTarget", savedBestTimeTarget);
			}
		}
		else if (finalTime < savedBestTimeSosig)
		{
			savedBestTimeSosig = finalTime;
			PlayerPrefs.SetFloat("savedBestTimeSosig", savedBestTimeSosig);
		}
	}

	public void SelectSosig()
	{
		useSosigButton.SetActive(true);
		useTargetButton.SetActive(false);
		useTargets = false;
	}

	public void SelectTarget()
	{
		useSosigButton.SetActive(false);
		useTargetButton.SetActive(true);
		useTargets = true;
	}

	public IEnumerator delayResetFinish()
	{
		yield return (object)new WaitForSeconds(1f);
		PitTrigger[] array = triggers;
		foreach (PitTrigger trig in array)
		{
			trig.hasRun = false;
		}
	}

	public void Update()
	{
		UpdateUI();
		if (runTimer)
		{
			curTime += Time.deltaTime;
		}
	}
}
public class PitSosig : MonoBehaviour
{
	public Sosig sos;

	public bool isDead = false;

	public bool isFriendly;

	public void Start()
	{
		sos = ((Component)this).GetComponent<Sosig>();
	}

	public void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Invalid comparison between Unknown and I4
		if ((int)sos.BodyState == 3)
		{
			isDead = true;
		}
	}
}
public class PitTarget : MonoBehaviour, IFVRDamageable
{
	public bool isHit;

	public AudioSource source;

	public bool isFriendly;

	void IFVRDamageable.Damage(Damage dam)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Invalid comparison between Unknown and I4
		if ((int)dam.Class == 1)
		{
			isHit = true;
			source.Play();
			Debug.Log((object)"Target Hit");
		}
	}

	public void DeleteTarget()
	{
	}

	public void Update()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: 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_0055: Unknown result type (might be due to invalid IL or missing references)
		if (isHit)
		{
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(180f, ((Component)this).transform.localEulerAngles.y, ((Component)this).transform.localEulerAngles.z);
			((Component)this).transform.localEulerAngles = Vector3.Lerp(((Component)this).transform.localEulerAngles, val, 5f * Time.deltaTime);
			Object.Destroy((Object)(object)((Component)this).gameObject, 0.2f);
		}
	}
}
public class PitTrigger : MonoBehaviour
{
	public bool isStart;

	public PitController npc;

	[HideInInspector]
	public bool hasRun = false;

	public void OnTriggerEnter(Collider collider)
	{
		if (((Component)collider).gameObject.tag == "GameController")
		{
			if (isStart)
			{
				StartCourse();
			}
			else
			{
				EndCourse();
			}
		}
	}

	public void StartCourse()
	{
		if (!hasRun)
		{
			npc.OnStart();
		}
		hasRun = true;
	}

	public void EndCourse()
	{
		if (!hasRun)
		{
			npc.OnFinish();
		}
		hasRun = true;
	}
}
public class PitZone : MonoBehaviour
{
	public Transform[] spawnPoints;

	public Transform[] friendlySpawnPoints;

	public GameObject navBlocker;

	public bool isZoneActive;

	[HideInInspector]
	public List<PitSosig> spawnedSosigs = new List<PitSosig>();

	[HideInInspector]
	public List<PitTarget> spawnedTargets = new List<PitTarget>();

	[HideInInspector]
	public List<PitSosig> friendlySpawnedSosigs = new List<PitSosig>();

	[HideInInspector]
	public List<PitTarget> friendlySpawnedTargets = new List<PitTarget>();

	public PitController npc;

	private readonly SpawnOptions spawnOptions = new SpawnOptions
	{
		SpawnState = (SosigOrder)6,
		SpawnActivated = true,
		EquipmentMode = (EquipmentSlots)1,
		SpawnWithFullAmmo = true,
		IFF = 0
	};

	public void StartZone()
	{
		//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_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
		isZoneActive = true;
		SosigEnemyID random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)npc.enemySosigIDs);
		SosigEnemyID random2 = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)npc.friendlySosigIDs);
		Transform[] array = spawnPoints;
		foreach (Transform sp in array)
		{
			if (npc.useTargets)
			{
				SpawnTarget(sp, friendly: false, npc.targetPrefab);
			}
			else
			{
				SpawnSosig(sp, random, friendly: false);
			}
		}
		Transform[] array2 = friendlySpawnPoints;
		foreach (Transform sp2 in array2)
		{
			if (npc.useTargets)
			{
				SpawnTarget(sp2, friendly: true, npc.friendlyTargetPrefab);
			}
			else
			{
				SpawnSosig(sp2, random2, friendly: true);
			}
		}
		navBlocker.SetActive(true);
	}

	public void FinishZone()
	{
		if (npc.useTargets)
		{
			foreach (PitTarget friendlySpawnedTarget in friendlySpawnedTargets)
			{
				friendlySpawnedTarget.isHit = true;
				friendlySpawnedTargets.Remove(friendlySpawnedTarget);
			}
		}
		else
		{
			foreach (PitSosig friendlySpawnedSosig in friendlySpawnedSosigs)
			{
				friendlySpawnedSosig.sos.ClearSosig();
				friendlySpawnedSosigs.Remove(friendlySpawnedSosig);
			}
		}
		isZoneActive = false;
		navBlocker.SetActive(false);
		npc.zoneInd++;
		if (npc.zoneInd < npc.zones.Length)
		{
			npc.zones[npc.zoneInd].StartZone();
		}
		npc.PlayClip(0);
	}

	private void SpawnSosig(Transform sp, SosigEnemyID id, bool friendly)
	{
		//IL_000d: 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_0020: Unknown result type (might be due to invalid IL or missing references)
		Sosig val = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[id], spawnOptions, sp.position, sp.rotation);
		PitSosig pitSosig = ((Component)val).gameObject.AddComponent<PitSosig>();
		pitSosig.isFriendly = friendly;
		if (friendly)
		{
			friendlySpawnedSosigs.Add(pitSosig);
		}
		else
		{
			spawnedSosigs.Add(pitSosig);
		}
	}

	private void SpawnTarget(Transform sp, bool friendly, GameObject target)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(target, sp.position, sp.rotation, sp);
		PitTarget component = val.GetComponent<PitTarget>();
		component.isFriendly = friendly;
		if (friendly)
		{
			friendlySpawnedTargets.Add(component);
		}
		else
		{
			spawnedTargets.Add(component);
		}
	}

	public void Update()
	{
		if (!isZoneActive)
		{
			return;
		}
		if (npc.useTargets)
		{
			foreach (PitTarget spawnedTarget in spawnedTargets)
			{
				if (spawnedTarget.isHit)
				{
					spawnedTargets.Remove(spawnedTarget);
					break;
				}
			}
			foreach (PitTarget friendlySpawnedTarget in friendlySpawnedTargets)
			{
				if (friendlySpawnedTarget.isHit)
				{
					friendlySpawnedTargets.Remove(friendlySpawnedTarget);
					break;
				}
			}
			if (spawnedTargets.Count <= 0 && isZoneActive)
			{
				FinishZone();
			}
			return;
		}
		foreach (PitSosig spawnedSosig in spawnedSosigs)
		{
			if (spawnedSosig.isDead)
			{
				spawnedSosig.sos.ClearSosig();
				spawnedSosigs.Remove(spawnedSosig);
				break;
			}
		}
		foreach (PitSosig friendlySpawnedSosig in friendlySpawnedSosigs)
		{
			if (friendlySpawnedSosig.isDead)
			{
				friendlySpawnedSosig.sos.ClearSosig();
				friendlySpawnedSosigs.Remove(friendlySpawnedSosig);
				break;
			}
		}
		if (spawnedSosigs.Count <= 0 && isZoneActive)
		{
			FinishZone();
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string id = null, string name = null, string version = null)
		{
		}
	}
}
namespace localpcnerd
{
	[BepInProcess("h3vr.exe")]
	[BepInPlugin("PitScripts", "PitScripts", "1.0.0")]
	public class PitPlugin : BaseUnityPlugin
	{
		public const string Id = "PitScripts";

		internal static ManualLogSource Logger { get; private set; }

		public static string Name => "PitScripts";

		public static string Version => "1.0.0";

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogMessage((object)("PitScripts: PitScripts, " + Name + ", " + Version + "."));
		}
	}
}

SceneLoaderObject.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Atlas;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using Sodalite.Api;
using Sodalite.Utilities;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class SceneLoaderObject : FVRPhysicalObject
{
	[Header("Scene Loading")]
	public string sceneToLoad = "";

	private static readonly Collider[] Colliders = (Collider[])(object)new Collider[32];

	private Rigidbody _rb;

	public override void Awake()
	{
		((FVRPhysicalObject)this).Awake();
		_rb = ((Component)this).GetComponent<Rigidbody>();
	}

	public override void UpdateInteraction(FVRViveHand hand)
	{
		//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_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		((FVRPhysicalObject)this).UpdateInteraction(hand);
		int num = Physics.OverlapSphereNonAlloc(GM.CurrentPlayerBody.Head.position + Vector3.up * -0.1f, 0.1f, Colliders, -1, (QueryTriggerInteraction)1);
		bool flag = false;
		for (int i = 0; i < num; i++)
		{
			if ((Object)(object)Colliders[i].attachedRigidbody == (Object)(object)_rb)
			{
				flag = true;
			}
		}
		if (flag)
		{
			LoadMap();
		}
	}

	public void LoadMap()
	{
		AtlasPlugin.LoadCustomScene(sceneToLoad);
	}
}
namespace MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace localpcnerd.SceneLoaderObject
{
	[BepInPlugin("localpcnerd.SceneLoaderObject", "SceneLoaderObject", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class SceneLoaderObjectPlugin : 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(), "localpcnerd.SceneLoaderObject");
			OtherLoader.RegisterDirectLoad(BasePath, "localpcnerd.SceneLoaderObject", "", "", "atlassceneloader", "");
		}
	}
}
namespace SimpleLightProbePlacer
{
	[RequireComponent(typeof(LightProbeGroup))]
	[AddComponentMenu("Rendering/Light Probe Group Control")]
	public class LightProbeGroupControl : MonoBehaviour
	{
		[SerializeField]
		private float m_mergeDistance = 0.5f;

		[SerializeField]
		private bool m_usePointLights = true;

		[SerializeField]
		private float m_pointLightRange = 1f;

		private int m_mergedProbes;

		private LightProbeGroup m_lightProbeGroup;

		public float MergeDistance
		{
			get
			{
				return m_mergeDistance;
			}
			set
			{
				m_mergeDistance = value;
			}
		}

		public int MergedProbes => m_mergedProbes;

		public bool UsePointLights
		{
			get
			{
				return m_usePointLights;
			}
			set
			{
				m_usePointLights = value;
			}
		}

		public float PointLightRange
		{
			get
			{
				return m_pointLightRange;
			}
			set
			{
				m_pointLightRange = value;
			}
		}

		public LightProbeGroup LightProbeGroup
		{
			get
			{
				if ((Object)(object)m_lightProbeGroup != (Object)null)
				{
					return m_lightProbeGroup;
				}
				return m_lightProbeGroup = ((Component)this).GetComponent<LightProbeGroup>();
			}
		}

		public void DeleteAll()
		{
			LightProbeGroup.probePositions = null;
			m_mergedProbes = 0;
		}

		public void Create()
		{
			DeleteAll();
			List<Vector3> list = CreatePositions();
			list.AddRange(CreateAroundPointLights(m_pointLightRange));
			list = MergeClosestPositions(list, m_mergeDistance, out m_mergedProbes);
			ApplyPositions(list);
		}

		public void Merge()
		{
			if (LightProbeGroup.probePositions != null)
			{
				List<Vector3> source = MergeClosestPositions(LightProbeGroup.probePositions.ToList(), m_mergeDistance, out m_mergedProbes);
				source = source.Select((Vector3 x) => ((Component)this).transform.TransformPoint(x)).ToList();
				ApplyPositions(source);
			}
		}

		private void ApplyPositions(List<Vector3> positions)
		{
			LightProbeGroup.probePositions = positions.Select((Vector3 x) => ((Component)this).transform.InverseTransformPoint(x)).ToArray();
		}

		private static List<Vector3> CreatePositions()
		{
			LightProbeVolume[] array = Object.FindObjectsOfType<LightProbeVolume>();
			if (array.Length == 0)
			{
				return new List<Vector3>();
			}
			List<Vector3> list = new List<Vector3>();
			for (int i = 0; i < array.Length; i++)
			{
				list.AddRange(array[i].CreatePositions());
			}
			return list;
		}

		private static List<Vector3> CreateAroundPointLights(float range)
		{
			List<Light> list = (from x in Object.FindObjectsOfType<Light>()
				where (int)x.type == 2
				select x).ToList();
			if (list.Count == 0)
			{
				return new List<Vector3>();
			}
			List<Vector3> list2 = new List<Vector3>();
			for (int i = 0; i < list.Count; i++)
			{
				list2.AddRange(CreatePositionsAround(((Component)list[i]).transform, range));
			}
			return list2;
		}

		private static List<Vector3> MergeClosestPositions(List<Vector3> positions, float distance, out int mergedCount)
		{
			//IL_00a2: 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_0127: 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_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			if (positions == null)
			{
				mergedCount = 0;
				return new List<Vector3>();
			}
			int count = positions.Count;
			bool flag = false;
			while (!flag)
			{
				Dictionary<Vector3, List<Vector3>> dictionary = new Dictionary<Vector3, List<Vector3>>();
				for (int i = 0; i < positions.Count; i++)
				{
					List<Vector3> list = positions.Where(delegate(Vector3 x)
					{
						//IL_0000: 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_0017: Unknown result type (might be due to invalid IL or missing references)
						//IL_001c: Unknown result type (might be due to invalid IL or missing references)
						Vector3 val2 = x - positions[i];
						return ((Vector3)(ref val2)).magnitude < distance;
					}).ToList();
					if (list.Count > 0 && !dictionary.ContainsKey(positions[i]))
					{
						dictionary.Add(positions[i], list);
					}
				}
				positions.Clear();
				List<Vector3> list2 = dictionary.Keys.ToList();
				for (int j = 0; j < list2.Count; j++)
				{
					Vector3 center = dictionary[list2[j]].Aggregate(Vector3.zero, (Vector3 result, Vector3 target) => result + target) / (float)dictionary[list2[j]].Count;
					if (!positions.Exists((Vector3 x) => x == center))
					{
						positions.Add(center);
					}
				}
				flag = positions.Select((Vector3 x) => positions.Where(delegate(Vector3 y)
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0011: 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)
					int result2;
					if (y != x)
					{
						Vector3 val = y - x;
						result2 = ((((Vector3)(ref val)).magnitude < distance) ? 1 : 0);
					}
					else
					{
						result2 = 0;
					}
					return (byte)result2 != 0;
				})).All((IEnumerable<Vector3> x) => !x.Any());
			}
			mergedCount = count - positions.Count;
			return positions;
		}

		public static List<Vector3> CreatePositionsAround(Transform transform, float range)
		{
			//IL_0031: 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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_00d6: 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_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] source = (Vector3[])(object)new Vector3[8]
			{
				new Vector3(-0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, -0.5f)
			};
			return source.Select((Vector3 x) => transform.TransformPoint(x * range)).ToList();
		}
	}
	public enum LightProbeVolumeType
	{
		Fixed,
		Float
	}
	[AddComponentMenu("Rendering/Light Probe Volume")]
	public class LightProbeVolume : TransformVolume
	{
		[SerializeField]
		private LightProbeVolumeType m_type = LightProbeVolumeType.Fixed;

		[SerializeField]
		private Vector3 m_densityFixed = Vector3.one;

		[SerializeField]
		private Vector3 m_densityFloat = Vector3.one;

		public LightProbeVolumeType Type
		{
			get
			{
				return m_type;
			}
			set
			{
				m_type = value;
			}
		}

		public Vector3 Density
		{
			get
			{
				//IL_0018: 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_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)
				return (m_type != 0) ? m_densityFloat : m_densityFixed;
			}
			set
			{
				//IL_0019: 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_000d: 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)
				if (m_type == LightProbeVolumeType.Fixed)
				{
					m_densityFixed = value;
				}
				else
				{
					m_densityFloat = value;
				}
			}
		}

		public static Color EditorColor => new Color(1f, 0.9f, 0.25f);

		public List<Vector3> CreatePositions()
		{
			return CreatePositions(m_type);
		}

		public List<Vector3> CreatePositions(LightProbeVolumeType type)
		{
			//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)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			return (type != 0) ? CreatePositionsFloat(((Component)this).transform, base.Origin, base.Size, Density) : CreatePositionsFixed(((Component)this).transform, base.Origin, base.Size, Density);
		}

		public static List<Vector3> CreatePositionsFixed(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_0053: 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_0079: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			Vector3 val = origin;
			float num = size.x / (float)Mathf.FloorToInt(density.x);
			float num2 = size.y / (float)Mathf.FloorToInt(density.y);
			float num3 = size.z / (float)Mathf.FloorToInt(density.z);
			val -= size * 0.5f;
			for (int i = 0; (float)i <= density.x; i++)
			{
				for (int j = 0; (float)j <= density.y; j++)
				{
					for (int k = 0; (float)k <= density.z; k++)
					{
						Vector3 val2 = val + new Vector3((float)i * num, (float)j * num2, (float)k * num3);
						val2 = volumeTransform.TransformPoint(val2);
						list.Add(val2);
					}
				}
			}
			return list;
		}

		public static List<Vector3> CreatePositionsFloat(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			Vector3 val = origin;
			int num = Mathf.FloorToInt(size.x / density.x);
			int num2 = Mathf.FloorToInt(size.y / density.y);
			int num3 = Mathf.FloorToInt(size.z / density.z);
			val -= size * 0.5f;
			val.x += (size.x - (float)num * density.x) * 0.5f;
			val.y += (size.y - (float)num2 * density.y) * 0.5f;
			val.z += (size.z - (float)num3 * density.z) * 0.5f;
			for (int i = 0; i <= num; i++)
			{
				for (int j = 0; j <= num2; j++)
				{
					for (int k = 0; k <= num3; k++)
					{
						Vector3 val2 = val + new Vector3((float)i * density.x, (float)j * density.y, (float)k * density.z);
						val2 = volumeTransform.TransformPoint(val2);
						list.Add(val2);
					}
				}
			}
			return list;
		}
	}
	[AddComponentMenu("")]
	public class TransformVolume : MonoBehaviour
	{
		[SerializeField]
		private Volume m_volume = new Volume(Vector3.zero, Vector3.one);

		public Volume Volume
		{
			get
			{
				return m_volume;
			}
			set
			{
				m_volume = value;
			}
		}

		public Vector3 Origin => m_volume.Origin;

		public Vector3 Size => m_volume.Size;

		public bool IsInBounds(Vector3[] points)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			Bounds bounds = GetBounds();
			return ((Bounds)(ref bounds)).Intersects(GetBounds(points));
		}

		public bool IsOnBorder(Vector3[] points)
		{
			if (points.All((Vector3 x) => !IsInVolume(x)))
			{
				return false;
			}
			return !points.All(IsInVolume);
		}

		public bool IsInVolume(Vector3[] points)
		{
			return points.All(IsInVolume);
		}

		public bool IsInVolume(Vector3 position)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			Plane val = default(Plane);
			for (int i = 0; i < 6; i++)
			{
				((Plane)(ref val))..ctor(GetSideDirection(i), GetSidePosition(i));
				if (((Plane)(ref val)).GetSide(position))
				{
					return false;
				}
			}
			return true;
		}

		public Vector3[] GetCorners()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] array = (Vector3[])(object)new Vector3[8]
			{
				new Vector3(-0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, -0.5f)
			};
			for (int i = 0; i < array.Length; i++)
			{
				ref Vector3 reference = ref array[i];
				reference.x *= m_volume.Size.x;
				ref Vector3 reference2 = ref array[i];
				reference2.y *= m_volume.Size.y;
				ref Vector3 reference3 = ref array[i];
				reference3.z *= m_volume.Size.z;
				ref Vector3 reference4 = ref array[i];
				reference4 = ((Component)this).transform.TransformPoint(m_volume.Origin + array[i]);
			}
			return array;
		}

		public Bounds GetBounds()
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			return GetBounds(GetCorners());
		}

		public Bounds GetBounds(Vector3[] points)
		{
			//IL_0002: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_0036: 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_0069: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = points.Aggregate(Vector3.zero, (Vector3 result, Vector3 point) => result + point) / (float)points.Length;
			Bounds result2 = default(Bounds);
			((Bounds)(ref result2))..ctor(val, Vector3.zero);
			for (int i = 0; i < points.Length; i++)
			{
				((Bounds)(ref result2)).Encapsulate(points[i]);
			}
			return result2;
		}

		public GameObject[] GetGameObjectsInBounds(LayerMask layerMask)
		{
			//IL_000e: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			MeshRenderer[] array = Object.FindObjectsOfType<MeshRenderer>();
			List<GameObject> list = new List<GameObject>();
			Bounds bounds = GetBounds();
			for (int i = 0; i < array.Length; i++)
			{
				if (!((Object)(object)((Component)array[i]).gameObject == (Object)(object)((Component)((Component)this).transform).gameObject) && !((Object)(object)((Component)array[i]).GetComponent<TransformVolume>() != (Object)null) && ((1 << ((Component)array[i]).gameObject.layer) & ((LayerMask)(ref layerMask)).value) != 0 && ((Bounds)(ref bounds)).Intersects(((Renderer)array[i]).bounds))
				{
					list.Add(((Component)array[i]).gameObject);
				}
			}
			return list.ToArray();
		}

		public Vector3 GetSideDirection(int side)
		{
			//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_000e: 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_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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_002f: 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_0040: 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_004d: 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_005f: 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_006c: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] array = (Vector3[])(object)new Vector3[6];
			Vector3 right = Vector3.right;
			Vector3 up = Vector3.up;
			Vector3 forward = Vector3.forward;
			array[0] = right;
			ref Vector3 reference = ref array[1];
			reference = -right;
			array[2] = up;
			ref Vector3 reference2 = ref array[3];
			reference2 = -up;
			array[4] = forward;
			ref Vector3 reference3 = ref array[5];
			reference3 = -forward;
			return ((Component)this).transform.TransformDirection(array[side]);
		}

		public Vector3 GetSidePosition(int side)
		{
			//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_000e: 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_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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_002f: 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_0040: 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_004d: 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_005f: 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_006c: 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_0084: 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_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)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] array = (Vector3[])(object)new Vector3[6];
			Vector3 right = Vector3.right;
			Vector3 up = Vector3.up;
			Vector3 forward = Vector3.forward;
			array[0] = right;
			ref Vector3 reference = ref array[1];
			reference = -right;
			array[2] = up;
			ref Vector3 reference2 = ref array[3];
			reference2 = -up;
			array[4] = forward;
			ref Vector3 reference3 = ref array[5];
			reference3 = -forward;
			return ((Component)this).transform.TransformPoint(array[side] * GetSizeAxis(side) + m_volume.Origin);
		}

		public float GetSizeAxis(int side)
		{
			//IL_0022: 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_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)
			//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)
			switch (side)
			{
			case 0:
			case 1:
				return m_volume.Size.x * 0.5f;
			case 2:
			case 3:
				return m_volume.Size.y * 0.5f;
			default:
				return m_volume.Size.z * 0.5f;
			}
		}

		public static Volume EditorVolumeControl(TransformVolume transformVolume, float handleSize, Color color)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_0052: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_010c: 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_0124: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Expected O, but got Unknown
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: 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_0170: 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_0148: Expected O, but got Unknown
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: 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_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: 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_023b: 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_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: 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_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: 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_01d4: Expected O, but got Unknown
			Vector3[] array = (Vector3[])(object)new Vector3[6];
			Transform transform = ((Component)transformVolume).transform;
			Handles.color = color;
			for (int i = 0; i < array.Length; i++)
			{
				ref Vector3 reference = ref array[i];
				reference = transformVolume.GetSidePosition(i);
			}
			ref Vector3 reference2 = ref array[0];
			reference2 = Handles.Slider(array[0], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference3 = ref array[1];
			reference3 = Handles.Slider(array[1], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference4 = ref array[2];
			reference4 = Handles.Slider(array[2], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference5 = ref array[3];
			reference5 = Handles.Slider(array[3], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference6 = ref array[4];
			reference6 = Handles.Slider(array[4], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			ref Vector3 reference7 = ref array[5];
			reference7 = Handles.Slider(array[5], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
			Vector3 origin = default(Vector3);
			origin.x = transform.InverseTransformPoint((array[0] + array[1]) * 0.5f).x;
			origin.y = transform.InverseTransformPoint((array[2] + array[3]) * 0.5f).y;
			origin.z = transform.InverseTransformPoint((array[4] + array[5]) * 0.5f).z;
			Vector3 size = default(Vector3);
			size.x = transform.InverseTransformPoint(array[0]).x - transform.InverseTransformPoint(array[1]).x;
			size.y = transform.InverseTransformPoint(array[2]).y - transform.InverseTransformPoint(array[3]).y;
			size.z = transform.InverseTransformPoint(array[4]).z - transform.InverseTransformPoint(array[5]).z;
			return new Volume(origin, size);
		}
	}
	[Serializable]
	public struct Volume
	{
		[SerializeField]
		private Vector3 m_origin;

		[SerializeField]
		private Vector3 m_size;

		public Vector3 Origin => m_origin;

		public Vector3 Size => m_size;

		public Volume(Vector3 origin, Vector3 size)
		{
			//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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			m_origin = origin;
			m_size = size;
		}

		public static bool operator ==(Volume left, Volume right)
		{
			return left.Equals(right);
		}

		public static bool operator !=(Volume left, Volume right)
		{
			return !left.Equals(right);
		}

		public bool Equals(Volume other)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			return Origin == other.Origin && Size == other.Size;
		}

		public override bool Equals(object obj)
		{
			if (object.ReferenceEquals(null, obj))
			{
				return false;
			}
			return obj is Volume && Equals((Volume)obj);
		}

		public override int GetHashCode()
		{
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Vector3 origin = Origin;
			int num = ((object)(Vector3)(ref origin)).GetHashCode() * 397;
			Vector3 size = Size;
			return num ^ ((object)(Vector3)(ref size)).GetHashCode();
		}

		public override string ToString()
		{
			//IL_0007: 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)
			return $"Origin: {Origin}, Size: {Size}";
		}
	}
}
namespace nrgill28.AtlasSampleScene
{
	public class CTF_CaptureZone : MonoBehaviour
	{
		public CTF_Manager Manager;

		public CTF_Team Team;

		public void OnTriggerEnter(Collider other)
		{
			CTF_Flag component = ((Component)other).GetComponent<CTF_Flag>();
			if (Object.op_Implicit((Object)(object)component) && component.Team != Team)
			{
				Manager.FlagCaptured(component);
			}
		}
	}
	public class CTF_Flag : FVRPhysicalObject
	{
		[Header("Flag stuffs")]
		public CTF_Team Team;

		public float RespawnDelay = 10f;

		public Vector3 FloorOffset = new Vector3(0f, 0.25f, 0f);

		private Vector3 _resetPosition;

		private Quaternion _resetRotation;

		private Transform _followTransform;

		private bool _isHeld;

		private bool _isTaken;

		private float _timer;

		private CTF_Sosig _heldBy;

		public override void Awake()
		{
			//IL_000e: 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_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)
			((FVRPhysicalObject)this).Awake();
			_resetPosition = ((Component)this).transform.position;
			_resetRotation = ((Component)this).transform.rotation;
		}

		private void Update()
		{
			if (_isTaken && !_isHeld)
			{
				_timer -= Time.deltaTime;
				if (_timer < 0f)
				{
					ReturnFlag();
				}
			}
		}

		public void Take()
		{
			_isHeld = true;
			_isTaken = true;
		}

		public void Drop()
		{
			//IL_001a: 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_0040: 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)
			((FVRInteractiveObject)this).IsHeld = false;
			_timer = RespawnDelay;
			NavMeshHit val = default(NavMeshHit);
			NavMesh.SamplePosition(((Component)this).transform.position, ref val, 100f, -1);
			((Component)this).transform.position = ((NavMeshHit)(ref val)).position + FloorOffset;
			((Component)this).transform.rotation = Quaternion.identity;
		}

		public void ReturnFlag()
		{
			//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)
			if (((FVRInteractiveObject)this).IsHeld)
			{
				((FVRInteractiveObject)this).ForceBreakInteraction();
			}
			if (Object.op_Implicit((Object)(object)_heldBy))
			{
				_heldBy.HeldFlag = null;
			}
			((Component)this).transform.SetPositionAndRotation(_resetPosition, _resetRotation);
			_isTaken = false;
		}

		private void OnTriggerEnter(Collider other)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			if (_isHeld)
			{
				return;
			}
			CTF_Sosig componentInParent = ((Component)other).GetComponentInParent<CTF_Sosig>();
			if (Object.op_Implicit((Object)(object)componentInParent) && (int)componentInParent.Sosig.BodyState == 0)
			{
				if (componentInParent.Team == Team)
				{
					ReturnFlag();
					return;
				}
				_heldBy = componentInParent;
				componentInParent.HeldFlag = this;
				Take();
			}
		}

		public override void BeginInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).BeginInteraction(hand);
			Take();
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).EndInteraction(hand);
			Drop();
		}
	}
	public class CTF_Manager : MonoBehaviour
	{
		[Header("References")]
		public Text[] ScoreTexts;

		public Transform[] AttackPoints;

		public Text StartButtonText;

		[Header("Red Team")]
		public CTF_Flag RedFlag;

		public int RedTeamSize;

		public Transform[] RedSpawns;

		public SosigEnemyID[] RedTeam;

		[Header("Blue Team")]
		public CTF_Flag BlueFlag;

		public int BlueTeamSize;

		public Transform[] BlueSpawns;

		public SosigEnemyID[] BlueTeam;

		private int _blueScore;

		private int _redScore;

		private bool _running;

		private readonly List<CTF_Sosig> _sosigs = new List<CTF_Sosig>();

		private readonly SpawnOptions _spawnOptions;

		public CTF_Manager()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			SpawnOptions val = new SpawnOptions();
			val.SpawnState = (SosigOrder)7;
			val.SpawnActivated = true;
			val.EquipmentMode = (EquipmentSlots)7;
			val.SpawnWithFullAmmo = true;
			_spawnOptions = val;
			((MonoBehaviour)this)..ctor();
		}

		private void Start()
		{
			UpdateScoreText();
		}

		public void ToggleGame()
		{
			if (_running)
			{
				EndGame();
				StartButtonText.text = "Start Game";
			}
			else
			{
				StartGame();
				StartButtonText.text = "Stop Game";
			}
		}

		private void StartGame()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			ResetGame();
			_running = true;
			GM.CurrentSceneSettings.SosigKillEvent += new SosigKill(CurrentSceneSettingsOnSosigKillEvent);
			((MonoBehaviour)this).StartCoroutine(DoInitialSpawns());
		}

		private void EndGame()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.SosigKillEvent -= new SosigKill(CurrentSceneSettingsOnSosigKillEvent);
			foreach (CTF_Sosig sosig in _sosigs)
			{
				sosig.Sosig.ClearSosig();
			}
			_running = false;
		}

		private void CurrentSceneSettingsOnSosigKillEvent(Sosig s)
		{
			CTF_Sosig cTF_Sosig = _sosigs.FirstOrDefault((CTF_Sosig x) => (Object)(object)x.Sosig == (Object)(object)s);
			if (Object.op_Implicit((Object)(object)cTF_Sosig))
			{
				((MonoBehaviour)this).StartCoroutine(RespawnSosig(cTF_Sosig));
			}
		}

		private void SpawnSosig(CTF_Team team)
		{
			//IL_001e: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			_spawnOptions.IFF = (int)team;
			_spawnOptions.SosigTargetPosition = SodaliteUtils.GetRandom<Transform>((IList<Transform>)AttackPoints).position;
			Transform transform;
			SosigEnemyID random;
			if (team == CTF_Team.Red)
			{
				transform = ((Component)SodaliteUtils.GetRandom<Transform>((IList<Transform>)RedSpawns)).transform;
				random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)RedTeam);
			}
			else
			{
				transform = ((Component)SodaliteUtils.GetRandom<Transform>((IList<Transform>)BlueSpawns)).transform;
				random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)BlueTeam);
			}
			Sosig val = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[random], _spawnOptions, transform.position, transform.rotation);
			CTF_Sosig cTF_Sosig = ((Component)val).gameObject.AddComponent<CTF_Sosig>();
			_sosigs.Add(cTF_Sosig);
			cTF_Sosig.Sosig = val;
			cTF_Sosig.Team = team;
		}

		private IEnumerator DoInitialSpawns()
		{
			int i = 0;
			while (i < Mathf.Max(RedTeamSize, BlueTeamSize))
			{
				if (i < RedTeamSize)
				{
					SpawnSosig(CTF_Team.Red);
				}
				if (i < BlueTeamSize)
				{
					SpawnSosig(CTF_Team.Blue);
				}
				i++;
				yield return (object)new WaitForSeconds(2.5f);
			}
		}

		private IEnumerator RespawnSosig(CTF_Sosig sosig)
		{
			yield return (object)new WaitForSeconds(5f);
			sosig.Sosig.ClearSosig();
			_sosigs.Remove(sosig);
			yield return (object)new WaitForSeconds(5f);
			if (_running)
			{
				int sosigsLeft = _sosigs.Count((CTF_Sosig x) => x.Team == sosig.Team);
				int teamSize = ((sosig.Team != 0) ? BlueTeamSize : RedTeamSize);
				if (sosigsLeft < teamSize)
				{
					SpawnSosig(sosig.Team);
				}
			}
		}

		public void ResetGame()
		{
			_blueScore = 0;
			_redScore = 0;
			UpdateScoreText();
			if (Object.op_Implicit((Object)(object)RedFlag))
			{
				RedFlag.ReturnFlag();
			}
			if (Object.op_Implicit((Object)(object)BlueFlag))
			{
				BlueFlag.ReturnFlag();
			}
		}

		public void FlagCaptured(CTF_Flag flag)
		{
			if (flag.Team == CTF_Team.Red)
			{
				_blueScore++;
			}
			else
			{
				_redScore++;
			}
			UpdateScoreText();
			flag.ReturnFlag();
		}

		public void UpdateScoreText()
		{
			Text[] scoreTexts = ScoreTexts;
			foreach (Text val in scoreTexts)
			{
				val.text = "<color=red>" + _redScore + "</color> - <color=blue>" + _blueScore + "</color>";
			}
		}

		private void OnDrawGizmos()
		{
			//IL_0001: 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_003b: 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_007d: 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)
			Gizmos.color = Color.red;
			Transform[] redSpawns = RedSpawns;
			foreach (Transform val in redSpawns)
			{
				Gizmos.DrawSphere(val.position, 0.15f);
			}
			Gizmos.color = Color.blue;
			Transform[] blueSpawns = BlueSpawns;
			foreach (Transform val2 in blueSpawns)
			{
				Gizmos.DrawSphere(val2.position, 0.15f);
			}
			Gizmos.color = Color.green;
			Transform[] attackPoints = AttackPoints;
			foreach (Transform val3 in attackPoints)
			{
				Gizmos.DrawSphere(val3.position, 0.15f);
			}
		}
	}
	public class CTF_Sosig : MonoBehaviour
	{
		public CTF_Team Team;

		public CTF_Flag HeldFlag;

		public Sosig Sosig;

		private void Awake()
		{
			Sosig = ((Component)this).GetComponent<Sosig>();
		}

		private void Update()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_0041: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)HeldFlag))
			{
				Vector3 val = ((Component)Sosig).transform.position - ((Component)Sosig).transform.forward * 0.1f;
				((Component)HeldFlag).transform.SetPositionAndRotation(val, ((Component)Sosig).transform.rotation);
			}
		}
	}
	public enum CTF_Team
	{
		Red,
		Blue
	}
	public class PopupTarget : MonoBehaviour, IFVRDamageable
	{
		[Flags]
		public enum TargetRange
		{
			Near = 1,
			Mid = 2,
			Far = 4,
			All = 7
		}

		public PopupTargetManager Manager;

		public TargetRange Range;

		public Transform Pivot;

		public Vector3 SetRotation;

		private Quaternion _startRotation;

		private Quaternion _endRotation;

		private bool _set;

		public bool Set
		{
			get
			{
				return _set;
			}
			set
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: 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_002d: Unknown result type (might be due to invalid IL or missing references)
				if (_set != value)
				{
					_set = value;
					((MonoBehaviour)this).StartCoroutine((!_set) ? RotateTo(_endRotation, _startRotation) : RotateTo(_startRotation, _endRotation));
				}
			}
		}

		private void Awake()
		{
			//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_0014: 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_0029: 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)
			_startRotation = Pivot.rotation;
			_endRotation = Quaternion.Euler(SetRotation + ((Quaternion)(ref _startRotation)).eulerAngles);
		}

		void IFVRDamageable.Damage(Damage dam)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			if (Set && (int)dam.Class == 1)
			{
				Set = false;
				Manager.TargetHit(this);
			}
		}

		private IEnumerator RotateTo(Quaternion from, Quaternion to)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			float elapsed = 0f;
			while (elapsed < 0.25f)
			{
				yield return null;
				elapsed += Time.deltaTime;
				Pivot.localRotation = Quaternion.Slerp(from, to, elapsed / 0.25f);
			}
			Pivot.rotation = to;
		}
	}
	public class PopupTargetManager : MonoBehaviour
	{
		public List<PopupTarget> Targets;

		private readonly List<PopupTarget> _setTargets = new List<PopupTarget>();

		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All));
		}

		private IEnumerator StartSetAsync(float minDelay, float maxDelay, int numTargets, PopupTarget.TargetRange ranges)
		{
			yield return (object)new WaitForSeconds(Random.Range(minDelay, maxDelay));
			IListExtensions.Shuffle<PopupTarget>((IList<PopupTarget>)Targets);
			_setTargets.Clear();
			foreach (PopupTarget target in Targets)
			{
				if ((target.Range & ranges) != 0)
				{
					target.Set = true;
					_setTargets.Add(target);
					numTargets--;
				}
				if (numTargets == 0)
				{
					break;
				}
			}
		}

		public void TargetHit(PopupTarget target)
		{
			if (_setTargets.Contains(target))
			{
				_setTargets.Remove(target);
				if (_setTargets.Count == 0)
				{
					((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All));
				}
			}
		}
	}
}
public class ScopeEditingPanel : MonoBehaviour
{
	public Text selectedItemText;

	public Text baseMagnificationText;

	public Text baseFOVText;

	public Text reticleFOVText;

	public Text lensDistortionText;

	public Text stockZPositionText;

	private bool isEditingScopes = true;

	private int selectedFirearmIndex;

	private int selectedScopeIndex;

	private List<PIPScope> scopesInScene = new List<PIPScope>();

	private List<FVRFireArm> firearmsInScene = new List<FVRFireArm>();

	public void UpdateScopePanel()
	{
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		PIPScope val = scopesInScene[selectedScopeIndex];
		FVRFireArm val2 = firearmsInScene[selectedFirearmIndex];
		if (isEditingScopes)
		{
			selectedItemText.text = ((FVRPhysicalObject)((Component)((Component)val).transform.root).GetComponent<FVRFireArmAttachment>()).ObjectWrapper.DisplayName;
			baseMagnificationText.text = "Base Magnification: " + val.baseMagnification;
			baseFOVText.text = "Base FOV: " + val.baseFOV;
			reticleFOVText.text = "Reticle FOV: " + val.reticle.reticleFOV;
			lensDistortionText.text = "Lens Distortion: " + val.distortion;
		}
		else if (!isEditingScopes)
		{
			selectedItemText.text = ((FVRPhysicalObject)val2).ObjectWrapper.DisplayName;
			stockZPositionText.text = ((Component)val2.StockPos).transform.position.z.ToString();
		}
	}

	public void GrabFirearmsInScene()
	{
		firearmsInScene.Clear();
		firearmsInScene.AddRange(Object.FindObjectsOfType<FVRFireArm>());
		selectedFirearmIndex = 0;
	}

	public void GrabScopesInScene()
	{
		scopesInScene.Clear();
		scopesInScene.AddRange(Object.FindObjectsOfType<PIPScope>());
		selectedScopeIndex = 0;
	}

	public void IndexForward()
	{
		if (isEditingScopes)
		{
			if (selectedScopeIndex == scopesInScene.Count)
			{
				selectedScopeIndex = 0;
			}
			else
			{
				selectedScopeIndex++;
			}
		}
		else if (!isEditingScopes)
		{
			if (selectedFirearmIndex == firearmsInScene.Count)
			{
				selectedFirearmIndex = 0;
			}
			else
			{
				selectedFirearmIndex++;
			}
		}
		UpdateScopePanel();
	}

	public void IndexBackward()
	{
		if (isEditingScopes)
		{
			if (selectedScopeIndex == 0)
			{
				selectedScopeIndex = scopesInScene.Count;
			}
			else
			{
				selectedScopeIndex--;
			}
		}
		else if (!isEditingScopes)
		{
			if (selectedFirearmIndex == 0)
			{
				selectedFirearmIndex = firearmsInScene.Count;
			}
			else
			{
				selectedFirearmIndex--;
			}
		}
		UpdateScopePanel();
	}

	public void IndexRefresh()
	{
		GrabFirearmsInScene();
		GrabScopesInScene();
		UpdateScopePanel();
	}
}

Storymods_Trenchbuster.dll

Decompiled a week ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class FlickerLight : MonoBehaviour
{
	public float MinLightIntensity = 0.5f;

	public float MaxLightIntensity = 2.3f;

	public float AccelerateTime = 0.15f;

	private float _targetIntensity = 1f;

	private float _lastIntensity = 1f;

	private float _timePassed = 0f;

	private Light _lt;

	private const double Tolerance = 0.0001;

	private void Start()
	{
		_lt = ((Component)this).GetComponent<Light>();
		_lastIntensity = _lt.intensity;
		FixedUpdate();
	}

	private void FixedUpdate()
	{
		_timePassed += Time.deltaTime;
		_lt.intensity = Mathf.Lerp(_lastIntensity, _targetIntensity, _timePassed / AccelerateTime);
		if ((double)Mathf.Abs(_lt.intensity - _targetIntensity) < 0.0001)
		{
			_lastIntensity = _lt.intensity;
			_targetIntensity = Random.Range(MinLightIntensity, MaxLightIntensity);
			_timePassed = 0f;
		}
	}
}
[RequireComponent(typeof(MeshRenderer))]
public class UVOffset : MonoBehaviour
{
	public float scrollSpeed = 0.5f;

	public bool scrollY = true;

	private MeshRenderer renderer;

	private void Start()
	{
		renderer = ((Component)this).GetComponent<MeshRenderer>();
	}

	private void Update()
	{
		//IL_003f: 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)
		float num = Time.time * scrollSpeed;
		((Renderer)renderer).material.SetTextureOffset("_MainTex", (!scrollY) ? new Vector2(0f, num) : new Vector2(num, 0f));
	}
}
namespace Storymods.Storymods_Trenchbuster;

[BepInPlugin("Storymods.Storymods_Trenchbuster", "Storymods_Trenchbuster", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Storymods_TrenchbusterPlugin : 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(), "Storymods.Storymods_Trenchbuster");
		OtherLoader.RegisterDirectLoad(BasePath, "Storymods.Storymods_Trenchbuster", "", "", "modmas2024_item70", "");
	}
}
public class Cabernade : MonoBehaviour
{
	public GameObject caberUnexploded;

	public GameObject caberExploded;

	public bool isCaberKablooey;

	public void OnCollisionEnter(Collision col)
	{
		if (!isCaberKablooey)
		{
			CaberBlowUp();
		}
	}

	public void CaberBlowUp()
	{
		caberUnexploded.SetActive(false);
		caberExploded.SetActive(true);
		isCaberKablooey = true;
	}
}
public class SosigRangeEditor : MonoBehaviour
{
	public GameObject sosigParent;

	public float modifierNumber = 1f;

	public bool doesHavePerfectFOV = false;

	private void Start()
	{
		sosigParent = ((Component)((Component)this).transform.root).gameObject;
		Sosig component = ((Component)((Component)this).transform).GetComponent<Sosig>();
		component.MaxSightRange *= modifierNumber;
		if (doesHavePerfectFOV)
		{
			component.MaxFOV = 360f;
		}
		else
		{
			component.MaxFOV *= modifierNumber;
		}
	}
}

Antique_Grenades_MODMAS.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;
using UnityEngine;
using UnityEngine.UI;

[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]
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoStopLoopedEffect : MonoBehaviour
{
	public float effectDuration = 2.5f;

	private float d;

	private void OnEnable()
	{
		d = effectDuration;
	}

	private void Update()
	{
		if (!(d > 0f))
		{
			return;
		}
		d -= Time.deltaTime;
		if (d <= 0f)
		{
			((Component)this).GetComponent<ParticleSystem>().Stop(true);
			CFX_Demo_Translate component = ((Component)this).gameObject.GetComponent<CFX_Demo_Translate>();
			if ((Object)(object)component != (Object)null)
			{
				((Behaviour)component).enabled = false;
			}
		}
	}
}
public class CFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class CFX_Demo_RotateCamera : MonoBehaviour
{
	public static bool rotating = true;

	public float speed = 30f;

	public Transform rotationCenter;

	private void Update()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		if (rotating)
		{
			((Component)this).transform.RotateAround(rotationCenter.position, Vector3.up, speed * Time.deltaTime);
		}
	}
}
public class CFX_Demo_Translate : MonoBehaviour
{
	public float speed = 30f;

	public Vector3 rotation = Vector3.forward;

	public Vector3 axis = Vector3.forward;

	public bool gravity;

	private Vector3 dir;

	private void Start()
	{
		//IL_002f: 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_0040: 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)
		dir = new Vector3(Random.Range(0f, 360f), Random.Range(0f, 360f), Random.Range(0f, 360f));
		((Vector3)(ref dir)).Scale(rotation);
		((Component)this).transform.localEulerAngles = dir;
	}

	private void Update()
	{
		//IL_0008: 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_001d: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.Translate(axis * speed * Time.deltaTime, (Space)1);
	}
}
public class WFX_Demo : MonoBehaviour
{
	public float cameraSpeed = 10f;

	public bool orderedSpawns = true;

	public float step = 1f;

	public float range = 5f;

	private float order = -5f;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject[] ParticleExamples;

	private int exampleIndex;

	private string randomSpawnsDelay = "0.5";

	private bool randomSpawns;

	private bool slowMo;

	private bool rotateCam = true;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	public GameObject m4;

	public GameObject m4fps;

	private bool rotate_m4 = true;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = spawnParticle();
			if (!((Object)val2).name.StartsWith("WFX_MF"))
			{
				val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
			}
		}
	}

	public GameObject spawnParticle()
	{
		//IL_0064: 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)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		SetActiveCrossVersions(val, active: true);
		return val;
	}

	private void SetActiveCrossVersions(GameObject obj, bool active)
	{
		obj.SetActive(active);
		for (int i = 0; i < obj.transform.childCount; i++)
		{
			((Component)obj.transform.GetChild(i)).gameObject.SetActive(active);
		}
	}

	private void OnGUI()
	{
		//IL_0019: 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_02ef: 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_0321: 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_033a: Unknown result type (might be due to invalid IL or missing references)
		//IL_033f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(5f, 20f, (float)(Screen.width - 10), 60f));
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Effect: " + ((Object)ParticleExamples[exampleIndex]).name, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(280f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevParticle();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextParticle();
		}
		GUILayout.FlexibleSpace();
		GUILayout.Label("Click on the ground to spawn the selected effect", (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.FlexibleSpace();
		if (GUILayout.Button((!rotateCam) ? "Rotate Camera" : "Pause Camera", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }))
		{
			rotateCam = !rotateCam;
		}
		if (GUILayout.Button((!((Component)this).GetComponent<Renderer>().enabled) ? "Show Ground" : "Hide Ground", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) }))
		{
			((Component)this).GetComponent<Renderer>().enabled = !((Component)this).GetComponent<Renderer>().enabled;
		}
		if (GUILayout.Button((!slowMo) ? "Slow Motion" : "Normal Speed", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }))
		{
			slowMo = !slowMo;
			if (slowMo)
			{
				Time.timeScale = 0.33f;
			}
			else
			{
				Time.timeScale = 1f;
			}
		}
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label("Ground texture: " + groundTextureStr, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
		if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			prevTexture();
		}
		if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }))
		{
			nextTexture();
		}
		GUILayout.EndHorizontal();
		GUILayout.EndArea();
		if (!m4.GetComponent<Renderer>().enabled)
		{
			return;
		}
		GUILayout.BeginArea(new Rect(5f, (float)(Screen.height - 100), (float)(Screen.width - 10), 90f));
		rotate_m4 = GUILayout.Toggle(rotate_m4, "AutoRotate Weapon", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(250f) });
		GUI.enabled = !rotate_m4;
		float x = m4.transform.localEulerAngles.x;
		x = ((!(x > 90f)) ? x : (x - 180f));
		float y = m4.transform.localEulerAngles.y;
		float z = m4.transform.localEulerAngles.z;
		x = GUILayout.HorizontalSlider(x, 0f, 179f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		y = GUILayout.HorizontalSlider(y, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		z = GUILayout.HorizontalSlider(z, 0f, 359f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(256f) });
		if (GUI.changed)
		{
			if (x > 90f)
			{
				x += 180f;
			}
			m4.transform.localEulerAngles = new Vector3(x, y, z);
			Debug.Log((object)x);
		}
		GUILayout.EndArea();
	}

	private IEnumerator RandomSpawnsCoroutine()
	{
		while (true)
		{
			GameObject particles = spawnParticle();
			if (orderedSpawns)
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(order, particles.transform.position.y, 0f);
				order -= step;
				if (order < 0f - range)
				{
					order = range;
				}
			}
			else
			{
				particles.transform.position = ((Component)this).transform.position + new Vector3(Random.Range(0f - range, range), 0f, Random.Range(0f - range, range)) + new Vector3(0f, particles.transform.position.y, 0f);
			}
			yield return (object)new WaitForSeconds(float.Parse(randomSpawnsDelay));
		}
	}

	private void Update()
	{
		//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_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		if (rotateCam)
		{
			((Component)Camera.main).transform.RotateAround(Vector3.zero, Vector3.up, cameraSpeed * Time.deltaTime);
		}
		if (rotate_m4)
		{
			m4.transform.Rotate(new Vector3(0f, 40f, 0f) * Time.deltaTime, (Space)0);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			((Component)this).GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			((Component)this).GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			((Component)this).GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			((Component)this).GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		showHideStuff();
	}

	private void showHideStuff()
	{
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			SetActiveCrossVersions(walls, active: true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			SetActiveCrossVersions(walls, active: false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_DeleteAfterDelay : MonoBehaviour
{
	public float delay = 1f;

	private void Update()
	{
		delay -= Time.deltaTime;
		if (delay < 0f)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
public class WFX_Demo_New : MonoBehaviour
{
	public Renderer groundRenderer;

	public Collider groundCollider;

	[Space]
	[Space]
	public Image slowMoBtn;

	public Text slowMoLabel;

	public Image camRotBtn;

	public Text camRotLabel;

	public Image groundBtn;

	public Text groundLabel;

	[Space]
	public Text EffectLabel;

	public Text EffectIndexLabel;

	public GameObject[] AdditionalEffects;

	public GameObject ground;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject m4;

	public GameObject m4fps;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

	private List<string> groundTextures = new List<string>(new string[4] { "Concrete", "Wood", "Metal", "Checker" });

	private GameObject[] ParticleExamples;

	private int exampleIndex;

	private bool slowMo;

	private Vector3 defaultCamPosition;

	private Quaternion defaultCamRotation;

	private List<GameObject> onScreenParticles = new List<GameObject>();

	private void Awake()
	{
		//IL_0063: 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_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)
		List<GameObject> list = new List<GameObject>();
		int childCount = ((Component)this).transform.childCount;
		for (int i = 0; i < childCount; i++)
		{
			GameObject gameObject = ((Component)((Component)this).transform.GetChild(i)).gameObject;
			list.Add(gameObject);
		}
		list.AddRange(AdditionalEffects);
		ParticleExamples = list.ToArray();
		defaultCamPosition = ((Component)Camera.main).transform.position;
		defaultCamRotation = ((Component)Camera.main).transform.rotation;
		((MonoBehaviour)this).StartCoroutine("CheckForDeletedParticles");
		UpdateUI();
	}

	private void Update()
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)276))
		{
			prevParticle();
		}
		else if (Input.GetKeyDown((KeyCode)275))
		{
			nextParticle();
		}
		else if (Input.GetKeyDown((KeyCode)127))
		{
			destroyParticles();
		}
		if (Input.GetMouseButtonDown(0))
		{
			RaycastHit val = default(RaycastHit);
			if (groundCollider.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
			{
				GameObject val2 = spawnParticle();
				if (!((Object)val2).name.StartsWith("WFX_MF"))
				{
					val2.transform.position = ((RaycastHit)(ref val)).point + val2.transform.position;
				}
			}
		}
		float axis = Input.GetAxis("Mouse ScrollWheel");
		if (axis != 0f)
		{
			((Component)Camera.main).transform.Translate(Vector3.forward * ((!(axis < 0f)) ? 1f : (-1f)), (Space)1);
		}
		if (Input.GetMouseButtonDown(2))
		{
			((Component)Camera.main).transform.position = defaultCamPosition;
			((Component)Camera.main).transform.rotation = defaultCamRotation;
		}
	}

	public void OnToggleGround()
	{
		//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_004c: 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)
		Color white = Color.white;
		groundRenderer.enabled = !groundRenderer.enabled;
		white.a = ((!groundRenderer.enabled) ? 0.33f : 1f);
		((Graphic)groundBtn).color = white;
		((Graphic)groundLabel).color = white;
	}

	public void OnToggleCamera()
	{
		//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_003a: 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)
		Color white = Color.white;
		CFX_Demo_RotateCamera.rotating = !CFX_Demo_RotateCamera.rotating;
		white.a = ((!CFX_Demo_RotateCamera.rotating) ? 0.33f : 1f);
		((Graphic)camRotBtn).color = white;
		((Graphic)camRotLabel).color = white;
	}

	public void OnToggleSlowMo()
	{
		//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_005c: 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)
		Color white = Color.white;
		slowMo = !slowMo;
		if (slowMo)
		{
			Time.timeScale = 0.33f;
			white.a = 1f;
		}
		else
		{
			Time.timeScale = 1f;
			white.a = 0.33f;
		}
		((Graphic)slowMoBtn).color = white;
		((Graphic)slowMoLabel).color = white;
	}

	public void OnPreviousEffect()
	{
		prevParticle();
	}

	public void OnNextEffect()
	{
		nextParticle();
	}

	private void UpdateUI()
	{
		EffectLabel.text = ((Object)ParticleExamples[exampleIndex]).name;
		EffectIndexLabel.text = string.Format("{0}/{1}", (exampleIndex + 1).ToString("00"), ParticleExamples.Length.ToString("00"));
	}

	public GameObject spawnParticle()
	{
		//IL_0025: 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_0037: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: 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)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		val.transform.position = new Vector3(0f, val.transform.position.y, 0f);
		val.SetActive(true);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		ParticleSystem component = val.GetComponent<ParticleSystem>();
		if ((Object)(object)component != (Object)null)
		{
			MainModule main = component.main;
			if (((MainModule)(ref main)).loop)
			{
				((Component)component).gameObject.AddComponent<CFX_AutoStopLoopedEffect>();
				((Component)component).gameObject.AddComponent<CFX_AutoDestructShuriken>();
			}
		}
		onScreenParticles.Add(val);
		return val;
	}

	private IEnumerator CheckForDeletedParticles()
	{
		while (true)
		{
			yield return (object)new WaitForSeconds(5f);
			for (int num = onScreenParticles.Count - 1; num >= 0; num--)
			{
				if ((Object)(object)onScreenParticles[num] == (Object)null)
				{
					onScreenParticles.RemoveAt(num);
				}
			}
		}
	}

	private void prevParticle()
	{
		exampleIndex--;
		if (exampleIndex < 0)
		{
			exampleIndex = ParticleExamples.Length - 1;
		}
		UpdateUI();
		showHideStuff();
	}

	private void nextParticle()
	{
		exampleIndex++;
		if (exampleIndex >= ParticleExamples.Length)
		{
			exampleIndex = 0;
		}
		UpdateUI();
		showHideStuff();
	}

	private void destroyParticles()
	{
		for (int num = onScreenParticles.Count - 1; num >= 0; num--)
		{
			if ((Object)(object)onScreenParticles[num] != (Object)null)
			{
				Object.Destroy((Object)(object)onScreenParticles[num]);
			}
			onScreenParticles.RemoveAt(num);
		}
	}

	private void prevTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num--;
		if (num < 0)
		{
			num = groundTextures.Count - 1;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void nextTexture()
	{
		int num = groundTextures.IndexOf(groundTextureStr);
		num++;
		if (num >= groundTextures.Count)
		{
			num = 0;
		}
		groundTextureStr = groundTextures[num];
		selectMaterial();
	}

	private void selectMaterial()
	{
		switch (groundTextureStr)
		{
		case "Concrete":
			ground.GetComponent<Renderer>().material = concrete;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = concreteWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = concreteWall;
			break;
		case "Wood":
			ground.GetComponent<Renderer>().material = wood;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = woodWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = woodWall;
			break;
		case "Metal":
			ground.GetComponent<Renderer>().material = metal;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = metalWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = metalWall;
			break;
		case "Checker":
			ground.GetComponent<Renderer>().material = checker;
			((Component)walls.transform.GetChild(0)).GetComponent<Renderer>().material = checkerWall;
			((Component)walls.transform.GetChild(1)).GetComponent<Renderer>().material = checkerWall;
			break;
		}
	}

	private void showHideStuff()
	{
		//IL_004d: 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)
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF Spr"))
		{
			m4.GetComponent<Renderer>().enabled = true;
			((Component)Camera.main).transform.position = new Vector3(-2.482457f, 3.263842f, -0.004924395f);
			((Component)Camera.main).transform.eulerAngles = new Vector3(20f, 90f, 0f);
		}
		else
		{
			m4.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_MF FPS"))
		{
			m4fps.GetComponent<Renderer>().enabled = true;
		}
		else
		{
			m4fps.GetComponent<Renderer>().enabled = false;
		}
		if (((Object)ParticleExamples[exampleIndex]).name.StartsWith("WFX_BImpact"))
		{
			walls.SetActive(true);
			Renderer[] componentsInChildren = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				val.enabled = true;
			}
		}
		else
		{
			walls.SetActive(false);
			Renderer[] componentsInChildren2 = bulletholes.GetComponentsInChildren<Renderer>();
			Renderer[] array2 = componentsInChildren2;
			foreach (Renderer val2 in array2)
			{
				val2.enabled = false;
			}
		}
		if (((Object)ParticleExamples[exampleIndex]).name.Contains("Wood"))
		{
			groundTextureStr = "Wood";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Concrete"))
		{
			groundTextureStr = "Concrete";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Metal"))
		{
			groundTextureStr = "Metal";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name.Contains("Dirt") || ((Object)ParticleExamples[exampleIndex]).name.Contains("Sand") || ((Object)ParticleExamples[exampleIndex]).name.Contains("SoftBody"))
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
		else if (((Object)ParticleExamples[exampleIndex]).name == "WFX_Explosion")
		{
			groundTextureStr = "Checker";
			selectMaterial();
		}
	}
}
public class WFX_Demo_RandomDir : MonoBehaviour
{
	public Vector3 min = new Vector3(0f, 0f, 0f);

	public Vector3 max = new Vector3(0f, 360f, 0f);

	private void Awake()
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.eulerAngles = new Vector3(Random.Range(min.x, max.x), Random.Range(min.y, max.y), Random.Range(min.z, max.z));
	}
}
public class WFX_Demo_Wall : MonoBehaviour
{
	public WFX_Demo_New demo;

	private void OnMouseDown()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		RaycastHit val = default(RaycastHit);
		if (((Component)this).GetComponent<Collider>().Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), ref val, 9999f))
		{
			GameObject val2 = demo.spawnParticle();
			val2.transform.position = ((RaycastHit)(ref val)).point;
			val2.transform.rotation = Quaternion.FromToRotation(Vector3.forward, ((RaycastHit)(ref val)).normal);
		}
	}
}
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoDestructShuriken : MonoBehaviour
{
	public bool OnlyDeactivate;

	private void OnEnable()
	{
		((MonoBehaviour)this).StartCoroutine("CheckIfAlive");
	}

	private IEnumerator CheckIfAlive()
	{
		do
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		while (((Component)this).GetComponent<ParticleSystem>().IsAlive(true));
		if (OnlyDeactivate)
		{
			((Component)this).gameObject.SetActive(false);
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(Light))]
public class CFX_LightIntensityFade : MonoBehaviour
{
	public float duration = 1f;

	public float delay = 0f;

	public float finalIntensity = 0f;

	private float baseIntensity;

	public bool autodestruct;

	private float p_lifetime = 0f;

	private float p_delay;

	private void Start()
	{
		baseIntensity = ((Component)this).GetComponent<Light>().intensity;
	}

	private void OnEnable()
	{
		p_lifetime = 0f;
		p_delay = delay;
		if (delay > 0f)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = false;
		}
	}

	private void Update()
	{
		if (p_delay > 0f)
		{
			p_delay -= Time.deltaTime;
			if (p_delay <= 0f)
			{
				((Behaviour)((Component)this).GetComponent<Light>()).enabled = true;
			}
		}
		else if (p_lifetime / duration < 1f)
		{
			((Component)this).GetComponent<Light>().intensity = Mathf.Lerp(baseIntensity, finalIntensity, p_lifetime / duration);
			p_lifetime += Time.deltaTime;
		}
		else if (autodestruct)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
[RequireComponent(typeof(MeshFilter))]
public class WFX_BulletHoleDecal : MonoBehaviour
{
	private static Vector2[] quadUVs = (Vector2[])(object)new Vector2[4]
	{
		new Vector2(0f, 0f),
		new Vector2(0f, 1f),
		new Vector2(1f, 0f),
		new Vector2(1f, 1f)
	};

	public float lifetime = 10f;

	public float fadeoutpercent = 80f;

	public Vector2 frames;

	public bool randomRotation = false;

	public bool deactivate = false;

	private float life;

	private float fadeout;

	private Color color;

	private float orgAlpha;

	private void Awake()
	{
		//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)
		color = ((Component)this).GetComponent<Renderer>().material.GetColor("_TintColor");
		orgAlpha = color.a;
	}

	private void OnEnable()
	{
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		int num = Random.Range(0, (int)(frames.x * frames.y));
		int num2 = (int)((float)num % frames.x);
		int num3 = (int)((float)num / frames.y);
		Vector2[] array = (Vector2[])(object)new Vector2[4];
		for (int i = 0; i < 4; i++)
		{
			array[i].x = (quadUVs[i].x + (float)num2) * (1f / frames.x);
			array[i].y = (quadUVs[i].y + (float)num3) * (1f / frames.y);
		}
		((Component)this).GetComponent<MeshFilter>().mesh.uv = array;
		if (randomRotation)
		{
			((Component)this).transform.Rotate(0f, 0f, Random.Range(0f, 360f), (Space)1);
		}
		life = lifetime;
		fadeout = life * (fadeoutpercent / 100f);
		color.a = orgAlpha;
		((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine("holeUpdate");
	}

	private IEnumerator holeUpdate()
	{
		while (life > 0f)
		{
			life -= Time.deltaTime;
			if (life <= fadeout)
			{
				color.a = Mathf.Lerp(0f, orgAlpha, life / fadeout);
				((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", color);
			}
			yield return null;
		}
	}
}
[RequireComponent(typeof(Light))]
public class WFX_LightFlicker : MonoBehaviour
{
	public float time = 0.05f;

	private float timer;

	private void Start()
	{
		timer = time;
		((MonoBehaviour)this).StartCoroutine("Flicker");
	}

	private IEnumerator Flicker()
	{
		while (true)
		{
			((Behaviour)((Component)this).GetComponent<Light>()).enabled = !((Behaviour)((Component)this).GetComponent<Light>()).enabled;
			do
			{
				timer -= Time.deltaTime;
				yield return null;
			}
			while (timer > 0f);
			timer = time;
		}
	}
}
public class CFX_SpawnSystem : MonoBehaviour
{
	private static CFX_SpawnSystem instance;

	public GameObject[] objectsToPreload = (GameObject[])(object)new GameObject[0];

	public int[] objectsToPreloadTimes = new int[0];

	public bool hideObjectsInHierarchy = false;

	public bool spawnAsChildren = true;

	public bool onlyGetInactiveObjects = false;

	public bool instantiateIfNeeded = false;

	private bool allObjectsLoaded;

	private Dictionary<int, List<GameObject>> instantiatedObjects = new Dictionary<int, List<GameObject>>();

	private Dictionary<int, int> poolCursors = new Dictionary<int, int>();

	public static bool AllObjectsLoaded => instance.allObjectsLoaded;

	public static GameObject GetNextObject(GameObject sourceObj, bool activateObject = true)
	{
		int instanceID = ((Object)sourceObj).GetInstanceID();
		if (!instance.poolCursors.ContainsKey(instanceID))
		{
			Debug.LogError((object)("[CFX_SpawnSystem.GetNextObject()] Object hasn't been preloaded: " + ((Object)sourceObj).name + " (ID:" + instanceID + ")\n"), (Object)(object)instance);
			return null;
		}
		int num = instance.poolCursors[instanceID];
		GameObject val = null;
		if (instance.onlyGetInactiveObjects)
		{
			int num2 = num;
			while (true)
			{
				val = instance.instantiatedObjects[instanceID][num];
				instance.increasePoolCursor(instanceID);
				num = instance.poolCursors[instanceID];
				if ((Object)(object)val != (Object)null && !val.activeSelf)
				{
					break;
				}
				if (num == num2)
				{
					if (instance.instantiateIfNeeded)
					{
						Debug.Log((object)("[CFX_SpawnSystem.GetNextObject()] A new instance has been created for \"" + ((Object)sourceObj).name + "\" because no active instance were found in the pool.\n"), (Object)(object)instance);
						PreloadObject(sourceObj);
						List<GameObject> list = instance.instantiatedObjects[instanceID];
						val = list[list.Count - 1];
						break;
					}
					Debug.LogWarning((object)("[CFX_SpawnSystem.GetNextObject()] There are no active instances available in the pool for \"" + ((Object)sourceObj).name + "\"\nYou may need to increase the preloaded object count for this prefab?"), (Object)(object)instance);
					return null;
				}
			}
		}
		else
		{
			val = instance.instantiatedObjects[instanceID][num];
			instance.increasePoolCursor(instanceID);
		}
		if (activateObject && (Object)(object)val != (Object)null)
		{
			val.SetActive(true);
		}
		return val;
	}

	public static void PreloadObject(GameObject sourceObj, int poolSize = 1)
	{
		instance.addObjectToPool(sourceObj, poolSize);
	}

	public static void UnloadObjects(GameObject sourceObj)
	{
		instance.removeObjectsFromPool(sourceObj);
	}

	private void addObjectToPool(GameObject sourceObject, int number)
	{
		int instanceID = ((Object)sourceObject).GetInstanceID();
		if (!instantiatedObjects.ContainsKey(instanceID))
		{
			instantiatedObjects.Add(instanceID, new List<GameObject>());
			poolCursors.Add(instanceID, 0);
		}
		for (int i = 0; i < number; i++)
		{
			GameObject val = Object.Instantiate<GameObject>(sourceObject);
			val.SetActive(false);
			CFX_AutoDestructShuriken[] componentsInChildren = val.GetComponentsInChildren<CFX_AutoDestructShuriken>(true);
			CFX_AutoDestructShuriken[] array = componentsInChildren;
			foreach (CFX_AutoDestructShuriken cFX_AutoDestructShuriken in array)
			{
				cFX_AutoDestructShuriken.OnlyDeactivate = true;
			}
			CFX_LightIntensityFade[] componentsInChildren2 = val.GetComponentsInChildren<CFX_LightIntensityFade>(true);
			CFX_LightIntensityFade[] array2 = componentsInChildren2;
			foreach (CFX_LightIntensityFade cFX_LightIntensityFade in array2)
			{
				cFX_LightIntensityFade.autodestruct = false;
			}
			instantiatedObjects[instanceID].Add(val);
			if (hideObjectsInHierarchy)
			{
				((Object)val).hideFlags = (HideFlags)1;
			}
			if (spawnAsChildren)
			{
				val.transform.parent = ((Component)this).transform;
			}
		}
	}

	private void removeObjectsFromPool(GameObject sourceObject)
	{
		int instanceID = ((Object)sourceObject).GetInstanceID();
		if (!instantiatedObjects.ContainsKey(instanceID))
		{
			Debug.LogWarning((object)("[CFX_SpawnSystem.removeObjectsFromPool()] There aren't any preloaded object for: " + ((Object)sourceObject).name + " (ID:" + instanceID + ")\n"), (Object)(object)((Component)this).gameObject);
			return;
		}
		for (int num = instantiatedObjects[instanceID].Count - 1; num >= 0; num--)
		{
			GameObject val = instantiatedObjects[instanceID][num];
			instantiatedObjects[instanceID].RemoveAt(num);
			Object.Destroy((Object)(object)val);
		}
		instantiatedObjects.Remove(instanceID);
		poolCursors.Remove(instanceID);
	}

	private void increasePoolCursor(int uniqueId)
	{
		instance.poolCursors[uniqueId]++;
		if (instance.poolCursors[uniqueId] >= instance.instantiatedObjects[uniqueId].Count)
		{
			instance.poolCursors[uniqueId] = 0;
		}
	}

	private void Awake()
	{
		if ((Object)(object)instance != (Object)null)
		{
			Debug.LogWarning((object)"CFX_SpawnSystem: There should only be one instance of CFX_SpawnSystem per Scene!\n", (Object)(object)((Component)this).gameObject);
		}
		instance = this;
	}

	private void Start()
	{
		allObjectsLoaded = false;
		for (int i = 0; i < objectsToPreload.Length; i++)
		{
			PreloadObject(objectsToPreload[i], objectsToPreloadTimes[i]);
		}
		allObjectsLoaded = true;
	}
}
namespace Billiam_J_McGoonigan.Antique_Grenades_MODMAS;

[BepInPlugin("Billiam_J_McGoonigan.Antique_Grenades_MODMAS", "Antique_Grenades_MODMAS", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
public class Antique_Grenades_MODMASPlugin : 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(), "Billiam_J_McGoonigan.Antique_Grenades_MODMAS");
		OtherLoader.RegisterDirectLoad(BasePath, "Billiam_J_McGoonigan.Antique_Grenades_MODMAS", "", "", "modmasitem34", "");
	}
}
public enum ControlMode
{
	simple = 1,
	touch
}
public class VehicleControl : MonoBehaviour
{
	[Serializable]
	public class CarWheels
	{
		public ConnectWheel wheels;
	}

	[Serializable]
	public class ConnectWheel
	{
		public bool frontWheelDrive = true;

		public Transform frontRight;

		public Transform frontLeft;

		public WheelSetting frontSetting;

		public bool backWheelDrive = true;

		public Transform backRight;

		public Transform backLeft;

		public WheelSetting rearSetting;
	}

	[Serializable]
	public class WheelSetting
	{
		public float Radius = 0.4f;

		public float Weight = 1000f;

		public float Distance = 0.2f;
	}

	[Serializable]
	public class CarLights
	{
		public Light[] brakeLights;

		public Light[] reverseLights;
	}

	[Serializable]
	public class CarSounds
	{
		public AudioSource IdleEngine;

		public AudioSource LowEngine;

		public AudioSource HighEngine;

		public float minPitch = 1f;

		public float maxPitch = 10f;

		public AudioSource nitro;

		public AudioSource switchGear;
	}

	[Serializable]
	public class CarParticles
	{
		public GameObject brakeParticlePerfab;

		public ParticleSystem shiftParticle1;

		public ParticleSystem shiftParticle2;

		private GameObject[] wheelParticle = (GameObject[])(object)new GameObject[4];
	}

	[Serializable]
	public class CarSetting
	{
		public bool showNormalGizmos = false;

		public Transform carSteer;

		public HitGround[] hitGround;

		public List<Transform> cameraSwitchView;

		public float springs = 25000f;

		public float dampers = 1500f;

		public float carPower = 120f;

		public float shiftPower = 150f;

		public float brakePower = 8000f;

		public Vector3 shiftCentre = new Vector3(0f, -0.8f, 0f);

		public float maxSteerAngle = 25f;

		public float shiftDownRPM = 1500f;

		public float shiftUpRPM = 2500f;

		public float idleRPM = 500f;

		public float stiffness = 2f;

		public bool automaticGear = true;

		public float[] gears = new float[6] { -10f, 9f, 6f, 4.5f, 3f, 2.5f };

		public float LimitBackwardSpeed = 60f;

		public float LimitForwardSpeed = 220f;
	}

	[Serializable]
	public class HitGround
	{
		public string tag = "street";

		public bool grounded = false;

		public AudioClip brakeSound;

		public AudioClip groundSound;

		public Color brakeColor;
	}

	private class WheelComponent
	{
		public Transform wheel;

		public WheelCollider collider;

		public Vector3 startPos;

		public float rotation = 0f;

		public float rotation2 = 0f;

		public float maxSteer;

		public bool drive;

		public float pos_y = 0f;

		public WheelSetting settings;
	}

	public ControlMode controlMode = ControlMode.simple;

	public bool activeControl = false;

	public CarWheels carWheels;

	public CarLights carLights;

	public CarSounds carSounds;

	public CarParticles carParticles;

	public CarSetting carSetting;

	[HideInInspector]
	public float steer = 0f;

	[HideInInspector]
	public float accel = 0f;

	[HideInInspector]
	public bool brake;

	private bool shifmotor;

	[HideInInspector]
	public float curTorque = 100f;

	[HideInInspector]
	public float powerShift = 100f;

	[HideInInspector]
	public bool shift;

	private float torque = 100f;

	[HideInInspector]
	public float speed = 0f;

	private float lastSpeed = -10f;

	private bool shifting = false;

	private float[] efficiencyTable = new float[22]
	{
		0.6f, 0.65f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 1f, 1f, 0.95f,
		0.8f, 0.7f, 0.6f, 0.5f, 0.45f, 0.4f, 0.36f, 0.33f, 0.3f, 0.2f,
		0.1f, 0.05f
	};

	private float efficiencyTableStep = 250f;

	private float Pitch;

	private float PitchDelay;

	private float shiftTime = 0f;

	private float shiftDelay = 0f;

	[HideInInspector]
	public int currentGear = 0;

	[HideInInspector]
	public bool NeutralGear = true;

	[HideInInspector]
	public float motorRPM = 0f;

	[HideInInspector]
	public bool Backward = false;

	[HideInInspector]
	public float accelFwd = 0f;

	[HideInInspector]
	public float accelBack = 0f;

	[HideInInspector]
	public float steerAmount = 0f;

	private float wantedRPM = 0f;

	private float w_rotate;

	private float slip;

	private float slip2 = 0f;

	private GameObject[] Particle = (GameObject[])(object)new GameObject[4];

	private Vector3 steerCurAngle;

	private Rigidbody myRigidbody;

	private WheelComponent[] wheels;

	public bool isOn = true;

	public bool isForciblyOff = false;

	private WheelComponent SetWheelComponent(Transform wheel, float maxSteer, bool drive, float pos_y, WheelSetting setting)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		//IL_0035: 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_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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		WheelComponent wheelComponent = new WheelComponent();
		GameObject val = new GameObject(((Object)wheel).name + "WheelCollider");
		val.transform.parent = ((Component)this).transform;
		val.transform.position = wheel.position;
		val.transform.eulerAngles = ((Component)this).transform.eulerAngles;
		pos_y = val.transform.localPosition.y;
		WheelCollider val2 = (WheelCollider)val.AddComponent(typeof(WheelCollider));
		wheelComponent.wheel = wheel;
		wheelComponent.collider = val.GetComponent<WheelCollider>();
		wheelComponent.drive = drive;
		wheelComponent.pos_y = pos_y;
		wheelComponent.maxSteer = maxSteer;
		wheelComponent.startPos = val.transform.localPosition;
		wheelComponent.settings = setting;
		return wheelComponent;
	}

	private void Awake()
	{
		//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_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_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_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_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: 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_0228: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		if (carSetting.automaticGear)
		{
			NeutralGear = false;
		}
		myRigidbody = ((Component)((Component)this).transform).GetComponent<Rigidbody>();
		wheels = new WheelComponent[4];
		wheels[0] = SetWheelComponent(carWheels.wheels.frontRight, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontRight.position.y, carWheels.wheels.frontSetting);
		wheels[1] = SetWheelComponent(carWheels.wheels.frontLeft, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontLeft.position.y, carWheels.wheels.frontSetting);
		wheels[2] = SetWheelComponent(carWheels.wheels.backRight, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backRight.position.y, carWheels.wheels.rearSetting);
		wheels[3] = SetWheelComponent(carWheels.wheels.backLeft, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backLeft.position.y, carWheels.wheels.rearSetting);
		if (Object.op_Implicit((Object)(object)carSetting.carSteer))
		{
			steerCurAngle = carSetting.carSteer.localEulerAngles;
		}
		WheelComponent[] array = wheels;
		foreach (WheelComponent wheelComponent in array)
		{
			WheelCollider collider = wheelComponent.collider;
			collider.suspensionDistance = wheelComponent.settings.Distance;
			JointSpring suspensionSpring = collider.suspensionSpring;
			suspensionSpring.spring = carSetting.springs;
			suspensionSpring.damper = carSetting.dampers;
			collider.suspensionSpring = suspensionSpring;
			collider.radius = wheelComponent.settings.Radius;
			collider.mass = wheelComponent.settings.Weight;
			WheelFrictionCurve val = collider.forwardFriction;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 5000f;
			((WheelFrictionCurve)(ref val)).extremumSlip = 2f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 20f;
			((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness;
			collider.forwardFriction = val;
			val = collider.sidewaysFriction;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 7500f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 2f;
			((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness;
			collider.sidewaysFriction = val;
		}
	}

	public void TurnOnEngine(bool forcibly)
	{
		if (!isForciblyOff)
		{
			isOn = true;
		}
		else if (forcibly)
		{
			isForciblyOff = false;
			isOn = true;
		}
	}

	public void TurnOffEngine(bool forcibly)
	{
		isForciblyOff = forcibly;
		isOn = false;
	}

	public void ShiftTo(int newGear)
	{
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		currentGear = newGear;
		if (currentGear == 0)
		{
			NeutralGear = true;
		}
		else
		{
			NeutralGear = false;
		}
		if (currentGear == -1)
		{
			currentGear = 0;
		}
	}

	public void ShiftUp(bool ignoreDelay)
	{
		float timeSinceLevelLoad = Time.timeSinceLevelLoad;
		if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || currentGear >= carSetting.gears.Length - 1)
		{
			return;
		}
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		if (!carSetting.automaticGear)
		{
			if (currentGear == 0)
			{
				if (NeutralGear)
				{
					currentGear++;
					NeutralGear = false;
				}
				else
				{
					NeutralGear = true;
				}
			}
			else
			{
				currentGear++;
			}
		}
		else
		{
			currentGear++;
		}
		shiftDelay = timeSinceLevelLoad + 1f;
		shiftTime = 1.5f;
	}

	public void ShiftDown(bool ignoreDelay)
	{
		float timeSinceLevelLoad = Time.timeSinceLevelLoad;
		if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || (currentGear <= 0 && !NeutralGear))
		{
			return;
		}
		((Component)carSounds.switchGear).GetComponent<AudioSource>().Play();
		if (!carSetting.automaticGear)
		{
			if (currentGear == 1)
			{
				if (!NeutralGear)
				{
					currentGear--;
					NeutralGear = true;
				}
			}
			else if (currentGear == 0)
			{
				NeutralGear = false;
			}
			else
			{
				currentGear--;
			}
		}
		else
		{
			currentGear--;
		}
		shiftDelay = timeSinceLevelLoad + 0.1f;
		shiftTime = 2f;
	}

	private void OnCollisionEnter(Collision collision)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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_0092: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: 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)((Component)collision.transform.root).GetComponent<VehicleControl>()))
		{
			VehicleControl component = ((Component)collision.transform.root).GetComponent<VehicleControl>();
			Vector3 relativeVelocity = collision.relativeVelocity;
			component.slip2 = Mathf.Clamp(((Vector3)(ref relativeVelocity)).magnitude, 0f, 10f);
			myRigidbody.angularVelocity = new Vector3((0f - myRigidbody.angularVelocity.x) * 0.5f, myRigidbody.angularVelocity.y * 0.5f, (0f - myRigidbody.angularVelocity.z) * 0.5f);
			myRigidbody.velocity = new Vector3(myRigidbody.velocity.x, myRigidbody.velocity.y * 0.5f, myRigidbody.velocity.z);
		}
	}

	private void OnCollisionStay(Collision collision)
	{
		if (Object.op_Implicit((Object)(object)((Component)collision.transform.root).GetComponent<VehicleControl>()))
		{
			((Component)collision.transform.root).GetComponent<VehicleControl>().slip2 = 5f;
		}
	}

	private void Update()
	{
	}

	private void FixedUpdate()
	{
		//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_00b6: 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_0704: Unknown result type (might be due to invalid IL or missing references)
		//IL_0709: Unknown result type (might be due to invalid IL or missing references)
		//IL_0751: Unknown result type (might be due to invalid IL or missing references)
		//IL_075a: Unknown result type (might be due to invalid IL or missing references)
		//IL_075f: Unknown result type (might be due to invalid IL or missing references)
		//IL_079b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0acf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ee6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ef2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f0c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f17: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f25: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b3b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d23: Unknown result type (might be due to invalid IL or missing references)
		if (!isOn)
		{
			accel = 0f;
		}
		Vector3 velocity = myRigidbody.velocity;
		speed = ((Vector3)(ref velocity)).magnitude * 2.7f;
		if (speed < lastSpeed - 10f && slip < 10f)
		{
			slip = lastSpeed / 15f;
		}
		lastSpeed = speed;
		if (slip2 != 0f)
		{
			slip2 = Mathf.MoveTowards(slip2, 0f, 0.1f);
		}
		myRigidbody.centerOfMass = carSetting.shiftCentre;
		if (!carWheels.wheels.frontWheelDrive && !carWheels.wheels.backWheelDrive)
		{
			accel = 0f;
		}
		if (Object.op_Implicit((Object)(object)carSetting.carSteer))
		{
			carSetting.carSteer.localEulerAngles = new Vector3(steerCurAngle.x, steerCurAngle.y, steerCurAngle.z + steer * -120f);
		}
		if (carSetting.automaticGear && currentGear == 1 && accel < 0f)
		{
			if (speed < 5f)
			{
				ShiftDown(ignoreDelay: false);
			}
		}
		else if (carSetting.automaticGear && currentGear == 0 && accel > 0f)
		{
			if (speed < 5f)
			{
				ShiftUp(ignoreDelay: false);
			}
		}
		else if (carSetting.automaticGear && motorRPM > carSetting.shiftUpRPM && accel > 0f && speed > 10f && !brake)
		{
			ShiftUp(ignoreDelay: false);
		}
		else if (carSetting.automaticGear && motorRPM < carSetting.shiftDownRPM && currentGear > 1)
		{
			ShiftDown(ignoreDelay: false);
		}
		if (speed < 1f)
		{
			Backward = true;
		}
		if (currentGear != 0 || !Backward)
		{
			Backward = false;
		}
		Light[] brakeLights = carLights.brakeLights;
		foreach (Light val in brakeLights)
		{
			if (brake || accel < 0f || speed < 1f)
			{
				val.intensity = Mathf.MoveTowards(val.intensity, 8f, 0.5f);
			}
			else
			{
				val.intensity = Mathf.MoveTowards(val.intensity, 0f, 0.5f);
			}
			((Behaviour)val).enabled = val.intensity != 0f;
		}
		Light[] reverseLights = carLights.reverseLights;
		foreach (Light val2 in reverseLights)
		{
			if (speed > 2f && currentGear == 0)
			{
				val2.intensity = Mathf.MoveTowards(val2.intensity, 8f, 0.5f);
			}
			else
			{
				val2.intensity = Mathf.MoveTowards(val2.intensity, 0f, 0.5f);
			}
			((Behaviour)val2).enabled = val2.intensity != 0f;
		}
		wantedRPM = 5500f * accel * 0.1f + wantedRPM * 0.9f;
		float num = 0f;
		int num2 = 0;
		bool flag = false;
		int num3 = 0;
		WheelComponent[] array = wheels;
		WheelHit val4 = default(WheelHit);
		foreach (WheelComponent wheelComponent in array)
		{
			WheelCollider collider = wheelComponent.collider;
			if (wheelComponent.drive)
			{
				num = ((!NeutralGear && brake && currentGear < 2) ? (num + accel * carSetting.idleRPM) : (NeutralGear ? (num + carSetting.idleRPM * accel) : (num + collider.rpm)));
				num2++;
			}
			if (brake || accel < 0f)
			{
				if (accel < 0f || (brake && (wheelComponent == wheels[2] || wheelComponent == wheels[3])))
				{
					if (brake && accel > 0f)
					{
						slip = Mathf.Lerp(slip, 5f, accel * 0.01f);
					}
					else if (speed > 1f)
					{
						slip = Mathf.Lerp(slip, 1f, 0.002f);
					}
					else
					{
						slip = Mathf.Lerp(slip, 1f, 0.02f);
					}
					wantedRPM = 0f;
					collider.brakeTorque = carSetting.brakePower;
					wheelComponent.rotation = w_rotate;
				}
			}
			else
			{
				float brakeTorque;
				if (accel == 0f || NeutralGear)
				{
					float num5 = (collider.brakeTorque = 1000f);
					brakeTorque = num5;
				}
				else
				{
					float num5 = (collider.brakeTorque = 0f);
					brakeTorque = num5;
				}
				collider.brakeTorque = brakeTorque;
				slip = ((!(speed > 0f)) ? (slip = Mathf.Lerp(slip, 0.01f, 0.02f)) : ((!(speed > 100f)) ? (slip = Mathf.Lerp(slip, 1.5f, 0.02f)) : (slip = Mathf.Lerp(slip, 1f + Mathf.Abs(steer), 0.02f))));
				w_rotate = wheelComponent.rotation;
			}
			WheelFrictionCurve val3 = collider.forwardFriction;
			((WheelFrictionCurve)(ref val3)).asymptoteValue = 5000f;
			((WheelFrictionCurve)(ref val3)).extremumSlip = 2f;
			((WheelFrictionCurve)(ref val3)).asymptoteSlip = 20f;
			((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2);
			collider.forwardFriction = val3;
			val3 = collider.sidewaysFriction;
			((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2);
			((WheelFrictionCurve)(ref val3)).extremumSlip = 0.2f + Mathf.Abs(steer);
			collider.sidewaysFriction = val3;
			if (shift && currentGear > 1 && speed > 50f && shifmotor && Mathf.Abs(steer) < 0.2f)
			{
				if (powerShift == 0f)
				{
					shifmotor = false;
				}
				powerShift = Mathf.MoveTowards(powerShift, 0f, Time.deltaTime * 10f);
				carSounds.nitro.volume = Mathf.Lerp(carSounds.nitro.volume, 1f, Time.deltaTime * 10f);
				if (!carSounds.nitro.isPlaying)
				{
					((Component)carSounds.nitro).GetComponent<AudioSource>().Play();
				}
				curTorque = ((!(powerShift > 0f)) ? carSetting.carPower : carSetting.shiftPower);
				carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f);
				carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f);
			}
			else
			{
				if (powerShift > 20f)
				{
					shifmotor = true;
				}
				carSounds.nitro.volume = Mathf.MoveTowards(carSounds.nitro.volume, 0f, Time.deltaTime * 2f);
				if (carSounds.nitro.volume == 0f)
				{
					carSounds.nitro.Stop();
				}
				powerShift = Mathf.MoveTowards(powerShift, 100f, Time.deltaTime * 5f);
				curTorque = carSetting.carPower;
				carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, 0f, Time.deltaTime * 10f);
				carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, 0f, Time.deltaTime * 10f);
			}
			wheelComponent.rotation = Mathf.Repeat(wheelComponent.rotation + Time.deltaTime * collider.rpm * 360f / 60f, 360f);
			wheelComponent.rotation2 = Mathf.Lerp(wheelComponent.rotation2, collider.steerAngle, 0.1f);
			wheelComponent.wheel.localRotation = Quaternion.Euler(wheelComponent.rotation, wheelComponent.rotation2, 0f);
			Vector3 localPosition = wheelComponent.wheel.localPosition;
			if (collider.GetGroundHit(ref val4))
			{
				if (Object.op_Implicit((Object)(object)carParticles.brakeParticlePerfab))
				{
					if ((Object)(object)Particle[num3] == (Object)null)
					{
						Particle[num3] = Object.Instantiate<GameObject>(carParticles.brakeParticlePerfab, wheelComponent.wheel.position, Quaternion.identity);
						((Object)Particle[num3]).name = "WheelParticle";
						Particle[num3].transform.parent = ((Component)this).transform;
						Particle[num3].AddComponent<AudioSource>();
						Particle[num3].GetComponent<AudioSource>().maxDistance = 50f;
						Particle[num3].GetComponent<AudioSource>().spatialBlend = 1f;
						Particle[num3].GetComponent<AudioSource>().dopplerLevel = 5f;
						Particle[num3].GetComponent<AudioSource>().rolloffMode = (AudioRolloffMode)2;
					}
					ParticleSystem component = Particle[num3].GetComponent<ParticleSystem>();
					bool flag2 = false;
					for (int l = 0; l < carSetting.hitGround.Length; l++)
					{
						if (((Component)((WheelHit)(ref val4)).collider).CompareTag(carSetting.hitGround[l].tag))
						{
							flag2 = carSetting.hitGround[l].grounded;
							if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.5f) && speed > 1f)
							{
								Particle[num3].GetComponent<AudioSource>().clip = carSetting.hitGround[l].brakeSound;
							}
							else if ((Object)(object)Particle[num3].GetComponent<AudioSource>().clip != (Object)(object)carSetting.hitGround[l].groundSound && !Particle[num3].GetComponent<AudioSource>().isPlaying)
							{
								Particle[num3].GetComponent<AudioSource>().clip = carSetting.hitGround[l].groundSound;
							}
							Particle[num3].GetComponent<ParticleSystem>().startColor = carSetting.hitGround[l].brakeColor;
						}
					}
					if (flag2 && speed > 5f && !brake)
					{
						component.enableEmission = true;
						Particle[num3].GetComponent<AudioSource>().volume = 0.5f;
						if (!Particle[num3].GetComponent<AudioSource>().isPlaying)
						{
							Particle[num3].GetComponent<AudioSource>().Play();
						}
					}
					else if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && speed > 1f)
					{
						if (accel < 0f || ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && (wheelComponent == wheels[2] || wheelComponent == wheels[3])))
						{
							if (!Particle[num3].GetComponent<AudioSource>().isPlaying)
							{
								Particle[num3].GetComponent<AudioSource>().Play();
							}
							component.enableEmission = true;
							Particle[num3].GetComponent<AudioSource>().volume = 10f;
						}
					}
					else
					{
						component.enableEmission = false;
						Particle[num3].GetComponent<AudioSource>().volume = Mathf.Lerp(Particle[num3].GetComponent<AudioSource>().volume, 0f, Time.deltaTime * 10f);
					}
				}
				localPosition.y -= Vector3.Dot(wheelComponent.wheel.position - ((WheelHit)(ref val4)).point, ((Component)this).transform.TransformDirection(0f, 1f, 0f) / ((Component)this).transform.lossyScale.x) - collider.radius;
				localPosition.y = Mathf.Clamp(localPosition.y, -10f, wheelComponent.pos_y);
				flag = flag || wheelComponent.drive;
			}
			else
			{
				if ((Object)(object)Particle[num3] != (Object)null)
				{
					ParticleSystem component2 = Particle[num3].GetComponent<ParticleSystem>();
					component2.enableEmission = false;
				}
				localPosition.y = wheelComponent.startPos.y - wheelComponent.settings.Distance;
				myRigidbody.AddForce(Vector3.down * 5000f);
			}
			num3++;
			wheelComponent.wheel.localPosition = localPosition;
		}
		if (num2 > 1)
		{
			num /= (float)num2;
		}
		motorRPM = 0.95f * motorRPM + 0.05f * Mathf.Abs(num * carSetting.gears[currentGear]);
		if (motorRPM > 5500f)
		{
			motorRPM = 5200f;
		}
		int num7 = (int)(motorRPM / efficiencyTableStep);
		if (num7 >= efficiencyTable.Length)
		{
			num7 = efficiencyTable.Length - 1;
		}
		if (num7 < 0)
		{
			num7 = 0;
		}
		float num8 = curTorque * carSetting.gears[currentGear] * efficiencyTable[num7];
		WheelComponent[] array2 = wheels;
		foreach (WheelComponent wheelComponent2 in array2)
		{
			WheelCollider collider2 = wheelComponent2.collider;
			if (wheelComponent2.drive)
			{
				if (Mathf.Abs(collider2.rpm) > Mathf.Abs(wantedRPM))
				{
					collider2.motorTorque = 0f;
				}
				else
				{
					float motorTorque = collider2.motorTorque;
					if (!brake && accel != 0f && !NeutralGear)
					{
						if ((speed < carSetting.LimitForwardSpeed && currentGear > 0) || (speed < carSetting.LimitBackwardSpeed && currentGear == 0))
						{
							collider2.motorTorque = motorTorque * 0.9f + num8 * 1f;
						}
						else
						{
							collider2.motorTorque = 0f;
							collider2.brakeTorque = 2000f;
						}
					}
					else
					{
						collider2.motorTorque = 0f;
					}
				}
			}
			if (brake || slip2 > 2f)
			{
				collider2.steerAngle = Mathf.Lerp(collider2.steerAngle, steer * wheelComponent2.maxSteer, 0.02f);
				continue;
			}
			float num9 = Mathf.Clamp(speed / carSetting.maxSteerAngle, 1f, carSetting.maxSteerAngle);
			collider2.steerAngle = steer * (wheelComponent2.maxSteer / num9);
		}
		Pitch = Mathf.Clamp(1.2f + (motorRPM - carSetting.idleRPM) / (carSetting.shiftUpRPM - carSetting.idleRPM), 1f, 10f);
		shiftTime = Mathf.MoveTowards(shiftTime, 0f, 0.1f);
		if (Pitch == 1f)
		{
			carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1f, 0.1f);
			carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f);
			carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.1f);
		}
		else
		{
			carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1.8f - Pitch, 0.1f);
			if ((Pitch > PitchDelay || accel > 0f) && shiftTime == 0f)
			{
				carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0f, 0.2f);
				carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 1f, 0.1f);
			}
			else
			{
				carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f);
				carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.2f);
			}
			carSounds.HighEngine.pitch = Pitch;
			carSounds.LowEngine.pitch = Pitch;
			PitchDelay = Pitch;
		}
		if (!isOn)
		{
			carSounds.IdleEngine.volume = 0f;
			carSounds.LowEngine.volume = 0f;
			carSounds.HighEngine.volume = 0f;
		}
	}

	private void OnDrawGizmos()
	{
		//IL_0026: 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_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: 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_0061: 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_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00b1: Unknown result type (might be due to invalid IL or missing references)
		if (carSetting.showNormalGizmos && !Application.isPlaying)
		{
			Matrix4x4 matrix = Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.lossyScale);
			Gizmos.matrix = matrix;
			Gizmos.color = new Color(1f, 0f, 0f, 0.5f);
			Gizmos.DrawCube(Vector3.up / 1.5f, new Vector3(2.5f, 2f, 6f));
			Gizmos.DrawSphere(carSetting.shiftCentre / ((Component)this).transform.lossyScale.x, 0.2f);
		}
	}
}

CP2077_Malorian3516.dll

Decompiled a week ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

[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 MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace Nikpo.CP2077_Malorian3516
{
	[BepInPlugin("Nikpo.CP2077_Malorian3516", "CP2077_Malorian3516", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class CP2077_Malorian3516Plugin : 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(), "Nikpo.CP2077_Malorian3516");
			OtherLoader.RegisterDirectLoad(BasePath, "Nikpo.CP2077_Malorian3516", "", "", "modmas2024_item02", "");
		}
	}
}
namespace Nikpo
{
	public class ObjectLevelRotation : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.rotation = Quaternion.identity;
		}
	}
	public class ObjectLookAtPlayer : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0011: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
			((Component)this).transform.localEulerAngles = new Vector3(0f, ((Component)this).transform.localEulerAngles.y, 0f);
		}
	}
	public class UILookAtPlayer : MonoBehaviour
	{
		public Transform canvasToCheck;

		public float scaleFactor = 0.05f;

		public float minScale = 0.5f;

		public float maxScale = 2f;

		public float dotFadeThreshold = -0.8f;

		public float fadeSpeed = 0.1f;

		public float dotProductValue;

		private CanvasGroup canvasGroup;

		private void Start()
		{
			canvasGroup = ((Component)this).GetComponent<CanvasGroup>();
		}

		private void LateUpdate()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_005d: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_0095: 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_00a5: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
			float num = Vector3.Distance(((Component)this).transform.position, GM.CurrentPlayerBody.Head.position);
			num *= scaleFactor;
			num = Mathf.Clamp(num, minScale, maxScale);
			((Component)this).transform.localScale = Vector3.one * num;
			float x = ((Component)this).transform.localScale.x;
			Vector3 forward = canvasToCheck.forward;
			Vector3 normalized = ((Vector3)(ref forward)).normalized;
			Vector3 forward2 = GM.CurrentPlayerBody.Head.forward;
			Vector3 normalized2 = ((Vector3)(ref forward2)).normalized;
			dotProductValue = Vector3.Dot(normalized, normalized2);
			if (x <= minScale)
			{
				FadeOut();
			}
			else if (dotProductValue <= dotFadeThreshold)
			{
				FadeIn();
			}
			else
			{
				FadeOut();
			}
		}

		private void FadeIn()
		{
			canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 1f, fadeSpeed);
		}

		private void FadeOut()
		{
			canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 0.2f, fadeSpeed);
		}
	}
}