Decompiled source of FIAT125R v1.6.2

FIAT125R.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using H3VRUtils.Vehicles;
using HarmonyLib;
using OtherLoader;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.Windows.Speech;

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

		public GameObject trigL;

		public GameObject trigR;

		public GameObject magrel;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			if (trigL.transform.localEulerAngles.x > 45f || trigR.transform.localEulerAngles.x > 45f)
			{
				gun.Fire();
			}
			if (magrel.transform.localEulerAngles.x > 45f && (Object)(object)((FVRFireArm)gun).Magazine != (Object)null)
			{
				((FVRFireArm)gun).EjectMag(false);
			}
		}
	}
	public class MGMount2 : MonoBehaviour
	{
		public GameObject mgSpace;

		public GameObject mgX;

		public GameObject mgY;

		public GameObject mgObj;

		private float mgMoveX;

		private float mgMoveY;

		public ClosedBoltWeapon gun;

		public GameObject proxyrounds;

		private void OnTriggerStay(Collider other)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_010e: 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)
			if (gun.Chamber.IsFull)
			{
				mgObj.transform.position = ((Component)other).gameObject.transform.position;
				mgMoveX = mgObj.transform.localPosition.x;
				mgMoveY = mgObj.transform.localPosition.y;
				if (mgMoveX > 1f)
				{
					mgMoveX = 1f;
				}
				if (mgMoveX < 0f)
				{
					mgMoveX = 0f;
				}
				if (mgMoveY > 1f)
				{
					mgMoveY = 1f;
				}
				if (mgMoveY < 0f)
				{
					mgMoveY = 0f;
				}
				mgX.transform.localEulerAngles = new Vector3(0f, (1f - mgMoveX) * 40f, 0f);
				mgY.transform.localEulerAngles = new Vector3(mgMoveY * 40f, 0f, 0f);
			}
		}

		private void Update()
		{
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((FVRFireArm)gun).Magazine != (Object)null)
			{
				if (!gun.Chamber.IsFull && ((FVRFireArm)gun).Magazine.m_numRounds <= 0)
				{
					mgMoveX = 0.5f;
					mgX.transform.localEulerAngles = new Vector3(0f, 20f, 0f);
					mgMoveY = 0f;
					mgY.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					proxyrounds.SetActive(false);
					((FVRFireArm)gun).ConnectedToBox = false;
					((FVRFireArm)gun).HasBelt = false;
					if (((FVRFireArm)gun).BeltDD.m_roundsOnBelt > 0)
					{
						((FVRFireArm)gun).BeltDD.RemoveRound(true);
					}
				}
				if (((FVRFireArm)gun).Magazine.m_numRounds > 0)
				{
					proxyrounds.SetActive(true);
				}
			}
			if ((Object)(object)((FVRFireArm)gun).Magazine == (Object)null)
			{
				mgMoveX = 0.5f;
				mgX.transform.localEulerAngles = new Vector3(0f, 20f, 0f);
				mgMoveY = 0f;
				mgY.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				proxyrounds.SetActive(false);
			}
		}
	}
	public class turretrotation : MonoBehaviour
	{
		public float lowlimit = 2f;

		public float highlimit = 47f;

		public GameObject turretX;

		public GameObject turretY;

		public GameObject trigger;

		public ClosedBoltWeapon gun;

		public float rotX = 180f;

		public float rotY = 10f;

		public GameObject followhands;

		private void OnTriggerStay(Collider other)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			followhands.transform.position = ((Component)other).gameObject.transform.position;
		}

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

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			if (trigger.transform.localEulerAngles.x > 2f && trigger.transform.localEulerAngles.x < 88f)
			{
				gun.Fire();
			}
			if (followhands.transform.localPosition.x >= 0.05f || followhands.transform.localPosition.x <= -0.05f)
			{
				rotX += followhands.transform.localPosition.x * 0.75f;
				turretX.transform.localEulerAngles = new Vector3(0f, rotX, 0f);
			}
			if (followhands.transform.localPosition.y >= 0.05f || followhands.transform.localPosition.y <= -0.05f)
			{
				rotY += followhands.transform.localPosition.y * 0.25f;
				turretY.transform.localEulerAngles = new Vector3(0f, 0f, rotY);
				if (rotY < lowlimit)
				{
					rotY = lowlimit;
				}
				if (rotY > highlimit)
				{
					rotY = highlimit;
				}
			}
		}
	}
	public class turretrotation1 : MonoBehaviour
	{
		public GameObject seatrot;

		public GameObject hatch;

		public float lowlimit = 2f;

		public float highlimit = 52f;

		public GameObject turretX;

		public GameObject turretY;

		public GameObject trigger;

		public OpenBoltReceiver gun;

		public float rotX = 180f;

		public float rotY = 10f;

		public GameObject followhands;

		public string handb;

		public string handid;

		public string X;

		public string Y;

		public float hx = 0f;

		public float hy = 0f;

		public float hz = 0f;

		public float refx = 0f;

		public float refy = 0f;

		public float xrot = 0f;

		public float yrot = 0f;

		public SpringJoint SJ;

		public Rigidbody rigcomt;

		public Transform rigcomtlock;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: 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_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_0182: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			//IL_0456: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: 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_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: 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_04fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0503: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_0557: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a7: 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_058c: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			rigcomt.isKinematic = false;
			rigcomt.useGravity = false;
			((Component)rigcomt).gameObject.transform.localEulerAngles = ((Component)rigcomtlock).transform.localEulerAngles;
			((Component)rigcomt).gameObject.transform.localPosition = ((Component)rigcomtlock).transform.localPosition;
			turretX = GameObject.Find(X);
			turretY = GameObject.Find(Y);
			if ((Object)(object)GameObject.Find(handid) != (Object)null)
			{
				followhands = GameObject.Find(handid);
				followhands.transform.SetParent(GameObject.Find(handb).transform);
				if ((Object)(object)SJ == (Object)null)
				{
					followhands.transform.localPosition = new Vector3(0f, 0.027f, 0f);
					SJ = followhands.AddComponent<SpringJoint>();
					((Joint)SJ).connectedBody = rigcomt;
					SJ.spring = 2500f;
					SJ.damper = 10f;
					SJ.tolerance = 0f;
					SJ.maxDistance = 0f;
					SJ.minDistance = 0f;
				}
				hx = followhands.transform.localPosition.x;
				hz = 0f;
				if (hx > 0.1f)
				{
					hx = 0.1f;
				}
				else if (hx < -0.1f)
				{
					hx = -0.1f;
				}
				if (hatch.transform.localEulerAngles.x > 45f && seatrot.transform.localEulerAngles.x > 45f)
				{
					if (hy > 0.052f)
					{
						hy = 0.052f;
					}
					else if (hy < 0.002f)
					{
						hy = 0.002f;
					}
					hy = followhands.transform.localPosition.y;
				}
				else if (hatch.transform.localEulerAngles.x < 45f || seatrot.transform.localEulerAngles.x < 45f)
				{
					hy = 0.027f;
				}
				followhands.transform.localPosition = new Vector3(hx, hy, hz);
			}
			if (trigger.transform.localEulerAngles.x > 2f && trigger.transform.localEulerAngles.x < 88f)
			{
				gun.ReleaseSeer();
			}
			else if (trigger.transform.localEulerAngles.x < 2f || trigger.transform.localEulerAngles.x > 88f)
			{
				gun.EngageSeer();
			}
			if (seatrot.transform.localEulerAngles.x < 45f && hatch.transform.localEulerAngles.x > 45f)
			{
				turretX.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(turretX.transform.localEulerAngles.y, 0f, ref refx, 1f), 0f);
			}
			else if (seatrot.transform.localEulerAngles.x > 45f || hatch.transform.localEulerAngles.x < 45f)
			{
				turretX.transform.localEulerAngles = new Vector3(0f, turretX.transform.localEulerAngles.y + 1500f * followhands.transform.localPosition.x * Time.deltaTime, 0f);
			}
			yrot = Mathf.SmoothDamp(yrot, followhands.transform.localPosition.y * 1000f, ref refy, 2f);
			turretY.transform.localEulerAngles = new Vector3(0f, 0f, yrot);
			if (turretY.transform.localEulerAngles.z > highlimit)
			{
				turretY.transform.localEulerAngles = new Vector3(0f, 0f, highlimit);
			}
			else if (turretY.transform.localEulerAngles.z < lowlimit)
			{
				turretY.transform.localEulerAngles = new Vector3(0f, 0f, lowlimit);
			}
		}
	}
	public class ButtonIgnition : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public VehicleAudioSet audioSet;

		public float ignitionTime;

		private float m_it;

		public float failChance;

		public Random rand;

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

		public override void BeginInteraction(FVRViveHand hand)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			m_it = ignitionTime;
			if (vehicle.isOn)
			{
				SM.PlayGenericSound(audioSet.VehicleStop, ((Component)this).transform.position);
				m_it = 999999f;
				vehicle.TurnOffEngine(forcibly: false);
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).UpdateInteraction(hand);
			m_it -= Time.fixedDeltaTime;
			if (m_it <= 0f)
			{
				vehicle.TurnOnEngine(forcibly: false);
				SM.PlayGenericSound(audioSet.VehicleStart, ((Component)this).transform.position);
				m_it = 999999f;
			}
		}
	}
	internal class CarFollow : MonoBehaviour
	{
		public VehicleControl _carControl;

		public Transform _setPos;

		private FVRMovementManager _playerMovement;

		private void Awake()
		{
			_playerMovement = Object.FindObjectOfType<FVRMovementManager>();
		}

		private void Update()
		{
			if (_carControl.isOn)
			{
				PlayerForwardFollowSet();
			}
		}

		private void PlayerForwardFollowSet()
		{
			//IL_0017: 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_0031: Unknown result type (might be due to invalid IL or missing references)
			((Component)_playerMovement).transform.rotation = Quaternion.RotateTowards(((Component)_playerMovement).transform.rotation, ((Component)_setPos).transform.rotation, 5f);
		}
	}
	public class AddScope : MonoBehaviour
	{
		public Camera cam;

		public Shader shad;

		public MeshRenderer mr1;

		public int reticlesize = 1024;

		public float _VR = 0f;

		public float _VS = 0.25f;

		public float _ER = 1f;

		public float _RS = 4.12f;

		public float _ROX = 0f;

		public float _ROY = 0f;

		private void Start()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			RenderTexture val = new RenderTexture(reticlesize, reticlesize, 16, (RenderTextureFormat)0);
			val.Create();
			cam.targetTexture = val;
			Material val2 = new Material(shad);
			val2.SetTexture("_MainTex", (Texture)(object)val);
			val2.SetFloat("_VignetteRadius", _VR);
			val2.SetFloat("_VignetteSmoothness", _VS);
			val2.SetFloat("_EyeRelief", _ER);
			val2.SetTexture("_ReticleTex", (Texture)(object)val);
			val2.SetFloat("_ReticleScale", _RS);
			val2.SetFloat("_ReticleOffsetX", _ROX);
			val2.SetFloat("_ReticleOffsetY", _ROY);
			((Renderer)mr1).material = val2;
		}

		private void Update()
		{
		}
	}
	[Serializable]
	public class DriveShiftNode
	{
		public Vector3 localposition;

		public Vector3 rotation;

		public int left = -1;

		public int up = -1;

		public int right = -1;

		public int down = -1;

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

		public Text gearText;

		public int currentNode;

		public List<DriveShiftNode> driveShiftNodes;

		public VehicleAudioSet audioSet;

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

		private void Start()
		{
			//IL_0039: 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)
			vehicle.ShiftTo(driveShiftNodes[currentNode].gear);
			((Component)this).transform.localPosition = driveShiftNodes[currentNode].localposition;
			((Component)this).transform.localEulerAngles = driveShiftNodes[currentNode].rotation;
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].left != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].left;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].up != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].up;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].right != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].right;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].down != -1)
			{
				flag = true;
				currentNode = driveShiftNodes[currentNode].down;
			}
			if (flag)
			{
				vehicle.ShiftTo(driveShiftNodes[currentNode].gear);
				((Component)this).transform.localPosition = driveShiftNodes[currentNode].localposition;
				((Component)this).transform.localEulerAngles = driveShiftNodes[currentNode].rotation;
			}
		}
	}
	public class IfInWater : MonoBehaviour
	{
		public GameObject floatScr;

		public FVRPhysicalObject obj;

		private void Start()
		{
		}

		private void Update()
		{
			if (obj.IsInWater)
			{
				floatScr.SetActive(true);
			}
			else if (!obj.IsInWater)
			{
				floatScr.SetActive(false);
			}
		}
	}
	public class IsFloating : MonoBehaviour
	{
		public FVRPhysicalObject floatObj;

		public Rigidbody floatObjRB;

		public Transform floatDir;

		public float ForceF;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_001e: 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)
			if (floatObj.IsInWater)
			{
				floatObjRB.AddForce(floatDir.forward * Time.deltaTime * ForceF, (ForceMode)0);
			}
			else if (floatObj.IsInWater)
			{
			}
		}
	}
	public class ParkingBrakeClick : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public Vector3 positionOff;

		public Vector3 positionOn;

		public Vector3 rotationOff;

		public Vector3 rotationOn;

		public bool isOn;

		public VehicleAudioSet audioSet;

		public override void SimpleInteraction(FVRViveHand hand)
		{
			//IL_0084: 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_00a6: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).SimpleInteraction(hand);
			isOn = !isOn;
			if (isOn)
			{
				SM.PlayGenericSound(audioSet.HandbrakeUp, ((Component)this).transform.position);
				((Component)this).transform.localPosition = positionOn;
				((Component)this).transform.localEulerAngles = rotationOn;
				vehicle.brake = true;
			}
			else
			{
				SM.PlayGenericSound(audioSet.HandbrakeDown, ((Component)this).transform.position);
				((Component)this).transform.localPosition = positionOff;
				((Component)this).transform.localEulerAngles = rotationOff;
				vehicle.brake = false;
			}
		}
	}
	public class Propeller : MonoBehaviour
	{
		public VehicleControl Vehicle;

		public Rigidbody Prop;

		public Rigidbody Prop2;

		public Transform ForceDir;

		public Transform ForceDir2;

		public bool propon;

		public bool isRev;

		public float ForceP = 400000f;

		public GameObject PropRot;

		private void Start()
		{
		}

		public void PropellerON()
		{
			//IL_0019: 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_002e: 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_004f: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			if (isRev)
			{
				Prop.AddForce(ForceDir.forward * Time.deltaTime * ForceP, (ForceMode)0);
				Prop2.AddForce(ForceDir2.forward * Time.deltaTime * ForceP, (ForceMode)0);
			}
			else if (!isRev)
			{
				Prop.AddForce(ForceDir.forward * Time.deltaTime * (0f - ForceP), (ForceMode)0);
				Prop2.AddForce(ForceDir2.forward * Time.deltaTime * (0f - ForceP), (ForceMode)0);
			}
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (PropRot.transform.localEulerAngles.x >= 45f)
			{
				PropellerON();
			}
			else if (!(PropRot.transform.localEulerAngles.x < 45f))
			{
			}
			if (Vehicle.currentGear == 0)
			{
				isRev = true;
			}
			else if (Vehicle.currentGear == 1)
			{
				isRev = false;
			}
		}
	}
	public class SteeringWheel : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public float resetLerpSpeed;

		public float maxRot;

		public bool reverseRot;

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

		public float rot;

		public float rh;

		public float lr;

		public float inlerp;

		public float lerp;

		public float rotAmt;

		public VehicleAudioSet audioSet;

		private SteeringWheelGrip leftGrip;

		private SteeringWheelGrip rightGrip;

		private FVRViveHand leftHand;

		private FVRViveHand rightHand;

		private bool isDualGripping = false;

		public void RegisterGrip(SteeringWheelGrip grip, FVRViveHand hand)
		{
			if ((Object)(object)leftGrip == (Object)null)
			{
				leftGrip = grip;
				leftHand = hand;
			}
			else if ((Object)(object)rightGrip == (Object)null && (Object)(object)grip != (Object)(object)leftGrip)
			{
				rightGrip = grip;
				rightHand = hand;
			}
		}

		public void UnregisterGrip(SteeringWheelGrip grip, FVRViveHand hand)
		{
			if ((Object)(object)grip == (Object)(object)leftGrip)
			{
				leftGrip = null;
				leftHand = null;
			}
			else if ((Object)(object)grip == (Object)(object)rightGrip)
			{
				rightGrip = null;
				rightHand = null;
			}
		}

		public override void BeginInteraction(FVRViveHand hand)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).BeginInteraction(hand);
			Fiat131SteeringInput component = ((Component)this).GetComponent<Fiat131SteeringInput>();
			if (!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled)
			{
				Transform child = ((Component)this).transform.GetChild(0);
				child.parent = null;
				Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
				((Component)this).transform.LookAt(((Component)hand).transform);
				((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, localEulerAngles.z);
				child.parent = ((Component)this).transform;
			}
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			//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_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)
			((FVRInteractiveObject)this).EndInteraction(hand);
			Fiat131SteeringInput component = ((Component)this).GetComponent<Fiat131SteeringInput>();
			if (!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled)
			{
				Transform child = ((Component)this).transform.GetChild(0);
				child.parent = null;
				((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, 0f, ((Component)this).transform.localEulerAngles.z);
				child.parent = ((Component)this).transform;
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).UpdateInteraction(hand);
			Fiat131SteeringInput component = ((Component)this).GetComponent<Fiat131SteeringInput>();
			if (!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled)
			{
				Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
				((Component)this).transform.LookAt(((Component)hand).transform);
				Vector3 localEulerAngles2 = ((Component)this).transform.localEulerAngles;
				rot = Mathf.DeltaAngle((float)Math.Round(localEulerAngles2.y), (float)Math.Round(localEulerAngles.y));
				rotAmt += rot;
				if (rotAmt >= maxRot)
				{
					rotAmt = maxRot;
					((Component)this).transform.localEulerAngles = localEulerAngles;
				}
				else if (rotAmt <= 0f - maxRot)
				{
					rotAmt = 0f - maxRot;
					((Component)this).transform.localEulerAngles = localEulerAngles;
				}
				else
				{
					((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles2.y, localEulerAngles.z);
				}
				rh = localEulerAngles2.y;
				lr = localEulerAngles.y;
				SetRot();
				bool flag = false;
				if (hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f)
				{
					flag = true;
				}
				if (flag)
				{
					vehicle.accel = 0f - (float)Math.Pow(((Vector2)(ref hand.Input.TouchpadAxes)).magnitude, 2.0);
					vehicle.brake = true;
				}
				else
				{
					vehicle.accel = (float)Math.Pow(hand.Input.TriggerFloat, 2.0);
					vehicle.brake = false;
				}
			}
		}

		private void FixedUpdate()
		{
			//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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			Fiat131SteeringInput component = ((Component)this).GetComponent<Fiat131SteeringInput>();
			if ((!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled) && (Object)(object)base.m_hand == (Object)null)
			{
				float num = resetLerpSpeed;
				if (rotAmt > 0f)
				{
					num = 0f - num;
				}
				if (rotAmt > num || rotAmt < 0f - num)
				{
					rotAmt += num;
					((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, ((Component)this).transform.localEulerAngles.y - num, ((Component)this).transform.localEulerAngles.z);
					vehicle.accel = 0f;
					SetRot();
				}
			}
		}

		private void SetRot()
		{
			bool flag = rotAmt <= 0f;
			lerp = Mathf.Abs(rotAmt) / maxRot;
			lerp *= -1f;
			if (flag)
			{
				lerp *= -1f;
			}
			if (reverseRot)
			{
				lerp = 0f - lerp;
			}
			if ((Object)(object)rotText != (Object)null)
			{
				rotText.text = lerp.ToString();
			}
			vehicle.steer = lerp;
		}
	}
	public class SteeringWheelGrip : MonoBehaviour
	{
		public SteeringWheel stw;

		public void Update()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			((Component)stw).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, stw.rotAmt);
			((Component)stw).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
		}
	}
	public class VehicleControl : MonoBehaviour
	{
		public enum ControlMode
		{
			simple = 1,
			touch
		}

		[Serializable]
		public class CarWheels
		{
			public ConnectWheel wheels;
		}

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

			public Transform frontRight;

			public Transform frontLeft;

			public WheelSetting frontSetting;

			public bool backWheelDrive = true;

			public Transform backRight;

			public Transform backLeft;

			public WheelSetting rearSetting;
		}

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

			public float Weight = 1000f;

			public float Distance = 0.2f;
		}

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

			public Light[] reverseLights;
		}

		[Serializable]
		public class CarSounds
		{
			public AudioSource IdleEngine;

			public AudioSource LowEngine;

			public AudioSource HighEngine;

			public float minPitch = 1f;

			public float maxPitch = 10f;

			public AudioSource nitro;

			public AudioSource switchGear;
		}

		[Serializable]
		public class CarParticles
		{
			public GameObject brakeParticlePerfab;

			public ParticleSystem shiftParticle1;

			public ParticleSystem shiftParticle2;

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

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

			public Transform carSteer;

			public HitGround[] hitGround;

			public List<Transform> cameraSwitchView;

			public float springs = 25000f;

			public float dampers = 1500f;

			public float carPower = 120f;

			public float shiftPower = 150f;

			public float brakePower = 8000f;

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

			public float maxSteerAngle = 25f;

			public float shiftDownRPM = 1500f;

			public float shiftUpRPM = 2500f;

			public float idleRPM = 500f;

			public float stiffness = 2f;

			public bool automaticGear = true;

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

			public float LimitBackwardSpeed = 60f;

			public float LimitForwardSpeed = 220f;
		}

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

			public bool grounded = false;

			public AudioClip brakeSound;

			public AudioClip groundSound;

			public Color brakeColor;
		}

		private class WheelComponent
		{
			public Transform wheel;

			public WheelCollider collider;

			public Vector3 startPos;

			public float rotation = 0f;

			public float rotation2 = 0f;

			public float maxSteer;

			public bool drive;

			public float pos_y = 0f;

			public WheelSetting settings;
		}

		public ControlMode controlMode = ControlMode.simple;

		public bool activeControl = false;

		public CarWheels carWheels;

		public CarLights carLights;

		public CarSounds carSounds;

		public CarParticles carParticles;

		public CarSetting carSetting;

		public bool useFiat131Physics = false;

		public bool useFiat131RallyPhysics = false;

		public float limitedSlipLock = 0.4f;

		public float rallyShiftDuration = 0.12f;

		private readonly float[] rallyRpm = new float[11]
		{
			1200f, 2000f, 3000f, 4000f, 5000f, 5600f, 6000f, 6500f, 7000f, 7500f,
			8200f
		};

		private readonly float[] rallyTorque = new float[11]
		{
			85f, 120f, 160f, 190f, 215f, 226f, 226f, 224f, 220f, 210.703f,
			170f
		};

		public float finalDriveRatio = 4.1f;

		public float drivetrainEfficiency = 0.85f;

		public float engineRedline = 5800f;

		public float dragArea = 0.78f;

		public float rollingResistance = 0.015f;

		private float fiatShiftUntil;

		private int fiatLastGear;

		private bool fiatLastNeutral;

		private float fiatWheelbase;

		private float fiatTrack;

		private readonly float[] fiatRpm = new float[8] { 800f, 1500f, 2000f, 3000f, 4000f, 4500f, 5200f, 5800f };

		private readonly float[] fiatTorque = new float[8] { 65f, 85f, 95f, 102f, 100f, 97f, 87.78f, 70f };

		[HideInInspector]
		public float steer = 0f;

		[HideInInspector]
		public float accel = 0f;

		[HideInInspector]
		public bool brake;

		private bool shifmotor;

		[HideInInspector]
		public float curTorque = 100f;

		[HideInInspector]
		public float powerShift = 100f;

		[HideInInspector]
		public bool shift;

		private float torque = 100f;

		[HideInInspector]
		public float speed = 0f;

		private float lastSpeed = -10f;

		private bool shifting = false;

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

		private float efficiencyTableStep = 250f;

		private float Pitch;

		private float PitchDelay;

		private float shiftTime = 0f;

		private float shiftDelay = 0f;

		[HideInInspector]
		public int currentGear = 0;

		[HideInInspector]
		public bool NeutralGear = true;

		[HideInInspector]
		public float motorRPM = 0f;

		[HideInInspector]
		public bool Backward = false;

		[HideInInspector]
		public float accelFwd = 0f;

		[HideInInspector]
		public float accelBack = 0f;

		[HideInInspector]
		public float steerAmount = 0f;

		private float wantedRPM = 0f;

		private float w_rotate;

		private float slip;

		private float slip2 = 0f;

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

		private Vector3 steerCurAngle;

		private Rigidbody myRigidbody;

		private WheelComponent[] wheels;

		public bool isOn = true;

		public bool isForciblyOff = false;

		private float FiatTorqueAt(float engineRpm)
		{
			float[] array = ((!useFiat131RallyPhysics) ? fiatRpm : rallyRpm);
			float[] array2 = ((!useFiat131RallyPhysics) ? fiatTorque : rallyTorque);
			for (int i = 1; i < array.Length; i++)
			{
				if (engineRpm <= array[i])
				{
					return Mathf.Lerp(array2[i - 1], array2[i], Mathf.InverseLerp(array[i - 1], array[i], engineRpm));
				}
			}
			return array2[^1];
		}

		private void ApplyFiat131Physics()
		{
			//IL_053e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0543: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_060a: 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_05cc: Unknown result type (might be due to invalid IL or missing references)
			currentGear = Mathf.Clamp(currentGear, 0, carSetting.gears.Length - 1);
			if (currentGear != fiatLastGear || NeutralGear != fiatLastNeutral)
			{
				fiatShiftUntil = Time.time + ((!useFiat131RallyPhysics) ? 0.35f : rallyShiftDuration);
				fiatLastGear = currentGear;
				fiatLastNeutral = NeutralGear;
			}
			float num = carSetting.gears[currentGear] * finalDriveRatio;
			float num2 = (wheels[2].collider.rpm + wheels[3].collider.rpm) * 0.5f;
			float num3 = Mathf.Abs(num2 * num);
			float num4 = ((!isOn) ? 0f : Mathf.Clamp01(accel));
			float num5 = ((!isOn) ? ((!NeutralGear) ? num3 : 0f) : ((!NeutralGear) ? Mathf.Max(carSetting.idleRPM, num3) : Mathf.Lerp(carSetting.idleRPM, engineRedline, num4)));
			motorRPM = Mathf.MoveTowards(motorRPM, num5, 10000f * Time.fixedDeltaTime);
			curTorque = FiatTorqueAt(motorRPM);
			float num6 = curTorque * num * drivetrainEfficiency * num4;
			if (!isOn || NeutralGear || brake || Time.time < fiatShiftUntil || num3 >= engineRedline)
			{
				num6 = 0f;
			}
			float num7 = ((currentGear != 0) ? carSetting.LimitForwardSpeed : carSetting.LimitBackwardSpeed);
			num6 *= Mathf.Clamp01((num7 + 2f - speed) / 2f);
			float num8 = 0f;
			if (useFiat131RallyPhysics && !NeutralGear)
			{
				float num9 = Mathf.Abs(num6) * 0.5f * Mathf.Clamp01(limitedSlipLock);
				num8 = Mathf.Clamp((wheels[3].collider.rpm - wheels[2].collider.rpm) * 1.2f, 0f - num9, num9);
			}
			float num10 = Mathf.Clamp01(0f - accel);
			for (int i = 0; i < wheels.Length; i++)
			{
				WheelCollider collider = wheels[i].collider;
				collider.motorTorque = ((!wheels[i].drive) ? 0f : (num6 * 0.5f));
				if (useFiat131RallyPhysics && i >= 2 && wheels[i].drive)
				{
					collider.motorTorque += ((i != 2) ? (0f - num8) : num8);
				}
				collider.brakeTorque = num10 * carSetting.brakePower * ((i < 2) ? ((!useFiat131RallyPhysics) ? 0.65f : 0.6f) : ((!useFiat131RallyPhysics) ? 0.35f : 0.4f));
				if (brake && i >= 2)
				{
					collider.brakeTorque = Mathf.Max(collider.brakeTorque, (!useFiat131RallyPhysics) ? 900f : 1500f);
				}
				if (!NeutralGear && wheels[i].drive && num4 < 0.01f && speed > 1f)
				{
					collider.brakeTorque += ((!useFiat131RallyPhysics) ? 8f : 14f) * Mathf.Abs(num) * drivetrainEfficiency * 0.5f;
				}
				SetFiatFriction(collider);
				float num11 = Mathf.Clamp(steer, -1f, 1f) * carSetting.maxSteerAngle;
				if (i < 2 && Mathf.Abs(num11) > 0.01f)
				{
					float num12 = fiatWheelbase / Mathf.Tan(Mathf.Abs(num11) * ((float)Math.PI / 180f));
					bool flag = (num11 > 0f && i == 0) || (num11 < 0f && i == 1);
					collider.steerAngle = Mathf.Sign(num11) * Mathf.Atan(fiatWheelbase / Mathf.Max(0.5f, num12 + ((!flag) ? 0.5f : (-0.5f)) * fiatTrack)) * 57.29578f;
				}
				else
				{
					collider.steerAngle = 0f;
				}
			}
			Vector3 velocity = myRigidbody.velocity;
			float magnitude = ((Vector3)(ref velocity)).magnitude;
			if (magnitude > 0.01f)
			{
				bool flag2 = false;
				WheelComponent[] array = wheels;
				foreach (WheelComponent wheelComponent in array)
				{
					flag2 |= wheelComponent.collider.isGrounded;
				}
				float num13 = 0.6125f * dragArea * magnitude * magnitude;
				if (flag2)
				{
					float num14 = num13;
					float num15 = rollingResistance * myRigidbody.mass;
					Vector3 gravity = Physics.gravity;
					num13 = num14 + num15 * ((Vector3)(ref gravity)).magnitude;
				}
				num13 = Mathf.Min(num13, myRigidbody.mass * magnitude / Time.fixedDeltaTime);
				myRigidbody.AddForce(-((Vector3)(ref velocity)).normalized * num13);
			}
		}

		private void SetFiatFriction(WheelCollider col)
		{
			//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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			WheelFrictionCurve forwardFriction = col.forwardFriction;
			((WheelFrictionCurve)(ref forwardFriction)).extremumSlip = 0.35f;
			((WheelFrictionCurve)(ref forwardFriction)).extremumValue = 1f;
			((WheelFrictionCurve)(ref forwardFriction)).asymptoteSlip = 0.8f;
			((WheelFrictionCurve)(ref forwardFriction)).asymptoteValue = 0.75f;
			((WheelFrictionCurve)(ref forwardFriction)).stiffness = carSetting.stiffness;
			col.forwardFriction = forwardFriction;
			((WheelFrictionCurve)(ref forwardFriction)).extremumSlip = 0.2f;
			((WheelFrictionCurve)(ref forwardFriction)).asymptoteSlip = 0.5f;
			col.sidewaysFriction = forwardFriction;
		}

		public Rigidbody GetRigidbody()
		{
			return myRigidbody;
		}

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

		private void Awake()
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			if (carSetting.automaticGear)
			{
				NeutralGear = false;
			}
			myRigidbody = ((Component)((Component)this).transform).GetComponent<Rigidbody>();
			wheels = new WheelComponent[4];
			wheels[0] = SetWheelComponent(carWheels.wheels.frontRight, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontRight.position.y, carWheels.wheels.frontSetting);
			wheels[1] = SetWheelComponent(carWheels.wheels.frontLeft, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontLeft.position.y, carWheels.wheels.frontSetting);
			wheels[2] = SetWheelComponent(carWheels.wheels.backRight, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backRight.position.y, carWheels.wheels.rearSetting);
			wheels[3] = SetWheelComponent(carWheels.wheels.backLeft, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backLeft.position.y, carWheels.wheels.rearSetting);
			if (useFiat131Physics)
			{
				Vector3 val = (wheels[0].startPos + wheels[1].startPos) * 0.5f;
				Vector3 val2 = (wheels[2].startPos + wheels[3].startPos) * 0.5f;
				fiatWheelbase = Mathf.Abs(val.z - val2.z);
				fiatTrack = Mathf.Abs(wheels[0].startPos.x - wheels[1].startPos.x);
				fiatLastGear = currentGear;
				fiatLastNeutral = NeutralGear;
			}
			if (Object.op_Implicit((Object)(object)carSetting.carSteer))
			{
				steerCurAngle = carSetting.carSteer.localEulerAngles;
			}
			WheelComponent[] array = wheels;
			foreach (WheelComponent wheelComponent in array)
			{
				WheelCollider collider = wheelComponent.collider;
				collider.suspensionDistance = wheelComponent.settings.Distance;
				JointSpring suspensionSpring = collider.suspensionSpring;
				suspensionSpring.spring = carSetting.springs;
				suspensionSpring.damper = carSetting.dampers;
				collider.suspensionSpring = suspensionSpring;
				collider.radius = wheelComponent.settings.Radius;
				collider.mass = wheelComponent.settings.Weight;
				WheelFrictionCurve val3 = collider.forwardFriction;
				((WheelFrictionCurve)(ref val3)).asymptoteValue = 5000f;
				((WheelFrictionCurve)(ref val3)).extremumSlip = 2f;
				((WheelFrictionCurve)(ref val3)).asymptoteSlip = 20f;
				((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness;
				collider.forwardFriction = val3;
				val3 = collider.sidewaysFriction;
				((WheelFrictionCurve)(ref val3)).asymptoteValue = 7500f;
				((WheelFrictionCurve)(ref val3)).asymptoteSlip = 2f;
				((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness;
				collider.sidewaysFriction = val3;
				if (useFiat131Physics)
				{
					SetFiatFriction(collider);
				}
			}
		}

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

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

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

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

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

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

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

		private void Update()
		{
		}

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

		private void OnDrawGizmos()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			if (carSetting.showNormalGizmos && !Application.isPlaying)
			{
				Matrix4x4 matrix = Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.lossyScale);
				Gizmos.matrix = matrix;
				Gizmos.color = new Color(1f, 0f, 0f, 0.5f);
				Gizmos.DrawCube(Vector3.up / 1.5f, new Vector3(2.5f, 2f, 6f));
				Gizmos.DrawSphere(carSetting.shiftCentre / ((Component)this).transform.lossyScale.x, 0.2f);
			}
		}
	}
	public class enginestartsound : MonoBehaviour
	{
		public GameObject button;

		public GameObject sound;

		public VehicleControl vehicle;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			if (button.transform.localEulerAngles.x >= 45f && !vehicle.isOn)
			{
				sound.SetActive(true);
			}
			else if (button.transform.localEulerAngles.x < 45f || vehicle.isOn)
			{
				sound.SetActive(false);
			}
		}
	}
	public class gunpodtrigger : MonoBehaviour
	{
		public FVRInteractiveObject obj;

		public GameObject trigger;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)obj.m_hand != (Object)null)
			{
				if (obj.m_hand.Input.TriggerPressed)
				{
					trigger.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
				}
				else
				{
					trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
			}
			else
			{
				trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class GrabToUnlock : MonoBehaviour
	{
		public Rigidbody rig;

		public Transform Lockpoint;

		public FVRInteractiveObject Grab;

		private void Update()
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			if (Grab.m_isHeld)
			{
				rig.isKinematic = false;
			}
			if (!Grab.m_isHeld)
			{
				rig.isKinematic = true;
				((Component)rig).gameObject.transform.SetParent(Lockpoint);
				((Component)rig).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
				((Component)rig).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class SlotFixer : MonoBehaviour
	{
		public FVRQuickBeltSlot Slot;

		public Transform FixPos;

		public string Name;

		private void Update()
		{
			//IL_006f: 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)
			if ((Object)(object)Slot.CurObject != (Object)null)
			{
				if (((Object)((Component)Slot.CurObject).gameObject).name == Name && !((FVRInteractiveObject)Slot.CurObject).m_isHeld)
				{
					((Component)Slot.CurObject).gameObject.transform.position = FixPos.position;
					((Component)Slot.CurObject).gameObject.transform.eulerAngles = FixPos.eulerAngles;
				}
				if (((Object)((Component)Slot.CurObject).gameObject).name != Name)
				{
					Slot.CurObject.m_quickbeltSlot = null;
					Slot.CurObject = null;
				}
			}
		}
	}
	public class Bikehandle : MonoBehaviour
	{
		public GameObject fakebikeh;

		public GameObject realbikeh;

		public ConstantForce forceR;

		public ConstantForce forceF;

		public float forcesize;

		private void Update()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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)
			fakebikeh.transform.localEulerAngles = new Vector3(0f, realbikeh.transform.localEulerAngles.y, 0f);
			if (fakebikeh.transform.localEulerAngles.y >= 2.5f && fakebikeh.transform.localEulerAngles.y <= 35f)
			{
				forceF.relativeForce = new Vector3(forcesize, 0f, 0f);
				forceR.relativeForce = new Vector3(forcesize, 0f, 0f);
			}
			if (fakebikeh.transform.localEulerAngles.y <= 357.5f && fakebikeh.transform.localEulerAngles.y >= 325f)
			{
				forceF.relativeForce = new Vector3(0f - forcesize, 0f, 0f);
				forceR.relativeForce = new Vector3(0f - forcesize, 0f, 0f);
			}
			if (fakebikeh.transform.localEulerAngles.y < 2.5f || fakebikeh.transform.localEulerAngles.y > 357.5f)
			{
				forceF.relativeForce = new Vector3(0f, 0f, 0f);
				forceR.relativeForce = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class moveGC : MonoBehaviour
	{
		public VehicleControl vc;

		public GameObject trackinghead;

		private float move;

		private void Update()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_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_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_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			if (vc.isOn)
			{
				if (trackinghead.transform.localPosition.x > 0.15f)
				{
					move = trackinghead.transform.localPosition.x;
					vc.carSetting.shiftCentre = new Vector3(move, 0.25f, 0.3f);
					if (move > 0.2f)
					{
						move = 0.2f;
					}
				}
				if (trackinghead.transform.localPosition.x < -0.15f)
				{
					move = trackinghead.transform.localPosition.x;
					vc.carSetting.shiftCentre = new Vector3(move, 0.25f, 0.3f);
					if (move < -0.2f)
					{
						move = -0.2f;
					}
				}
			}
			if (!vc.isOn || (trackinghead.transform.localPosition.x > -0.15f && trackinghead.transform.localPosition.x < 0.15f))
			{
				vc.carSetting.shiftCentre = new Vector3(0f, 0.25f, 0.3f);
			}
		}
	}
	public class speedlimit : MonoBehaviour
	{
		public HingeJoint joint;

		public float limit;

		public VehicleControl vehicle;

		public GameObject needle;

		public bool isImperial;

		public float maxSpeed;

		public Vector3 needleNoSpeed;

		public Vector3 needleMaxSpeed;

		public void Update()
		{
			//IL_0045: 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_0051: 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)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Abs(vehicle.speed);
			if (isImperial)
			{
				num *= 0.6213712f;
			}
			float num2 = Mathf.InverseLerp(0f, maxSpeed, num);
			needle.transform.localEulerAngles = Vector3.Lerp(needleNoSpeed, needleMaxSpeed, num2);
			JointLimits limits = joint.limits;
			((JointLimits)(ref limits)).min = needle.transform.localEulerAngles.x - limit;
			((JointLimits)(ref limits)).max = limit - needle.transform.localEulerAngles.x;
			joint.limits = limits;
		}
	}
	public class FIATSAR : MonoBehaviour
	{
		public Rigidbody RIG;

		public FSO125P Vehicle;

		[Header("RPM Digits (Text)")]
		public Text rpmThousands;

		public Text rpmHundreds;

		public Text rpmTens;

		public Text rpmOnes;

		[Header("Speed Needle (Transform)")]
		public Transform speedNeedle;

		public float minX = 0f;

		public float maxX = 180f;

		public float minSpeed = 0f;

		public float maxSpeed = 180f;

		private void Update()
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: 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_0198: Unknown result type (might be due to invalid IL or missing references)
			int num = Mathf.RoundToInt(Vehicle.currentRPM);
			num = Mathf.Clamp(num, 0, (!((Object)(object)((Component)Vehicle).GetComponent<Fiat131EasyDrive>() != (Object)null)) ? 7000 : 8200);
			int num2 = num / 1000;
			int num3 = num % 1000 / 100;
			int num4 = num % 100 / 10;
			int num5 = num % 10;
			if ((Object)(object)rpmThousands != (Object)null)
			{
				rpmThousands.text = num2.ToString();
			}
			if ((Object)(object)rpmHundreds != (Object)null)
			{
				rpmHundreds.text = num3.ToString();
			}
			if ((Object)(object)rpmTens != (Object)null)
			{
				rpmTens.text = num4.ToString();
			}
			if ((Object)(object)rpmOnes != (Object)null)
			{
				rpmOnes.text = num5.ToString();
			}
			if ((Object)(object)speedNeedle != (Object)null)
			{
				Vector3 velocity = RIG.velocity;
				float num6 = ((Vector3)(ref velocity)).magnitude * ((!((Object)(object)((Component)Vehicle).GetComponent<Fiat131EasyDrive>() != (Object)null)) ? 2.7f : 3.6f);
				float num7 = Mathf.InverseLerp(minSpeed, maxSpeed, num6);
				float x = Mathf.Lerp(minX, maxX, num7);
				Vector3 localPosition = speedNeedle.localPosition;
				localPosition.x = x;
				speedNeedle.localPosition = localPosition;
			}
		}
	}
	public class FIATSteeringWheel : FVRInteractiveObject
	{
		public float resetLerpSpeed;

		public float maxRot;

		public bool reverseRot;

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

		public float rot;

		public float rh;

		public float lr;

		public float inlerp;

		public float lerp;

		public float rotAmt;

		public float CurSteer;

		public override void BeginInteraction(FVRViveHand hand)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).BeginInteraction(hand);
			Fiat131SteeringInput component = ((Component)this).GetComponent<Fiat131SteeringInput>();
			if (!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled)
			{
				Transform child = ((Component)this).transform.GetChild(0);
				child.parent = null;
				Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
				((Component)this).transform.LookAt(((Component)hand).transform);
				((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, localEulerAngles.z);
				child.parent = ((Component)this).transform;
			}
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			//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_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)
			((FVRInteractiveObject)this).EndInteraction(hand);
			Fiat131SteeringInput component = ((Component)this).GetComponent<Fiat131SteeringInput>();
			if (!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled)
			{
				Transform child = ((Component)this).transform.GetChild(0);
				child.parent = null;
				((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, 0f, ((Component)this).transform.localEulerAngles.z);
				child.parent = ((Component)this).transform;
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).UpdateInteraction(hand);
			Fiat131SteeringInput component = ((Component)this).GetComponent<Fiat131SteeringInput>();
			if (!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled)
			{
				Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
				((Component)this).transform.LookAt(((Component)hand).transform);
				Vector3 localEulerAngles2 = ((Component)this).transform.localEulerAngles;
				rot = Mathf.DeltaAngle((float)Math.Round(localEulerAngles2.y), (float)Math.Round(localEulerAngles.y));
				rotAmt += rot;
				if (rotAmt >= maxRot)
				{
					rotAmt = maxRot;
					((Component)this).transform.localEulerAngles = localEulerAngles;
				}
				else if (rotAmt <= 0f - maxRot)
				{
					rotAmt = 0f - maxRot;
					((Component)this).transform.localEulerAngles = localEulerAngles;
				}
				else
				{
					((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles2.y, localEulerAngles.z);
				}
				rh = localEulerAngles2.y;
				lr = localEulerAngles.y;
				CurSteer = SetRot();
			}
		}

		private float SetRot()
		{
			bool flag = rotAmt <= 0f;
			lerp = Mathf.Abs(rotAmt) / maxRot;
			lerp *= -1f;
			if (flag)
			{
				lerp *= -1f;
			}
			if (reverseRot)
			{
				lerp = 0f - lerp;
			}
			if ((Object)(object)rotText != (Object)null)
			{
				rotText.text = lerp.ToString();
			}
			return lerp;
		}
	}
	public class FSO125P : MonoBehaviour
	{
		public GameObject HBGeo;

		public FVRInteractiveObject grabobjHB;

		public GameObject HandRefHB;

		public bool IsIgniting;

		public GameObject IgnitionKeyHole;

		public FVRInteractiveObject IgnitionInt;

		public FIATSteeringWheel SteeringwheelInt;

		public FVRInteractiveObject DriveShiftInt;

		public GameObject HandRef;

		public bool shiftPressed;

		public bool altPressed;

		public GameObject SteeringWheelGeo;

		public float StallCD = 0.1f;

		public int PrevGear = -1;

		public Rigidbody CarRig;

		public float MaxVel = 75f;

		public Transform CarMassC;

		public GameObject WheelGeoLF;

		public GameObject WheelGeoRF;

		public GameObject WheelGeoLR;

		public GameObject WheelGeoRR;

		public WheelCollider WheelColLF;

		public WheelCollider WheelColRF;

		public WheelCollider WheelColLR;

		public WheelCollider WheelColRR;

		public AudioSource EngineIdle;

		public AudioSource EngineOn;

		public AudioSource EngineOff;

		public AudioSource ShiftGear;

		public AudioSource HandBrakeOn;

		public AudioSource HandBrakeOff;

		public float EnginePower = 100f;

		public float MaxRPM = 6000f;

		public float currentRPM;

		public float curRPMRef;

		public float curRPMRef2;

		public float torque;

		public float torqueRef;

		public float wheelTorque;

		public AnimationCurve torqueCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[6]
		{
			new Keyframe(1000f, 80f),
			new Keyframe(2000f, 110f),
			new Keyframe(3000f, 125f),
			new Keyframe(4000f, 130f),
			new Keyframe(5000f, 120f),
			new Keyframe(6000f, 100f)
		});

		public float maxTorque = 250f;

		public float idleRPM = 900f;

		private float clutchInput;

		public bool isclutchstepped;

		public float finalDriveRatio = 4.1f;

		public float[] gearRatios = new float[6] { -3.8f, 0f, 3.75f, 2.12f, 1.36f, 1f };

		private float throttleInput;

		public GameObject shiftGeo;

		public GameObject GearGeo;

		public GameObject Gear1Failed;

		public GameObject Gear2Failed;

		public GameObject Gear3Failed;

		public GameObject Gear4Failed;

		public GameObject GearRFailed;

		public GameObject Left;

		public GameObject Right;

		public GameObject Middle;

		public float MaxSteer = 35f;

		public float curSteer;

		public float curSteerRef;

		public float speedlim = 200f;

		public float steerMul = 2.5f;

		public float ShiftCD = 1f;

		public float BrakeForce = 1000f;

		public float HandBrakeForce = 1500f;

		public float BrakeInput;

		public float curVel;

		public bool isEngineOn;

		public bool isIgnited;

		public bool isHandBrakeOn;

		public bool isHBToggled;

		public int curGear = 1;

		public bool shifted;

		public float RPMRef;

		public float RPMRefref;

		public GameObject ReverseLight;

		public GameObject BrakeLight;

		public GameObject LightTotal;

		public Vector3 WLFPos;

		public Vector3 WLRPos;

		public Vector3 WRFPos;

		public Vector3 WRRPos;

		public Quaternion WLFRot;

		public Quaternion WLRRot;

		public Quaternion WRFRot;

		public Quaternion WRRRot;

		public float rotLF;

		public float rotLR;

		public float rotRF;

		public float rotRR;

		public float rotLF2;

		public float rotRF2;

		public float maxspeed;

		public float upforce;

		public float rotforce;

		public void Start()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			Fiat131EasyDrive component = ((Component)this).GetComponent<Fiat131EasyDrive>();
			if (!((Object)(object)component != (Object)null) || !((Behaviour)component).enabled)
			{
				CarRig.centerOfMass = ((Component)CarMassC).transform.position;
				CarRig.ResetCenterOfMass();
			}
		}

		private void AxisLookAtXZ(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 AxisLookAtY(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_006a: 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, 0f, 0f);
		}

		private void Update()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a9: 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_04c2: Unknown result type (might be due to i