Decompiled source of HD2 G50 SEEKER v1.0.0

HD2_G50_SEEKER.dll

Decompiled 9 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using H3VRUtils.FVRInteractiveObjects;
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 JerryComponent
{
	public class G11Handle : FVRInteractiveObject
	{
		public Transform RotPiece;

		public AudioEvent HandleCrank;

		[NonSerialized]
		public float m_curRot;

		public Transform FlapPiece;

		[NonSerialized]
		public Vector3 lastHandForward = Vector3.zero;

		public override void BeginInteraction(FVRViveHand hand)
		{
			//IL_001b: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).BeginInteraction(hand);
			SetFlapState(isOut: true);
			lastHandForward = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, ((Component)this).transform.right);
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			((FVRInteractiveObject)this).EndInteraction(hand);
		}

		public void SetFlapState(bool isOut)
		{
			//IL_0043: 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 (isOut)
			{
				FlapPiece.localEulerAngles = new Vector3(0f, 90f, -90f);
			}
			else
			{
				FlapPiece.localEulerAngles = new Vector3(0f, 90f, 0f);
			}
		}

		public override void FVRFixedUpdate()
		{
			//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)
			//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_0039: 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_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_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_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_0066: 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)
			//IL_0072: 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_0160: 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_0114: 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_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			if (((FVRInteractiveObject)this).IsHeld)
			{
				float curRot = m_curRot;
				Vector3 val = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, -((Component)this).transform.right);
				Vector3 val2 = Vector3.ProjectOnPlane(lastHandForward, -((Component)this).transform.right);
				float num = Mathf.Atan2(Vector3.Dot(-((Component)this).transform.right, Vector3.Cross(val, val2)), Vector3.Dot(val, val2)) * 57.29578f;
				if (num > 0f)
				{
					m_curRot -= num;
				}
				if (curRot > -180f && m_curRot <= -180f)
				{
					SM.PlayCoreSound((FVRPooledAudioType)10, HandleCrank, ((Component)this).transform.position);
				}
				if (m_curRot <= -360f)
				{
					RotPiece.localEulerAngles = new Vector3(0f, 0f, 0f);
					SM.PlayCoreSound((FVRPooledAudioType)10, HandleCrank, ((Component)this).transform.position);
					m_curRot = 0f;
					SetFlapState(isOut: false);
					base.m_hand.EndInteractionIfHeld((FVRInteractiveObject)(object)this);
					((FVRInteractiveObject)this).ForceBreakInteraction();
				}
				else
				{
					RotPiece.localEulerAngles = new Vector3(0f, 0f, m_curRot);
				}
				lastHandForward = val;
			}
			((FVRInteractiveObject)this).FVRFixedUpdate();
		}
	}
	public class GM6Barrel : MonoBehaviour
	{
		public Rigidbody gunrig;

		public GameObject barrelRig;

		public Mac11_Stock grab;

		public GameObject grabtarg;

		public GameObject barreltarg;

		public ClosedBoltReceiverDustCoverTrigger dustcover;

		public WaggleJoint dustcoverJoint;

		public AR15HandleSightFlipper barrelLatch;

		public Vector2 ZbarrelLimit;

		public float rear;

		public float fore;

		public GameObject snapbarrel;

		public ClosedBolt bolt;

		public GameObject boltGeo;

		public ClosedBoltWeapon gun;

		public GameObject boltrot;

		public AudioEvent snaptorearaud;

		public bool reachedtorear = false;

		public bool shot = false;

		public GameObject foreexp;

		public GameObject rearexp;

		public bool pulled = false;

		public bool startrecoil = false;

		public float recoverspeedbarrel;

		public float recoverspeedbolt;

		public bool blowback1 = false;

		public bool blowback2 = false;

		public float mul1 = 1f;

		public float mul2 = 1f;

		private void OnShotFired(FVRFireArm firearm)
		{
			if ((Object)(object)firearm == (Object)(object)gun)
			{
				if (((FVRInteractiveObject)bolt).IsHeld)
				{
					((FVRInteractiveObject)bolt).ForceBreakInteraction();
				}
				((FVRInteractiveObject)bolt).IsSimpleInteract = true;
				bolt.Speed_Rearward = 0f;
				shot = true;
				startrecoil = true;
			}
		}

		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(OnShotFired);
		}

		private void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: 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_01c0: 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_0212: 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_0231: 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_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_0281: 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_0266: 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_00ef: 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_00cf: 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_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: 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_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Unknown result type (might be due to invalid IL or missing references)
			//IL_056e: Unknown result type (might be due to invalid IL or missing references)
			//IL_058e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: 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_06ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0618: Unknown result type (might be due to invalid IL or missing references)
			//IL_061d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0634: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Unknown result type (might be due to invalid IL or missing references)
			//IL_079d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0731: Unknown result type (might be due to invalid IL or missing references)
			//IL_0736: Unknown result type (might be due to invalid IL or missing references)
			//IL_074c: Unknown result type (might be due to invalid IL or missing references)
			//IL_09be: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c3: 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_07fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0838: Unknown result type (might be due to invalid IL or missing references)
			//IL_0944: Unknown result type (might be due to invalid IL or missing references)
			//IL_0949: Unknown result type (might be due to invalid IL or missing references)
			//IL_0960: Unknown result type (might be due to invalid IL or missing references)
			//IL_0878: Unknown result type (might be due to invalid IL or missing references)
			if ((int)((FVRPhysicalObject)gun).Size == 3 && (Object)(object)((FVRPhysicalObject)gun).m_quickbeltSlot != (Object)null && ((FVRPhysicalObject)gun).m_isHardnessed)
			{
				((FVRPhysicalObject)gun).m_isHardnessed = false;
			}
			if (((FVRInteractiveObject)bolt).IsHeld)
			{
				boltGeo.gameObject.transform.localPosition = ((Component)bolt).gameObject.transform.localPosition;
				if (boltrot.transform.localEulerAngles.y >= 1f && !pulled)
				{
					barrelRig.gameObject.transform.localPosition = ((Component)bolt).gameObject.transform.localPosition;
				}
				else if (boltrot.transform.localEulerAngles.y < 1f)
				{
					pulled = true;
					blowback1 = false;
					blowback2 = false;
				}
			}
			dustcoverJoint.angleLimitRight = -1f * ((Component)dustcover).gameObject.transform.localEulerAngles.z;
			barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, barrelRig.gameObject.transform.localPosition.z);
			boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, boltGeo.gameObject.transform.localPosition.z);
			barrelRig.gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			boltGeo.gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			if (barrelRig.gameObject.transform.localPosition.z < rear)
			{
				barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, rear);
			}
			if (barrelRig.gameObject.transform.localPosition.z > fore)
			{
				pulled = false;
				if (mul1 != 1f)
				{
					if (!((FVRInteractiveObject)bolt).IsHeld)
					{
						SM.PlayCoreSound((FVRPooledAudioType)41, snaptorearaud, barrelRig.gameObject.transform.position);
					}
					mul1 = 1f;
				}
				barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, fore);
			}
			if (boltGeo.gameObject.transform.localPosition.z < rear)
			{
				boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, rear);
			}
			if (boltGeo.gameObject.transform.localPosition.z > fore)
			{
				pulled = false;
				if (mul2 != 1f)
				{
					if (!((FVRInteractiveObject)bolt).IsHeld)
					{
						SM.PlayCoreSound((FVRPooledAudioType)41, snaptorearaud, boltGeo.gameObject.transform.position);
					}
					mul2 = 1f;
				}
				boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, fore);
			}
			if (boltGeo.gameObject.transform.localPosition.z >= fore)
			{
				pulled = false;
			}
			if (barrelRig.gameObject.transform.localPosition.z < rear + 0.01f && !barrelLatch.m_isLargeAperture)
			{
				snapbarrel.SetActive(true);
				if (((FVRInteractiveObject)grab).IsHeld)
				{
					((FVRInteractiveObject)grab).ForceBreakInteraction();
					((FVRInteractiveObject)grab).IsSimpleInteract = true;
				}
				((FVRPhysicalObject)gun).Size = (FVRPhysicalObjectSize)2;
				barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, rear);
				if (!dustcover.m_isOpen)
				{
					dustcover.ToggleDustCoverState();
				}
				((FVRInteractiveObject)bolt).IsSimpleInteract = true;
			}
			if (barrelLatch.m_isLargeAperture && !((FVRInteractiveObject)grab).IsHeld)
			{
				((FVRPhysicalObject)gun).Size = (FVRPhysicalObjectSize)3;
				((Component)grab).transform.position = grabtarg.transform.position;
				((Component)grab).transform.eulerAngles = grabtarg.transform.eulerAngles;
				((FVRInteractiveObject)grab).IsSimpleInteract = false;
				((FVRInteractiveObject)bolt).IsSimpleInteract = false;
				snapbarrel.SetActive(false);
				if (barrelRig.gameObject.transform.localPosition.z < fore)
				{
					mul1 += Time.deltaTime;
					barrelRig.transform.localPosition = new Vector3(0f, 0f, barrelRig.transform.localPosition.z + recoverspeedbarrel * mul1);
				}
			}
			if (((FVRInteractiveObject)grab).IsHeld)
			{
				if (!dustcover.m_isOpen)
				{
					dustcover.ToggleDustCoverState();
				}
				snapbarrel.SetActive(false);
				((FVRInteractiveObject)bolt).IsSimpleInteract = false;
				barrelRig.gameObject.transform.eulerAngles = barreltarg.transform.eulerAngles;
				barrelRig.gameObject.transform.position = barreltarg.transform.position;
			}
			if (startrecoil && barrelRig.gameObject.transform.localPosition.z > rear)
			{
				barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, barrelRig.gameObject.transform.localPosition.z - recoverspeedbarrel * 25f);
			}
			if (barrelRig.gameObject.transform.localPosition.z < fore - 0.01f)
			{
				if (boltGeo.gameObject.transform.localPosition.z > rear + 0.01f)
				{
					boltGeo.gameObject.transform.localPosition = barrelRig.gameObject.transform.localPosition;
				}
				else if (boltGeo.gameObject.transform.localPosition.z < rear + 0.01f)
				{
					boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, rear);
					if (!reachedtorear && shot)
					{
						startrecoil = false;
						SM.PlayCoreSound((FVRPooledAudioType)41, snaptorearaud, boltGeo.gameObject.transform.position);
						reachedtorear = true;
						shot = false;
						blowback1 = false;
						blowback2 = false;
					}
				}
			}
			else if (barrelRig.gameObject.transform.localPosition.z >= fore - 0.01f)
			{
				if (!((FVRInteractiveObject)bolt).IsHeld && boltGeo.gameObject.transform.localPosition.z < fore)
				{
					mul2 += Time.deltaTime;
					boltGeo.transform.localPosition = new Vector3(0f, 0f, boltGeo.transform.localPosition.z + recoverspeedbolt * mul2);
				}
				if (reachedtorear)
				{
					if (!((FVRInteractiveObject)bolt).IsHeld)
					{
						bolt.Speed_Rearward = -100f;
						bolt.SnapToRear();
					}
					reachedtorear = false;
				}
			}
			if (boltGeo.gameObject.transform.localPosition.z >= fore - 0.01f)
			{
				((FVRInteractiveObject)bolt).IsSimpleInteract = false;
			}
		}

		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(OnShotFired);
		}
	}
	public class G50Seeker : MonoBehaviour
	{
		public QuadcopterController QC;

		public AR15HandleSightFlipper trigger;

		public GameObject wingrot;

		public GameObject explosion;

		public GameObject audseek;

		public GameObject audfly;

		public FVRPhysicalObject main;

		public Collider detectcol;

		[NonSerialized]
		public List<SosigLink> currentAI = new List<SosigLink>();

		[NonSerialized]
		public Transform nearestAI;

		public GameObject lookdir;

		public LayerMask lm;

		public bool clicked = false;

		public bool triggered = true;

		public GameObject lookdir2;

		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);
		}

		private void OnTriggerStay(Collider other)
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Invalid comparison between Unknown and I4
			if (!trigger.m_isLargeAperture && !((FVRInteractiveObject)main).m_isHeld && (Object)(object)main.m_quickbeltSlot == (Object)null && ((Object)((Component)other).gameObject).name == "Sosig_Torso" && (Object)(object)((Component)other).gameObject.GetComponent<SosigLink>() != (Object)null && (Object)(object)GM.CurrentPlayerBody != (Object)null && !currentAI.Contains(((Component)other).gameObject.GetComponent<SosigLink>()) && (int)((Component)other).gameObject.GetComponent<SosigLink>().S.BodyState != 3)
			{
				currentAI.Add(((Component)other).gameObject.GetComponent<SosigLink>());
			}
		}

		private void Update()
		{
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: 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_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: 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_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b2: Invalid comparison between Unknown and I4
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e3: 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_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_053f: Unknown result type (might be due to invalid IL or missing references)
			//IL_054f: Unknown result type (might be due to invalid IL or missing references)
			if (((FVRInteractiveObject)main).m_isHeld)
			{
				if (((FVRInteractiveObject)main).m_hand.Input.TriggerFloat > 0.75f)
				{
					if (!clicked)
					{
						triggered = !triggered;
						clicked = true;
					}
				}
				else
				{
					clicked = false;
				}
			}
			else if (!((FVRInteractiveObject)main).m_isHeld)
			{
				clicked = false;
			}
			trigger.m_isLargeAperture = triggered;
			if ((Object)(object)main == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			if (trigger.m_isLargeAperture || ((FVRInteractiveObject)main).m_isHeld || (Object)(object)main.m_quickbeltSlot != (Object)null)
			{
				detectcol.enabled = false;
				audfly.SetActive(false);
				audseek.SetActive(false);
				nearestAI = null;
				wingrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				((Behaviour)QC).enabled = false;
			}
			if (trigger.m_isLargeAperture || ((FVRInteractiveObject)main).m_isHeld || !((Object)(object)main.m_quickbeltSlot == (Object)null))
			{
				return;
			}
			detectcol.enabled = true;
			audfly.SetActive(true);
			wingrot.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
			((Behaviour)QC).enabled = true;
			if (currentAI == null || (Object)(object)nearestAI == (Object)null)
			{
				if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
				{
					QC.SetFollowTarget(((Component)GM.CurrentPlayerBody.Head).gameObject.transform);
					QC.SetTargetHeight(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.y + 0.25f);
				}
				QC.obstacleCheckDistanceY = 1f;
				QC.followDistance = 1f;
				audseek.SetActive(false);
			}
			if ((Object)(object)nearestAI != (Object)null)
			{
				AxisLookAt(lookdir.transform, ((Component)nearestAI).gameObject.transform.position, Vector3.forward);
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(lookdir2.transform.position, lookdir2.transform.forward, ref val, 25f, LayerMask.op_Implicit(lm)))
				{
					if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponentInParent<SosigLink>() != (Object)null)
					{
						audseek.SetActive(true);
						QC.SetFollowTarget(((Component)nearestAI).gameObject.transform);
						QC.SetTargetHeight(((Component)nearestAI).gameObject.transform.position.y);
						QC.followDistance = 0f;
						QC.obstacleCheckDistanceY = 0.1f;
					}
					else
					{
						if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
						{
							QC.SetFollowTarget(((Component)GM.CurrentPlayerBody.Head).gameObject.transform);
							QC.SetTargetHeight(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.y + 0.25f);
						}
						QC.obstacleCheckDistanceY = 1f;
						QC.followDistance = 1f;
						audseek.SetActive(false);
					}
				}
				else
				{
					if ((Object)(object)GM.CurrentPlayerBody != (Object)null)
					{
						QC.SetFollowTarget(((Component)GM.CurrentPlayerBody.Head).gameObject.transform);
						QC.SetTargetHeight(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.y + 0.25f);
					}
					QC.obstacleCheckDistanceY = 1f;
					QC.followDistance = 1f;
					audseek.SetActive(false);
				}
				if ((Object)(object)GM.CurrentPlayerBody != (Object)null && Vector3.Distance(((Component)main).gameObject.transform.position, ((Component)nearestAI).gameObject.transform.position) <= 1f && Vector3.Distance(((Component)main).gameObject.transform.position, ((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position) >= 2.5f)
				{
					Object.Instantiate<GameObject>(explosion, ((Component)this).gameObject.transform.position, ((Component)this).gameObject.transform.rotation);
					Object.Destroy((Object)(object)((Component)main).gameObject);
				}
			}
			if (currentAI == null)
			{
				return;
			}
			for (int i = 0; i < currentAI.Count; i++)
			{
				if ((Object)(object)currentAI[i] == (Object)null || (int)currentAI[i].S.BodyState == 3 || Vector3.Distance(((Component)main).gameObject.transform.position, ((Component)currentAI[i]).gameObject.transform.position) > 25f)
				{
					currentAI.Remove(currentAI[i]);
				}
			}
			nearestAI = GetNearestGameObject(((Component)this).gameObject.transform, currentAI);
		}

		public Transform GetNearestGameObject(Transform player, List<SosigLink> objects)
		{
			//IL_0044: 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_0069: 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)
			Transform val = null;
			if (objects == null || (Object)(object)val == (Object)null)
			{
			}
			if (objects.Count > 0 && (Object)(object)objects[0] != (Object)null)
			{
				val = ((Component)objects[0]).transform;
				float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position);
				for (int i = 1; i < objects.Count; i++)
				{
					float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position);
					if (num > num2)
					{
						num = num2;
						val = ((Component)objects[i]).transform;
					}
				}
			}
			return val;
		}
	}
	[RequireComponent(typeof(Rigidbody))]
	public class QuadcopterController : MonoBehaviour
	{
		[Header("悬停设置")]
		public float targetHeight = 1.8f;

		public float heightTolerance = 0.1f;

		public float maxLiftForce = 50f;

		[Header("PID控制器参数")]
		public float P_Gain = 5f;

		public float I_Gain = 0.5f;

		public float D_Gain = 2f;

		[Header("避障设置")]
		public LayerMask obstacleMask = LayerMask.op_Implicit(-1);

		public float obstacleCheckDistance = 3f;

		public float avoidanceForce = 15f;

		public float obstacleCheckDistanceY = 1f;

		public float sideRayOffset = 0.5f;

		[Header("跟随设置")]
		public Transform followTarget;

		public float followDistance = 3f;

		public float followForce = 10f;

		public float rotationSpeed = 5f;

		[Header("稳定设置")]
		public float stability = 10f;

		public float stabilitySpeed = 100f;

		private Rigidbody rb;

		private float heightErrorIntegral = 0f;

		private float previousHeightError = 0f;

		private Vector3 avoidanceVector = Vector3.zero;

		private float horizontalErrorIntegralX = 0f;

		private float horizontalErrorIntegralZ = 0f;

		private Vector3 previousHorizontalError = Vector3.zero;

		private void Start()
		{
			rb = ((Component)this).GetComponent<Rigidbody>();
			rb.drag = 1f;
			rb.angularDrag = 5f;
			rb.useGravity = true;
			if ((Object)(object)followTarget == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(HoverInPlace());
			}
		}

		private void FixedUpdate()
		{
			AvoidObstacles();
			ControlHeight();
			FollowTarget();
			StabilizeRotation();
		}

		private void ControlHeight()
		{
			//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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			float y = ((Component)this).transform.position.y;
			float num = targetHeight - y;
			heightErrorIntegral += num * Time.fixedDeltaTime;
			float num2 = (num - previousHeightError) / Time.fixedDeltaTime;
			previousHeightError = num;
			float num3 = num * P_Gain + heightErrorIntegral * I_Gain + num2 * D_Gain;
			num3 = Mathf.Clamp(num3, 0f - maxLiftForce, maxLiftForce);
			Vector3 val = Vector3.up * (num3 + Mathf.Abs(Physics.gravity.y) * rb.mass);
			rb.AddForce(val);
			if (Mathf.Abs(num) < heightTolerance)
			{
				heightErrorIntegral *= 0.9f;
			}
		}

		private void AvoidObstacles()
		{
			//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_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_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_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_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_0085: 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_009a: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00f6: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: 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_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_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)
			//IL_0120: 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_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: 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_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: 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_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: 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_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			avoidanceVector = Vector3.zero;
			Vector3[] array = (Vector3[])(object)new Vector3[7]
			{
				((Component)this).transform.forward,
				-((Component)this).transform.forward,
				((Component)this).transform.right,
				-((Component)this).transform.right,
				((Component)this).transform.forward + ((Component)this).transform.right,
				((Component)this).transform.forward - ((Component)this).transform.right,
				Vector3.up
			};
			Vector3[] array2 = array;
			RaycastHit val2 = default(RaycastHit);
			foreach (Vector3 val in array2)
			{
				if (Physics.Raycast(((Component)this).transform.position, val, ref val2, obstacleCheckDistance, LayerMask.op_Implicit(obstacleMask)))
				{
					Vector3 val3 = ((Component)this).transform.position - ((RaycastHit)(ref val2)).point;
					Vector3 normalized = ((Vector3)(ref val3)).normalized;
					float num = 1f - ((RaycastHit)(ref val2)).distance / obstacleCheckDistance;
					avoidanceVector += normalized * avoidanceForce * num;
					Debug.DrawLine(((Component)this).transform.position, ((RaycastHit)(ref val2)).point, Color.red);
				}
				else
				{
					Debug.DrawRay(((Component)this).transform.position, val * obstacleCheckDistance, Color.green);
				}
			}
			RaycastHit val4 = default(RaycastHit);
			if (Physics.Raycast(((Component)this).transform.position, Vector3.down, ref val4, obstacleCheckDistanceY, LayerMask.op_Implicit(obstacleMask)))
			{
				Vector3 val5 = ((Component)this).transform.position - ((RaycastHit)(ref val4)).point;
				Vector3 normalized2 = ((Vector3)(ref val5)).normalized;
				float num2 = 1f - ((RaycastHit)(ref val4)).distance / obstacleCheckDistance;
				avoidanceVector += normalized2 * avoidanceForce * num2;
				Debug.DrawLine(((Component)this).transform.position, ((RaycastHit)(ref val4)).point, Color.red);
			}
			else
			{
				Debug.DrawRay(((Component)this).transform.position, Vector3.down * obstacleCheckDistance, Color.green);
			}
			if (avoidanceVector != Vector3.zero)
			{
				rb.AddForce(avoidanceVector);
			}
		}

		private void FollowTarget()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_004b: 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_005c: 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_00ad: 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: 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_00c3: 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_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: 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_0144: 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_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0191: 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_01a4: 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)
			if (!((Object)(object)followTarget == (Object)null))
			{
				Vector3 val = followTarget.position + followTarget.forward * followDistance;
				val.y = targetHeight;
				Vector3 val2 = val - ((Component)this).transform.position;
				Vector3 val3 = default(Vector3);
				((Vector3)(ref val3))..ctor(val2.x, 0f, val2.z);
				horizontalErrorIntegralX += val3.x * Time.fixedDeltaTime;
				horizontalErrorIntegralZ += val3.z * Time.fixedDeltaTime;
				Vector3 val4 = (val3 - previousHorizontalError) / Time.fixedDeltaTime;
				previousHorizontalError = val3;
				Vector3 val5 = default(Vector3);
				((Vector3)(ref val5))..ctor(val3.x * P_Gain + horizontalErrorIntegralX * I_Gain + val4.x * D_Gain, 0f, val3.z * P_Gain + horizontalErrorIntegralZ * I_Gain + val4.z * D_Gain);
				val5 = Vector3.ClampMagnitude(val5, followForce);
				Vector3 val6 = val5 - Vector3.Project(val5, ((Vector3)(ref avoidanceVector)).normalized);
				rb.AddForce(val6);
				if (((Vector3)(ref val2)).magnitude > 0.5f)
				{
					Quaternion val7 = Quaternion.LookRotation(new Vector3(val2.x, 0f, val2.z));
					rb.MoveRotation(Quaternion.Slerp(rb.rotation, val7, rotationSpeed * Time.fixedDeltaTime));
				}
			}
		}

		private void StabilizeRotation()
		{
			//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_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_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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0058: 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_0068: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = rb.rotation;
			Quaternion val = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f);
			Quaternion val2 = val * Quaternion.Inverse(rb.rotation);
			Vector3 val3 = new Vector3(val2.x, val2.y, val2.z) * stabilitySpeed;
			rb.AddTorque(val3 - rb.angularVelocity * stability);
		}

		private IEnumerator HoverInPlace()
		{
			Vector3 hoverPosition = ((Component)this).transform.position + Vector3.up * targetHeight;
			Vector3 val = default(Vector3);
			while ((Object)(object)followTarget == (Object)null)
			{
				Vector3 targetPos = new Vector3(hoverPosition.x, targetHeight, hoverPosition.z);
				Vector3 direction = targetPos - ((Component)this).transform.position;
				if (((Vector3)(ref direction)).magnitude > 0.5f)
				{
					Rigidbody obj = rb;
					((Vector3)(ref val))..ctor(direction.x, 0f, direction.z);
					obj.AddForce(((Vector3)(ref val)).normalized * followForce * 0.5f);
				}
				yield return (object)new WaitForFixedUpdate();
			}
		}

		public void SetFollowTarget(Transform target)
		{
			followTarget = target;
			((MonoBehaviour)this).StopCoroutine("HoverInPlace");
		}

		public void ClearFollowTarget()
		{
			followTarget = null;
			((MonoBehaviour)this).StartCoroutine(HoverInPlace());
		}

		public void SetTargetHeight(float height)
		{
			targetHeight = height;
		}

		private void OnDrawGizmosSelected()
		{
			//IL_0010: 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_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_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_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_008e: 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_0095: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			if (Application.isPlaying)
			{
				Gizmos.color = Color.blue;
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(((Component)this).transform.position.x - 2f, targetHeight, ((Component)this).transform.position.z);
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(((Component)this).transform.position.x + 2f, targetHeight, ((Component)this).transform.position.z);
				Gizmos.DrawLine(val, val2);
				Gizmos.color = Color.yellow;
				Gizmos.DrawWireSphere(((Component)this).transform.position, obstacleCheckDistance);
				if ((Object)(object)followTarget != (Object)null)
				{
					Gizmos.color = Color.green;
					Gizmos.DrawLine(((Component)this).transform.position, followTarget.position);
				}
			}
		}
	}
	public class SMLEQuickBolt : MonoBehaviour
	{
		public BoltActionRifle rifle;

		public BoltActionRifle_Handle handle;

		public Vector3 velLinearWorld;

		public Vector3 velLinearWorld2;

		public FVRAlternateGrip grip;

		public Transform slapdirOpen;

		public Transform slapdirClose;

		public bool Slamed = false;

		public float drive = 0f;

		public bool stop = true;

		public Vector3 gunrecoilref;

		public Vector3 gunholdref;

		public Transform clipEjectdir;

		private Vector3 Pos;

		private Vector3 Rot;

		private GameObject shoulderpos;

		private GameObject headpos;

		private GameObject Gunholder;

		private GameObject Gunref;

		private float shoulderdis = 0.25f;

		private bool shouldered = false;

		public bool wasHarnessed;

		public FVRQuickBeltSlot slot;

		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(shotthis);
		}

		private void shotthis(FVRFireArm gun)
		{
			//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)
			//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_0047: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			Gunref.transform.localPosition = new Vector3(Gunref.transform.localPosition.x, Gunref.transform.localPosition.y, Gunref.transform.localPosition.z - 0.05f);
		}

		private void FixedUpdate()
		{
			//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_00c8: Invalid comparison between Unknown and I4
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Invalid comparison between Unknown and I4
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: 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_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: 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_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: 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_031b: 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)
			if (!Slamed && !stop)
			{
				drive -= 10f * Time.deltaTime;
				handle.DriveBolt(drive);
				if ((int)handle.HandleState == 0 && handle.rotAngle <= handle.MinRot + 1f)
				{
					stop = true;
				}
			}
			if (Slamed && !stop)
			{
				drive += 2f * Time.deltaTime;
				handle.DriveBolt(drive);
				if ((int)handle.HandleState == 2 && handle.rotAngle == handle.MaxRot)
				{
					stop = true;
				}
			}
			drive = Mathf.Clamp(drive, 0f, 1f);
			if (((FVRPhysicalObject)rifle).IsAltHeld && (Object)(object)((FVRFireArm)rifle).Clip != (Object)null)
			{
				velLinearWorld2 = ((FVRInteractiveObject)rifle).m_hand.OtherHand.Input.VelLinearWorld;
				if (Vector3.Distance(((FVRInteractiveObject)rifle).m_hand.OtherHand.PalmTransform.position, clipEjectdir.position) < 0.1f && Vector3.Angle(velLinearWorld2, clipEjectdir.forward) < 50f && ((Vector3)(ref velLinearWorld2)).magnitude > 0.5f)
				{
					((FVRFireArm)rifle).EjectClip();
				}
			}
			if (((FVRPhysicalObject)rifle).IsAltHeld && !((FVRInteractiveObject)handle).m_isHeld && (Object)(object)((FVRInteractiveObject)rifle).m_hand.OtherHand.m_currentInteractable != (Object)(object)rifle && (Object)(object)((FVRInteractiveObject)rifle).m_hand.OtherHand.m_currentInteractable != (Object)(object)handle)
			{
				velLinearWorld = ((FVRInteractiveObject)rifle).m_hand.OtherHand.Input.VelLinearWorld;
				if (!Slamed && Vector3.Distance(((FVRInteractiveObject)rifle).m_hand.OtherHand.PalmTransform.position, slapdirOpen.position) < 0.1f && Vector3.Angle(velLinearWorld, slapdirOpen.forward) < 50f && ((Vector3)(ref velLinearWorld)).magnitude > 1f)
				{
					stop = false;
					Slamed = true;
				}
				if (Slamed && Vector3.Distance(((FVRInteractiveObject)rifle).m_hand.OtherHand.PalmTransform.position, slapdirClose.position) < 0.1f && Vector3.Angle(velLinearWorld, slapdirClose.forward) < 50f && ((Vector3)(ref velLinearWorld)).magnitude > 1f)
				{
					stop = false;
					Slamed = false;
				}
			}
			if (((FVRInteractiveObject)handle).m_isHeld)
			{
				if ((int)handle.HandleState == 2 && handle.rotAngle >= handle.MaxRot - 1f)
				{
					Slamed = true;
				}
				if ((int)handle.HandleState == 0 && handle.rotAngle <= handle.MaxRot + 1f)
				{
					Slamed = false;
				}
				drive = Mathf.Abs(handle.BoltActionHandleRoot.localPosition.z / handle.Point_Rearward.localPosition.z);
			}
		}

		private void Update()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_041e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: 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_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: 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_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Gunholder == (Object)null)
			{
				Gunholder = new GameObject("Gunholder");
				Debug.Log((object)"GunHolder");
			}
			if ((Object)(object)Gunref == (Object)null)
			{
				Gunref = new GameObject("Gunref");
				Gunref.transform.SetParent(Gunholder.transform);
				Debug.Log((object)"Gunref");
			}
			if ((Object)(object)headpos == (Object)null)
			{
				headpos = new GameObject("HeadPos");
				Debug.Log((object)"Headpos");
			}
			if ((Object)(object)shoulderpos == (Object)null)
			{
				shoulderpos = new GameObject("ShoulderPos");
				Debug.Log((object)"ShoulderPos");
				if ((Object)(object)headpos != (Object)null)
				{
					shoulderpos.transform.SetParent(headpos.transform);
					shoulderpos.transform.localPosition = new Vector3(0.05f, -0.05f, 0f);
				}
			}
			headpos.transform.position = ((Component)GM.CurrentMovementManager.Head).transform.position;
			headpos.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).transform.eulerAngles;
			if (Vector3.Distance(((FVRFireArm)rifle).StockPos.position, shoulderpos.transform.position) < shoulderdis && ((FVRPhysicalObject)rifle).IsAltHeld && ((FVRInteractiveObject)handle).IsHeld && ((((FVRInteractiveObject)handle).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)handle).m_hand.Input.AXButtonPressed) || (!((FVRInteractiveObject)handle).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)handle).m_hand.Input.TouchpadAxes.y <= -0.9f)))
			{
				if (((FVRPhysicalObject)rifle).m_isHardnessed)
				{
					wasHarnessed = true;
					slot = ((FVRPhysicalObject)rifle).m_quickbeltSlot;
					slot.CurObject = null;
					((FVRPhysicalObject)rifle).m_quickbeltSlot = null;
					((FVRPhysicalObject)rifle).m_isHardnessed = false;
				}
				if (!shouldered)
				{
					Gunholder.transform.position = ((FVRFireArm)rifle).Foregrip.transform.position;
					Gunholder.transform.eulerAngles = ((FVRFireArm)rifle).Foregrip.transform.eulerAngles;
					Gunref.transform.position = ((Component)rifle).transform.position;
					Gunref.transform.eulerAngles = ((Component)rifle).transform.eulerAngles;
					gunholdref = Gunref.transform.localPosition;
					((FVRInteractiveObject)rifle).ForceBreakInteraction();
					((FVRInteractiveObject)grip).ForceBreakInteraction();
					((FVRPhysicalObject)rifle).StoreAndDestroyRigidbody();
					shouldered = true;
				}
			}
			if (shouldered && GM.CurrentMovementManager.Hands[0].Input.GripPressed)
			{
				if (((FVRInteractiveObject)handle).m_isHeld)
				{
					if (((FVRInteractiveObject)handle).m_hand.Input.TriggerFloat >= 0.75f && (int)rifle.CurBoltHandleState == 0 && (int)rifle.FireSelector_Modes[rifle.m_fireSelectorMode].ModeType != 0)
					{
						rifle.Fire();
					}
					((Component)rifle).gameObject.transform.SetParent(Gunref.transform);
					((Component)rifle).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
					((Component)rifle).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					Gunref.transform.localEulerAngles = Vector3.zero;
					Gunref.transform.localPosition = Vector3.SmoothDamp(Gunref.transform.localPosition, gunholdref, ref gunrecoilref, 0.1f);
					Gunholder.transform.position = ((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position;
					AxisLookAt(Gunholder.transform, shoulderpos.transform.position, Vector3.back);
					GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(false);
				}
				else if (!((FVRInteractiveObject)handle).m_isHeld)
				{
					if (wasHarnessed && (Object)(object)slot != (Object)null)
					{
						((FVRPhysicalObject)rifle).m_quickbeltSlot = slot;
						slot.CurObject = (FVRPhysicalObject)(object)rifle;
						((FVRPhysicalObject)rifle).m_isHardnessed = true;
						wasHarnessed = false;
					}
					((FVRPhysicalObject)rifle).BeginInteractionThroughAltGrip(GM.CurrentMovementManager.Hands[0], grip);
					shouldered = false;
				}
			}
			else if (shouldered && !GM.CurrentMovementManager.Hands[0].Input.GripPressed)
			{
				if (wasHarnessed && (Object)(object)slot != (Object)null)
				{
					((FVRPhysicalObject)rifle).m_quickbeltSlot = slot;
					slot.CurObject = (FVRPhysicalObject)(object)rifle;
					((FVRPhysicalObject)rifle).m_isHardnessed = true;
					wasHarnessed = false;
				}
				((Component)rifle).gameObject.transform.SetParent((Transform)null);
				((FVRPhysicalObject)rifle).RecoverRigidbody();
				GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(true);
				shouldered = false;
			}
		}

		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);
		}

		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(shotthis);
		}
	}
	public class LightSaber : MonoBehaviour
	{
		public LightsaberTrail trail;

		public AudioSource whooshAudio;

		public GameObject bladeGeo;

		public AR15HandleSightFlipper flipper;

		public FVRPhysicalObject main;

		public GameObject togglebutton;

		public GameObject bladeball;

		public Vector3 bladeballref;

		public AudioSource on;

		public AudioSource idle;

		public AudioSource off;

		public bool isOn = false;

		public float volumeref;

		public float pitchref;

		public float v;

		public float p;

		public GameObject bladeballtarg;

		public float bladeballSmooth;

		public float volumeSmooth;

		public float pitchSmooth;

		public float volumeMul;

		public float pitchMul;

		public Collider damcol;

		public GameObject mainobj;

		public Light l;

		public float lengthMul = 1.15f;

		public GameObject thisObj;

		public float speed;

		public Vector3 lastPosition;

		public float speedlim = 10f;

		public LayerMask lm;

		public GameObject bladeHolderScale;

		public AudioSource hitaud;

		public bool buttonpressed = false;

		public float bladelength = 0.935f;

		public float ThermalDamage = 100f;

		public void OnTriggerStay(Collider other)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_003d: 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_0089: 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_00ab: 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_00b8: 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_00c9: 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)
			//IL_00df: 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_00e9: 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)
			IFVRDamageable component = ((Component)other).GetComponent<IFVRDamageable>();
			if (component == null && (Object)(object)other.attachedRigidbody != (Object)null)
			{
				component = ((Component)other.attachedRigidbody).GetComponent<IFVRDamageable>();
			}
			if (component != null)
			{
				IFVRDamageable obj = component;
				Damage val = new Damage();
				val.Class = (DamageClass)0;
				val.Dam_Thermal = ThermalDamage;
				val.Dam_Blunt = ThermalDamage * 0.5f;
				val.Dam_TotalEnergetic = ThermalDamage * 0.5f;
				val.point = ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass);
				Vector3 val2 = ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass) - ((Component)this).transform.position;
				val.hitNormal = ((Vector3)(ref val2)).normalized;
				Vector3 val3 = ((Component)this).transform.position - ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass);
				val.strikeDir = ((Vector3)(ref val3)).normalized;
				obj.Damage(val);
			}
			FVRIgnitable component2 = ((Component)other).GetComponent<FVRIgnitable>();
			if ((Object)(object)component2 == (Object)null && (Object)(object)other.attachedRigidbody != (Object)null)
			{
				((Component)other.attachedRigidbody).GetComponent<FVRIgnitable>();
			}
			if ((Object)(object)component2 != (Object)null)
			{
				FXM.Ignite(component2, ThermalDamage / 500f);
			}
		}

		public void OnTriggerEnter(Collider other)
		{
			IFVRDamageable component = ((Component)other).GetComponent<IFVRDamageable>();
			if (component == null && (Object)(object)other.attachedRigidbody != (Object)null)
			{
				component = ((Component)other.attachedRigidbody).GetComponent<IFVRDamageable>();
			}
			if (component != null)
			{
				hitaud.Play();
			}
			FVRIgnitable component2 = ((Component)other).GetComponent<FVRIgnitable>();
			if ((Object)(object)component2 == (Object)null && (Object)(object)other.attachedRigidbody != (Object)null)
			{
				((Component)other.attachedRigidbody).GetComponent<FVRIgnitable>();
			}
			if ((Object)(object)component2 != (Object)null)
			{
				hitaud.Play();
			}
		}

		private void Start()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			lastPosition = Vector3.zero;
			whooshAudio.volume = 0f;
		}

		private void Update()
		{
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_040e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: 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: 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_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_048b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: 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_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: 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_0319: 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_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: 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)
			if (((FVRInteractiveObject)main).m_isHeld)
			{
				if (((FVRInteractiveObject)main).m_hand.Input.TriggerFloat >= 0.75f && !buttonpressed)
				{
					buttonpressed = true;
					flipper.m_isLargeAperture = !flipper.m_isLargeAperture;
				}
				if (((FVRInteractiveObject)main).m_hand.Input.TriggerFloat < 0.75f)
				{
					buttonpressed = false;
				}
			}
			if (!((FVRInteractiveObject)main).m_isHeld)
			{
				buttonpressed = false;
			}
			whooshAudio.volume = Mathf.SmoothDamp(whooshAudio.volume, speed * volumeMul, ref volumeref, volumeSmooth);
			whooshAudio.pitch = Mathf.SmoothDamp(whooshAudio.pitch, 0.5f + speed * pitchMul, ref pitchref, pitchSmooth);
			thisObj.transform.localScale = bladeGeo.transform.localScale;
			if (speed > speedlim)
			{
				speed = speedlim;
			}
			speed = Vector3.Distance(bladeballtarg.transform.position, lastPosition) / Time.deltaTime;
			lastPosition = bladeballtarg.transform.position;
			if (togglebutton.transform.localEulerAngles.x > 1f)
			{
				Ray val = default(Ray);
				((Ray)(ref val))..ctor(((Component)this).gameObject.transform.position, ((Component)this).gameObject.transform.forward);
				RaycastHit val2 = default(RaycastHit);
				Physics.Raycast(val, ref val2, bladelength, LayerMask.op_Implicit(lm));
				if (Vector3.Distance(((RaycastHit)(ref val2)).point, ((Component)this).gameObject.transform.position) <= bladelength)
				{
					bladeHolderScale.transform.localScale = new Vector3(1f, 1f, Vector3.Distance(((RaycastHit)(ref val2)).point, ((Component)this).gameObject.transform.position) / bladelength);
					trail.height = bladelength * (Vector3.Distance(((RaycastHit)(ref val2)).point, ((Component)this).gameObject.transform.position) / bladelength);
				}
				else if (Vector3.Distance(((RaycastHit)(ref val2)).point, ((Component)this).gameObject.transform.position) > bladelength)
				{
					trail.height = bladelength;
					bladeHolderScale.transform.localScale = new Vector3(1f, 1f, 1f);
				}
				bladeball.transform.position = Vector3.SmoothDamp(bladeball.transform.position, bladeballtarg.transform.position, ref bladeballref, bladeballSmooth);
				bladeGeo.transform.localScale = new Vector3(1f, 1f, lengthMul * (togglebutton.transform.localEulerAngles.x / 90f));
				l.intensity = 2f * (togglebutton.transform.localEulerAngles.x / 90f);
				idle.volume = togglebutton.transform.localEulerAngles.x / 90f;
				if (!isOn)
				{
					damcol.enabled = true;
					on.Play();
					isOn = true;
				}
			}
			else if (togglebutton.transform.localEulerAngles.x <= 1f)
			{
				l.intensity = 0f;
				v = 0f;
				p = 0f;
				bladeball.transform.localPosition = new Vector3(0f, 0f, 0f);
				bladeGeo.transform.localScale = new Vector3(0f, 0f, 0f);
				if (isOn)
				{
					damcol.enabled = false;
					on.Play();
					isOn = false;
				}
			}
		}
	}
}
internal class TronTrailSection
{
	public Vector3 point;

	public Vector3 upDir;

	public float time;

	public TronTrailSection()
	{
	}

	public TronTrailSection(Vector3 p, float t)
	{
		//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)
		point = p;
		time = t;
	}
}
[RequireComponent(typeof(MeshFilter))]
public class LightsaberTrail : MonoBehaviour
{
	public float height = 2f;

	public float time = 2f;

	public bool alwaysUp = false;

	public float minDistance = 0.1f;

	public float timeTransitionSpeed = 1f;

	public float desiredTime = 2f;

	public Color startColor = Color.white;

	public Color endColor = new Color(1f, 1f, 1f, 0f);

	private Vector3 position;

	private float now = 0f;

	private TronTrailSection currentSection;

	private Matrix4x4 localSpaceTransform;

	private Mesh mesh;

	private Vector3[] vertices;

	private Color[] colors;

	private Vector2[] uv;

	private MeshRenderer meshRenderer;

	private Material trailMaterial;

	private List<TronTrailSection> sections = new List<TronTrailSection>();

	private void Awake()
	{
		Component component = ((Component)this).GetComponent(typeof(MeshFilter));
		MeshFilter val = (MeshFilter)(object)((component is MeshFilter) ? component : null);
		mesh = val.mesh;
		ref MeshRenderer reference = ref meshRenderer;
		Component component2 = ((Component)this).GetComponent(typeof(MeshRenderer));
		reference = (MeshRenderer)(object)((component2 is MeshRenderer) ? component2 : null);
		trailMaterial = ((Renderer)meshRenderer).material;
	}

	public void StartTrail(float timeToTweenTo, float fadeInTime)
	{
		desiredTime = timeToTweenTo;
		if (time != desiredTime)
		{
			timeTransitionSpeed = Mathf.Abs(desiredTime - time) / fadeInTime;
		}
		if (time <= 0f)
		{
			time = 0.01f;
		}
	}

	public void SetTime(float trailTime, float timeToTweenTo, float tweenSpeed)
	{
		time = trailTime;
		desiredTime = timeToTweenTo;
		timeTransitionSpeed = tweenSpeed;
		if (time <= 0f)
		{
			ClearTrail();
		}
	}

	public void FadeOut(float fadeTime)
	{
		desiredTime = 0f;
		if (time > 0f)
		{
			timeTransitionSpeed = time / fadeTime;
		}
	}

	public void SetTrailColor(Color color)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		trailMaterial.SetColor("_TintColor", color);
	}

	public void Iterate(float itterateTime)
	{
		//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_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_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_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: 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_0083: Unknown result type (might be due to invalid IL or missing references)
		position = ((Component)this).transform.position;
		now = itterateTime;
		if (sections.Count != 0)
		{
			Vector3 val = sections[0].point - position;
			if (!(((Vector3)(ref val)).sqrMagnitude > minDistance * minDistance))
			{
				return;
			}
		}
		TronTrailSection tronTrailSection = new TronTrailSection();
		tronTrailSection.point = position;
		if (alwaysUp)
		{
			tronTrailSection.upDir = Vector3.up;
		}
		else
		{
			tronTrailSection.upDir = ((Component)this).transform.TransformDirection(Vector3.up);
		}
		tronTrailSection.time = now;
		sections.Insert(0, tronTrailSection);
	}

	public void UpdateTrail(float currentTime, float deltaTime)
	{
		//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_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_014d: Unknown result type (might be due to invalid IL or missing references)
		//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_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_01f7: 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_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		mesh.Clear();
		while (sections.Count > 0 && currentTime > sections[sections.Count - 1].time + time)
		{
			sections.RemoveAt(sections.Count - 1);
		}
		if (sections.Count < 2)
		{
			return;
		}
		vertices = (Vector3[])(object)new Vector3[sections.Count * 2];
		colors = (Color[])(object)new Color[sections.Count * 2];
		uv = (Vector2[])(object)new Vector2[sections.Count * 2];
		currentSection = sections[0];
		localSpaceTransform = ((Component)this).transform.worldToLocalMatrix;
		for (int i = 0; i < sections.Count; i++)
		{
			currentSection = sections[i];
			float num = 0f;
			if (i != 0)
			{
				num = Mathf.Clamp01((currentTime - currentSection.time) / time);
			}
			Vector3 upDir = currentSection.upDir;
			ref Vector3 reference = ref vertices[i * 2];
			reference = ((Matrix4x4)(ref localSpaceTransform)).MultiplyPoint(currentSection.point);
			ref Vector3 reference2 = ref vertices[i * 2 + 1];
			reference2 = ((Matrix4x4)(ref localSpaceTransform)).MultiplyPoint(currentSection.point + upDir * height);
			ref Vector2 reference3 = ref uv[i * 2];
			reference3 = new Vector2(num, 0f);
			ref Vector2 reference4 = ref uv[i * 2 + 1];
			reference4 = new Vector2(num, 1f);
			Color val = Color.Lerp(startColor, endColor, num);
			colors[i * 2] = val;
			colors[i * 2 + 1] = val;
		}
		int[] array = new int[(sections.Count - 1) * 2 * 3];
		for (int j = 0; j < array.Length / 6; j++)
		{
			array[j * 6] = j * 2;
			array[j * 6 + 1] = j * 2 + 1;
			array[j * 6 + 2] = j * 2 + 2;
			array[j * 6 + 3] = j * 2 + 2;
			array[j * 6 + 4] = j * 2 + 1;
			array[j * 6 + 5] = j * 2 + 3;
		}
		mesh.vertices = vertices;
		mesh.colors = colors;
		mesh.uv = uv;
		mesh.triangles = array;
		if (time > desiredTime)
		{
			time -= deltaTime * timeTransitionSpeed;
			if (time <= desiredTime)
			{
				time = desiredTime;
			}
		}
		else if (time < desiredTime)
		{
			time += deltaTime * timeTransitionSpeed;
			if (time >= desiredTime)
			{
				time = desiredTime;
			}
		}
	}

	public void ClearTrail()
	{
		desiredTime = 0f;
		time = 0f;
		if ((Object)(object)mesh != (Object)null)
		{
			mesh.Clear();
			sections.Clear();
		}
	}
}
[RequireComponent(typeof(LightsaberTrail))]
public class LightsaberTrailController : MonoBehaviour
{
	private LightsaberTrail lightsaberTrail;

	private void Start()
	{
		lightsaberTrail = ((Component)this).GetComponent<LightsaberTrail>();
	}

	private void Update()
	{
		lightsaberTrail.Iterate(Time.time);
		lightsaberTrail.UpdateTrail(Time.time, 0f);
	}
}
namespace JerryAr.HD2_G50_SEEKER
{
	[BepInPlugin("JerryAr.HD2_G50_SEEKER", "HD2_G50_SEEKER", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class HD2_G50_SEEKERPlugin : 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.HD2_G50_SEEKER");
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.HD2_G50_SEEKER", "", "", "g50seeker", "");
		}
	}
}
namespace JerryComponent
{
	public class Control_Component : MonoBehaviour
	{
		public GameObject Comp;

		public GameObject Comp2;

		public GameObject Rot;

		private bool is45;

		private void Start()
		{
			//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_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)
			if (Rot.transform.localEulerAngles.x > 45f)
			{
				is45 = true;
			}
			if (Rot.transform.localEulerAngles.x < 45f)
			{
				is45 = false;
			}
		}

		private void over45()
		{
			if (is45)
			{
				Comp.SetActive(false);
				Comp2.SetActive(true);
			}
			is45 = false;
		}

		private void under45()
		{
			if (!is45)
			{
				Comp2.SetActive(false);
				Comp.SetActive(true);
			}
			is45 = true;
		}

		private void FixedUpdate()
		{
			//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 ParentPlayer : MonoBehaviour
	{
		public FVRPhysicalObject ObjItself;

		public bool kicked = false;

		public float kickForceMul = 10f;

		public GameObject ParentObj;

		public GameObject PlayerRef;

		public float SteerMul = 100f;

		public float MaxX;

		public float MinX;

		public float MaxY;

		public float MinY;

		public float MaxZ;

		public float MinZ;

		public GameObject board;

		public WheelCollider WheelSteerL;

		public WheelCollider WheelSteerR;

		public WheelCollider WheelStaticL;

		public WheelCollider WheelStaticR;

		[NonSerialized]
		public float WFL;

		[NonSerialized]
		public float WFR;

		[NonSerialized]
		public float WRL;

		[NonSerialized]
		public float WRR;

		public GameObject Fsus;

		public GameObject Rsus;

		public GameObject WheelFrontL;

		public GameObject WheelFrontR;

		public GameObject WheelRearL;

		public GameObject WheelRearR;

		public GameObject navb;

		[NonSerialized]
		public float FY;

		[NonSerialized]
		public float RY;

		[NonSerialized]
		public float BZ;

		[NonSerialized]
		public float WSL;

		[NonSerialized]
		public float WSR;

		[NonSerialized]
		public float WSL2;

		[NonSerialized]
		public float WSR2;

		private void Start()
		{
			navb.transform.SetParent((Transform)null);
		}

		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)
			//IL_003a: 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_007d: 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_00c0: 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_00e5: 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_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: 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_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_081e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0823: Unknown result type (might be due to invalid IL or missing references)
			//IL_0831: 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_0756: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_077b: 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_044f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			//IL_0478: 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_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: 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_05ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_062b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0646: Unknown result type (might be due to invalid IL or missing references)
			//IL_064b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0672: Unknown result type (might be due to invalid IL or missing references)
			//IL_0677: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e2: Unknown result type (might be due to invalid IL or missing references)
			WheelFrontL.transform.localEulerAngles = new Vector3(WheelFrontL.transform.localEulerAngles.x - WheelSteerL.rpm, 0f, 0f);
			WheelFrontR.transform.localEulerAngles = new Vector3(WheelFrontR.transform.localEulerAngles.x - WheelSteerR.rpm, 0f, 0f);
			WheelRearL.transform.localEulerAngles = new Vector3(WheelRearL.transform.localEulerAngles.x - WheelStaticL.rpm, 0f, 0f);
			WheelRearR.transform.localEulerAngles = new Vector3(WheelRearR.transform.localEulerAngles.x - WheelStaticR.rpm, 0f, 0f);
			WheelStaticL.motorTorque = Mathf.SmoothDamp(WheelStaticL.motorTorque, 0f, ref WSL, 5f);
			WheelStaticR.motorTorque = Mathf.SmoothDamp(WheelStaticR.motorTorque, 0f, ref WSR, 5f);
			WheelSteerL.motorTorque = Mathf.SmoothDamp(WheelSteerL.motorTorque, 0f, ref WSL2, 5f);
			WheelSteerR.motorTorque = Mathf.SmoothDamp(WheelSteerR.motorTorque, 0f, ref WSR2, 5f);
			if (((FVRInteractiveObject)ObjItself).IsHeld || (Object)(object)ObjItself.QuickbeltSlot != (Object)null)
			{
				WheelStaticL.motorTorque = 0f;
				WheelStaticR.motorTorque = 0f;
				WheelSteerL.motorTorque = 0f;
				WheelSteerR.motorTorque = 0f;
				navb.SetActive(false);
				((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null);
				kicked = false;
				WheelSteerL.steerAngle = 0f;
				WheelSteerR.steerAngle = 0f;
				WheelStaticL.steerAngle = 0f;
				WheelStaticR.steerAngle = 0f;
				Fsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				Rsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				board.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			else
			{
				if (((FVRInteractiveObject)ObjItself).IsHeld || !((Object)(object)ObjItself.QuickbeltSlot == (Object)null))
				{
					return;
				}
				navb.SetActive(true);
				if (!((Object)(object)GM.CurrentMovementManager != (Object)null))
				{
					return;
				}
				PlayerRef.transform.position = new Vector3(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.x, ((Component)GM.CurrentMovementManager).gameObject.transform.position.y, ((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.z);
				if (PlayerRef.transform.localPosition.x < MaxX && PlayerRef.transform.localPosition.x > MinX && PlayerRef.transform.localPosition.y < MaxY && PlayerRef.transform.localPosition.y > MinY && PlayerRef.transform.localPosition.z < MaxZ && PlayerRef.transform.localPosition.z > MinZ)
				{
					if (!kicked)
					{
						WheelStaticL.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul;
						WheelStaticR.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul;
						WheelSteerL.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul;
						WheelSteerR.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul;
						kicked = true;
					}
					WheelSteerL.steerAngle = PlayerRef.transform.localPosition.x * SteerMul;
					WheelSteerR.steerAngle = PlayerRef.transform.localPosition.x * SteerMul;
					board.transform.localEulerAngles = new Vector3(PlayerRef.transform.localPosition.x * -73.3f, 0f, 0f);
					Fsus.transform.localEulerAngles = new Vector3(0f, PlayerRef.transform.localPosition.x * 100f, 0f);
					Rsus.transform.localEulerAngles = new Vector3(0f, PlayerRef.transform.localPosition.x * -100f, 0f);
					WheelStaticL.steerAngle = PlayerRef.transform.localPosition.x * (0f - SteerMul);
					WheelStaticR.steerAngle = PlayerRef.transform.localPosition.x * (0f - SteerMul);
					((Component)GM.CurrentMovementManager).gameObject.transform.SetParent(ParentObj.transform);
					((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles.y, 0f);
				}
				else if (PlayerRef.transform.localPosition.x > 2f * MaxX || PlayerRef.transform.localPosition.x < 2f * MinX || PlayerRef.transform.localPosition.y > 2f * MaxY || PlayerRef.transform.localPosition.y < 2f * MinY || PlayerRef.transform.localPosition.z > 2f * MaxZ || PlayerRef.transform.localPosition.z < 2f * MinZ)
				{
					if (kicked)
					{
						((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles.y, 0f);
						((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null);
						kicked = false;
					}
					WheelSteerL.steerAngle = 0f;
					WheelSteerR.steerAngle = 0f;
					WheelStaticL.steerAngle = 0f;
					WheelStaticR.steerAngle = 0f;
					Fsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					Rsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					board.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
			}
		}

		private void OnDestroy()
		{
			//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_00e9: 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_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			Object.Destroy((Object)(object)navb);
			kicked = false;
			WheelSteerL.steerAngle = Mathf.Lerp(WheelSteerL.steerAngle, 0f, 0.1f);
			WheelSteerR.steerAngle = Mathf.Lerp(WheelSteerL.steerAngle, 0f, 0.1f);
			WheelStaticL.steerAngle = Mathf.Lerp(WheelStaticL.steerAngle, 0f, 0.1f);
			WheelStaticR.steerAngle = Mathf.Lerp(WheelStaticR.steerAngle, 0f, 0.1f);
			Fsus.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(Fsus.transform.localEulerAngles.y, 0f, ref FY, 0.25f), 0f);
			Rsus.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(Rsus