Decompiled source of Modmas 2024 Week 2 v1.0.1

Tarkov_9x39.dll

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

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace NotWolfie.Tarkov_9x39;

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "NotWolfie.Tarkov_9x39");
		OtherLoader.RegisterDirectLoad(BasePath, "NotWolfie.Tarkov_9x39", "", "9x39", "", "");
	}
}
public enum ControlMode
{
	simple = 1,
	touch
}
public class VehicleControl : MonoBehaviour
{
	[Serializable]
	public class CarWheels
	{
		public ConnectWheel wheels;
	}

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

		public Transform frontRight;

		public Transform frontLeft;

		public WheelSetting frontSetting;

		public bool backWheelDrive = true;

		public Transform backRight;

		public Transform backLeft;

		public WheelSetting rearSetting;
	}

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

		public float Weight = 1000f;

		public float Distance = 0.2f;
	}

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

		public Light[] reverseLights;
	}

	[Serializable]
	public class CarSounds
	{
		public AudioSource IdleEngine;

		public AudioSource LowEngine;

		public AudioSource HighEngine;

		public float minPitch = 1f;

		public float maxPitch = 10f;

		public AudioSource nitro;

		public AudioSource switchGear;
	}

	[Serializable]
	public class CarParticles
	{
		public GameObject brakeParticlePerfab;

		public ParticleSystem shiftParticle1;

		public ParticleSystem shiftParticle2;

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

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

		public Transform carSteer;

		public HitGround[] hitGround;

		public List<Transform> cameraSwitchView;

		public float springs = 25000f;

		public float dampers = 1500f;

		public float carPower = 120f;

		public float shiftPower = 150f;

		public float brakePower = 8000f;

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

		public float maxSteerAngle = 25f;

		public float shiftDownRPM = 1500f;

		public float shiftUpRPM = 2500f;

		public float idleRPM = 500f;

		public float stiffness = 2f;

		public bool automaticGear = true;

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

		public float LimitBackwardSpeed = 60f;

		public float LimitForwardSpeed = 220f;
	}

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

		public bool grounded = false;

		public AudioClip brakeSound;

		public AudioClip groundSound;

		public Color brakeColor;
	}

	private class WheelComponent
	{
		public Transform wheel;

		public WheelCollider collider;

		public Vector3 startPos;

		public float rotation = 0f;

		public float rotation2 = 0f;

		public float maxSteer;

		public bool drive;

		public float pos_y = 0f;

		public WheelSetting settings;
	}

	public ControlMode controlMode = ControlMode.simple;

	public bool activeControl = false;

	public CarWheels carWheels;

	public CarLights carLights;

	public CarSounds carSounds;

	public CarParticles carParticles;

	public CarSetting carSetting;

	[HideInInspector]
	public float steer = 0f;

	[HideInInspector]
	public float accel = 0f;

	[HideInInspector]
	public bool brake;

	private bool shifmotor;

	[HideInInspector]
	public float curTorque = 100f;

	[HideInInspector]
	public float powerShift = 100f;

	[HideInInspector]
	public bool shift;

	private float torque = 100f;

	[HideInInspector]
	public float speed = 0f;

	private float lastSpeed = -10f;

	private bool shifting = false;

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

	private float efficiencyTableStep = 250f;

	private float Pitch;

	private float PitchDelay;

	private float shiftTime = 0f;

	private float shiftDelay = 0f;

	[HideInInspector]
	public int currentGear = 0;

	[HideInInspector]
	public bool NeutralGear = true;

	[HideInInspector]
	public float motorRPM = 0f;

	[HideInInspector]
	public bool Backward = false;

	[HideInInspector]
	public float accelFwd = 0f;

	[HideInInspector]
	public float accelBack = 0f;

	[HideInInspector]
	public float steerAmount = 0f;

	private float wantedRPM = 0f;

	private float w_rotate;

	private float slip;

	private float slip2 = 0f;

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

	private Vector3 steerCurAngle;

	private Rigidbody myRigidbody;

	private WheelComponent[] wheels;

	public bool isOn = true;

	public bool isForciblyOff = false;

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

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

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

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

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

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

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

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

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

	private void Update()
	{
	}

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

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

NO74_MKII_StickyGrenade.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using ToxicGasFramework;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.PostProcessing;
using UnityEngine.Rendering;
using UnityEngine.UI;

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

		public GameObject muzzleinterface;

		public bool scaled = false;

		public bool magscaled = false;

		public bool clipscaled = false;

		public FVRFireArm firearm;

		public Vector3 scaleoriginal;

		public Vector3 magscaleoriginal;

		public Vector3 clipscaleoriginal;

		public FVRPhysicalObjectSize size;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: 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_0278: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)firearm == (Object)null || (Object)(object)((FVRFireArmAttachment)muzzledevice).curMount == (Object)null || (Object)(object)((FVRFireArmAttachment)muzzledevice).curMount.Parent == (Object)null || (Object)(object)firearm.Magazine == (Object)null || (Object)(object)firearm.Clip == (Object)null)
			{
			}
			if ((Object)(object)firearm != (Object)null && !scaled)
			{
				scaleoriginal = ((Component)firearm).gameObject.transform.localScale;
				size = ((FVRPhysicalObject)firearm).Size;
				scaled = true;
			}
			if ((Object)(object)firearm != (Object)null && !magscaled && (Object)(object)firearm.Magazine != (Object)null)
			{
				magscaleoriginal = ((Component)firearm.Magazine).gameObject.transform.localScale;
				magscaled = true;
			}
			if ((Object)(object)firearm != (Object)null && !clipscaled && (Object)(object)firearm.Clip != (Object)null)
			{
				clipscaleoriginal = ((Component)firearm.Clip).gameObject.transform.localScale;
				clipscaled = true;
			}
			if ((Object)(object)((FVRFireArmAttachment)muzzledevice).curMount != (Object)null && ((FVRFireArmAttachment)muzzledevice).curMount.AttachmentsList.Count > 0)
			{
				firearm = ((Component)((FVRFireArmAttachment)muzzledevice).curMount.Parent).GetComponent<FVRFireArm>();
				if ((Object)(object)firearm.Magazine == (Object)null)
				{
					magscaled = false;
				}
				if ((Object)(object)firearm.Clip == (Object)null)
				{
					clipscaled = false;
				}
				if (1f - 5f * (muzzledevice.CatchRot / 360f) / 6f <= 0f)
				{
					((FVRPhysicalObject)firearm).Size = (FVRPhysicalObjectSize)0;
				}
				if (1f - 5f * (muzzledevice.CatchRot / 360f) / 6f > 0f)
				{
					((FVRPhysicalObject)firearm).Size = size;
				}
				((Component)firearm).gameObject.transform.localScale = scaleoriginal * (1f - 5f * (muzzledevice.CatchRot / 360f) / 6f);
			}
			if ((Object)(object)((FVRFireArmAttachment)muzzledevice).curMount != (Object)null && ((FVRFireArmAttachment)muzzledevice).curMount.AttachmentsList.Count < 1)
			{
				firearm = null;
				scaled = false;
			}
		}
	}
	public class SlingHoster : MonoBehaviour
	{
		public FVRPhysicalObject mainobj;

		public WaggleJoint joint1;

		public GameObject geo1;

		public GameObject geo2;

		public WaggleJoint joint2;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)mainobj.m_quickbeltSlot != (Object)null && !((FVRInteractiveObject)mainobj).m_isHeld)
			{
				((Behaviour)joint1).enabled = true;
				((Behaviour)joint2).enabled = true;
				return;
			}
			((Behaviour)joint1).enabled = false;
			((Behaviour)joint2).enabled = false;
			geo1.transform.localEulerAngles = new Vector3(270f, 0f, 0f);
			geo2.transform.localEulerAngles = new Vector3(270f, 0f, 0f);
		}
	}
	public class meleewithhealth : MonoBehaviour
	{
		public meleewithhealth nextmwh;

		public FVRPhysicalObject melee;

		public bool spawnblade = false;

		public GameObject brokenBlade;

		public Transform bladeBreakPos;

		public float totalHealth = 100f;

		public GameObject Prefab;

		public bool havenext = true;

		public GameObject nextPrefab;

		public float damX;

		public float damY;

		public float damZ;

		private bool broke = false;

		public void Awake()
		{
		}

		public void OnCollisionEnter(Collision col)
		{
			totalHealth -= Random.Range(1f, 2f);
		}

		private void Update()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			if (Prefab.activeInHierarchy)
			{
				melee.MP.BaseDamageBCP = new Vector3(damX, damY, damZ);
				melee.MP.HighDamageBCP = new Vector3(damX, damY, damZ);
			}
			if (totalHealth > 0f)
			{
				Prefab.SetActive(true);
				nextPrefab.SetActive(false);
				((Behaviour)nextmwh).enabled = false;
			}
			else if (totalHealth < 0f)
			{
				totalHealth = 0f;
			}
			else if (totalHealth == 0f)
			{
				if (havenext)
				{
					Prefab.SetActive(false);
					nextPrefab.SetActive(true);
					((Behaviour)nextmwh).enabled = true;
				}
				if (spawnblade && !broke)
				{
					Object.Instantiate<GameObject>(brokenBlade, ((Component)bladeBreakPos).transform.position, ((Component)bladeBreakPos).transform.rotation);
					broke = true;
				}
				((Behaviour)this).enabled = false;
			}
		}
	}
	public class Syringe : FVRFireArmAttachment
	{
		public enum CartridgeState
		{
			Whole,
			BitOpen,
			Jammed
		}

		public List<Renderer> Rends;

		public CartridgeState CState;

		public int numPowderChunksLeft = 20;

		public AudioEvent AudEvent_Bite;

		public AudioEvent AudEvent_Tap;

		public Transform PowderSpawnPoint;

		public GameObject PowderPrefab;

		public GameObject BitPart;

		public AudioEvent AudEvent_Spit;

		public GameObject Splode;

		[NonSerialized]
		public bool m_isDestroyed;

		[NonSerialized]
		public float m_tickDownToSpit = 0.2f;

		[NonSerialized]
		public bool m_tickingDownToSpit;

		[NonSerialized]
		public float timeSinceSpawn = 1f;

		public PowerupType put;

		public PowerUpIntensity pui;

		public PowerUpDuration pud;

		public AudioEvent AudEvent_DIng;

		public FVRPhysicalObject PenObject;

		public bool isAlreadyInHeadRange = false;

		public bool isUsed = false;

		public KillAfter ka;

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

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

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

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

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

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

		public List<Renderer> Rends;

		public CartridgeState CState;

		public int numPowderChunksLeft = 20;

		public AudioEvent AudEvent_Bite;

		public AudioEvent AudEvent_Tap;

		public Transform PowderSpawnPoint;

		public GameObject PowderPrefab;

		public GameObject BitPart;

		public AudioEvent AudEvent_Spit;

		public GameObject Splode;

		[NonSerialized]
		public bool m_isDestroyed;

		[NonSerialized]
		public float m_tickDownToSpit = 0.2f;

		[NonSerialized]
		public bool m_tickingDownToSpit;

		[NonSerialized]
		public float timeSinceSpawn = 1f;

		public PowerupType put;

		public PowerUpIntensity pui;

		public PowerUpDuration pud;

		public AudioEvent AudEvent_DIng;

		public FVRPhysicalObject PenObject;

		public bool isAlreadyInHeadRange = false;

		public bool isUsed = false;

		public KillAfter ka;

		public Transform needletip;

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

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

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

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

		private void Update()
		{
			//IL_003d: 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_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Invalid comparison between Unknown and I4
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Invalid comparison between Unknown and I4
			if ((Object)(object)((FVRInteractiveObject)PenObject).m_hand != (Object)null && ((Object)((FVRInteractiveObject)PenObject).m_hand).name == "Controller (left)")
			{
				float num = Vector3.Distance(needletip.position, ((Component)GM.CurrentPlayerBody.RightHand).transform.position);
				if ((double)num >= 0.07500000298023224)
				{
					isAlreadyInHeadRange = false;
				}
				if ((double)num < 0.05000000074505806)
				{
					if (!isAlreadyInHeadRange && (int)CState == 1 && !isUsed)
					{
						PowerUp(((FVRInteractiveObject)PenObject).m_hand);
						Console.Write("Oof");
						isUsed = true;
					}
					isAlreadyInHeadRange = true;
				}
			}
			if (!((Object)(object)((FVRInteractiveObject)PenObject).m_hand != (Object)null) || !(((Object)((FVRInteractiveObject)PenObject).m_hand).name == "Controller (right)"))
			{
				return;
			}
			float num2 = Vector3.Distance(needletip.position, ((Component)GM.CurrentPlayerBody.LeftHand).transform.position);
			if ((double)num2 >= 0.07500000298023224)
			{
				isAlreadyInHeadRange = false;
			}
			if ((double)num2 < 0.07500000298023224)
			{
				if (!isAlreadyInHeadRange && (int)CState == 1 && !isUsed)
				{
					PowerUp(((FVRInteractiveObject)PenObject).m_hand);
					Console.Write("Oof");
					isUsed = true;
				}
				isAlreadyInHeadRange = true;
			}
		}

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

		public AttachableClosedBoltWeapon weapon;

		public bool buttonpressed = false;

		public void Update()
		{
			if ((Object)(object)((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand != (Object)null && ((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand.IsInStreamlinedMode)
			{
				if (((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand.Input.BYButtonPressed)
				{
					if (bolt.m_isBoltLocked)
					{
						weapon.IsBoltReleaseButtonHeld = true;
					}
					else if (!bolt.m_isBoltLocked && !buttonpressed)
					{
						weapon.ToggleFireSelector();
						buttonpressed = true;
					}
				}
				else if (!((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand.Input.BYButtonPressed)
				{
					if (bolt.m_isBoltLocked)
					{
						weapon.IsBoltReleaseButtonHeld = false;
					}
					buttonpressed = false;
				}
			}
			if (weapon.HasBoltReleaseButton && weapon.IsBoltReleaseButtonHeld)
			{
				bolt.ReleaseBolt();
			}
		}
	}
	public class control_component : MonoBehaviour
	{
		public GameObject Comp;

		public GameObject Comp2;

		public GameObject Rot;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (Rot.transform.localEulerAngles.x >= 45f)
			{
				Comp.SetActive(false);
				Comp2.SetActive(true);
			}
			else
			{
				Comp.SetActive(true);
				Comp2.SetActive(false);
			}
		}
	}
	public class controll_component : MonoBehaviour
	{
		public GameObject Comp;

		public GameObject Rot;

		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)
			if (Rot.transform.localEulerAngles.y > 10f && Rot.transform.localEulerAngles.y < -10f)
			{
				Comp.SetActive(false);
			}
			else
			{
				Comp.SetActive(true);
			}
		}
	}
	public class M112C4 : MonoBehaviour
	{
		public GameObject C4explosion;

		public GameObject C4explode;

		public Transform exppos;

		public GameObject MainObj;

		public bool shouldIgoBoom = false;

		public GameObject fuze;

		public StickyObj stkobj;

		public Transform mainpos;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).gameObject.transform.position = ((Component)mainpos).transform.position;
			((Component)this).gameObject.transform.eulerAngles = ((Component)mainpos).transform.eulerAngles;
			if (!((Object)(object)fuze == (Object)null) && (Object)(object)fuze != (Object)null)
			{
				stkobj.fuzed = true;
			}
			if (shouldIgoBoom)
			{
				Object.Instantiate<GameObject>(C4explode, ((Component)exppos).transform.position, ((Component)exppos).transform.rotation);
				Object.Instantiate<GameObject>(C4explosion, ((Component)exppos).transform.position, ((Component)exppos).transform.rotation);
				Object.Destroy((Object)(object)MainObj);
				Object.Destroy((Object)(object)((Component)this).gameObject);
				shouldIgoBoom = false;
			}
		}
	}
	public class M114Fuze : MonoBehaviour
	{
		public GameObject clickbase;

		public GameObject safety;

		public GameObject ring;

		public GameObject ringpos;

		public bool pulledring = false;

		public Transform mainpos;

		public GameObject fuzeinsertrot;

		public GameObject FuzeExplosion;

		public GameObject FuzeExplode;

		public Transform exppos;

		public M112C4 C4;

		public GameObject fakepoint;

		public GameObject aud;

		public bool immaBlowUP = false;

		public GameObject mainobj;

		public Collider col;

		public Collider grabcol;

		public Rigidbody mainrig;

		public FVRPhysicalObject mainphys;

		public bool imstickedin = false;

		private void Start()
		{
			aud.SetActive(false);
			fakepoint.SetActive(false);
		}

		private void OnTriggerEnter(Collider other)
		{
			if (!imstickedin && (Object)(object)mainphys.m_quickbeltSlot == (Object)null && (Object)(object)((Component)other).gameObject.GetComponent<M112C4>() != (Object)null)
			{
				C4 = ((Component)other).gameObject.GetComponent<M112C4>();
				imstickedin = true;
			}
		}

		private void Update()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)clickbase == (Object)null)
			{
			}
			if (safety.transform.localEulerAngles.x > 50f && (Object)(object)clickbase != (Object)null)
			{
				Object.Destroy((Object)(object)clickbase);
			}
			((Component)this).gameObject.transform.position = mainpos.position;
			((Component)this).gameObject.transform.eulerAngles = mainpos.eulerAngles;
			if (!imstickedin && safety.transform.localEulerAngles.x > 45f)
			{
				if (!pulledring)
				{
					Object.Instantiate<GameObject>(ring, ringpos.transform.position, ringpos.transform.rotation);
					pulledring = true;
				}
				if (immaBlowUP && (Object)(object)mainphys.m_quickbeltSlot == (Object)null)
				{
					Object.Instantiate<GameObject>(FuzeExplode, ((Component)exppos).transform.position, ((Component)exppos).transform.rotation);
					Object.Instantiate<GameObject>(FuzeExplosion, ((Component)exppos).transform.position, ((Component)exppos).transform.rotation);
					Object.Destroy((Object)(object)mainobj);
					Object.Destroy((Object)(object)((Component)this).gameObject);
					immaBlowUP = false;
				}
			}
			if ((Object)(object)C4 != (Object)null && imstickedin)
			{
				col.enabled = false;
				grabcol.enabled = false;
				((FVRInteractiveObject)mainphys).EndInteractionDistance = 0f;
				((FVRInteractiveObject)mainphys).EndInteractionIfDistant = true;
				mainphys.DistantGrabbable = false;
				((FVRInteractiveObject)mainphys).ForceBreakInteraction();
				((FVRInteractiveObject)mainphys).m_hand = null;
				fakepoint.SetActive(true);
				fakepoint.transform.SetParent(((Component)C4).transform);
				fakepoint.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				mainobj.transform.position = fakepoint.transform.position;
				mainobj.transform.eulerAngles = fakepoint.transform.eulerAngles;
				fuzeinsertrot.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
				C4.fuze = ((Component)this).gameObject;
				mainrig.useGravity = false;
				mainphys.UsesGravity = false;
				aud.SetActive(true);
				if (safety.transform.localEulerAngles.x > 45f)
				{
					if (!pulledring)
					{
						Object.Instantiate<GameObject>(ring, ringpos.transform.position, ringpos.transform.rotation);
						pulledring = true;
					}
					if (immaBlowUP && (Object)(object)mainphys.m_quickbeltSlot == (Object)null)
					{
						C4.shouldIgoBoom = true;
						Object.Destroy((Object)(object)mainobj);
						Object.Destroy((Object)(object)((Component)this).gameObject);
					}
				}
			}
			else if (imstickedin && (Object)(object)C4 == (Object)null)
			{
				Object.Instantiate<GameObject>(FuzeExplode, ((Component)exppos).transform.position, ((Component)exppos).transform.rotation);
				Object.Instantiate<GameObject>(FuzeExplosion, ((Component)exppos).transform.position, ((Component)exppos).transform.rotation);
				Object.Destroy((Object)(object)mainobj);
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	public class M57Ignitor : MonoBehaviour
	{
		public List<M114Fuze> C4s;

		public GameObject Rotpiece;

		public GameObject Trigger;

		public GameObject triggerpiece;

		public float Timer = 0f;

		public int clickedtimes = 0;

		public bool Firstclick = false;

		public bool Secondclick = false;

		public bool clicked = false;

		public GameObject mainobj;

		private void Start()
		{
		}

		private void OnTriggerEnter(Collider other)
		{
			if ((Object)(object)((Component)other).gameObject.GetComponent<M114Fuze>() != (Object)null)
			{
				C4s.Add(((Component)other).gameObject.GetComponent<M114Fuze>());
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if ((Object)(object)((Component)other).gameObject.GetComponent<M114Fuze>() != (Object)null)
			{
				C4s.Remove(((Component)other).gameObject.GetComponent<M114Fuze>());
			}
		}

		private void Update()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).gameObject.transform.position = mainobj.transform.position;
			((Component)this).gameObject.transform.eulerAngles = mainobj.transform.eulerAngles;
			if (Rotpiece.transform.localEulerAngles.x > 20f && Rotpiece.transform.localEulerAngles.x < 30f)
			{
				Trigger.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
			}
			else if (Rotpiece.transform.localEulerAngles.x < 20f || Rotpiece.transform.localEulerAngles.x > 30f)
			{
				Trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if (triggerpiece.transform.localEulerAngles.z < 5f)
			{
				clicked = false;
				Secondclick = false;
			}
			else if (triggerpiece.transform.localEulerAngles.z > 20f && !clicked)
			{
				clickedtimes++;
				clicked = true;
			}
			if (clickedtimes >= 2)
			{
				if (C4s.Capacity >= 1)
				{
					for (int i = 0; i < C4s.Count; i++)
					{
						if (C4s[i].safety.transform.localEulerAngles.x > 45f)
						{
							C4s[i].immaBlowUP = true;
						}
					}
				}
				clickedtimes = 0;
			}
			if (clickedtimes > 0)
			{
				Timer += Time.deltaTime;
				if (Timer > 1f)
				{
					Timer = 0f;
					clickedtimes = 0;
				}
			}
			if (clickedtimes != 0)
			{
				return;
			}
			for (int j = 0; j < C4s.Count; j++)
			{
				if ((Object)(object)C4s[j] == (Object)null)
				{
					C4s.Remove(C4s[j]);
				}
			}
		}
	}
	public class StickyObj : MonoBehaviour
	{
		public Rigidbody thisrig;

		public GameObject mainobj;

		public Transform mainpos;

		public Rigidbody mainrig;

		public Collider col;

		public Collider grabcol;

		public GameObject phys;

		public bool fuzed = false;

		public GameObject fakepoint;

		public FVRPhysicalObject mainphys;

		public GameObject[] objs;

		private void Start()
		{
			fakepoint.SetActive(false);
		}

		private void OnCollisionEnter(Collision collision)
		{
			if (fuzed)
			{
				fakepoint.SetActive(true);
				fakepoint.transform.SetParent(((Component)collision.collider).gameObject.transform);
				((FVRInteractiveObject)mainphys).m_hand = null;
			}
		}

		private void Update()
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: 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)
			if ((Object)(object)fakepoint == (Object)null)
			{
				for (int i = 0; i < objs.Length; i++)
				{
					Object.Destroy((Object)(object)objs[i]);
				}
				Object.Destroy((Object)(object)mainobj);
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			((Component)this).gameObject.transform.position = ((Component)mainpos).transform.position;
			((Component)this).gameObject.transform.eulerAngles = ((Component)mainpos).transform.eulerAngles;
			if (fakepoint.activeInHierarchy)
			{
				((FVRInteractiveObject)mainphys).EndInteractionDistance = 0f;
				((FVRInteractiveObject)mainphys).EndInteractionIfDistant = true;
				mainphys.DistantGrabbable = false;
				((FVRInteractiveObject)mainphys).ForceBreakInteraction();
				mainobj.transform.position = fakepoint.transform.position;
				mainobj.transform.eulerAngles = fakepoint.transform.eulerAngles;
				mainrig.useGravity = false;
				mainphys.UsesGravity = false;
				col.enabled = false;
			}
			else if (!fakepoint.activeInHierarchy)
			{
				mainrig.useGravity = true;
				mainphys.UsesGravity = true;
				if (!fuzed)
				{
					phys.SetActive(true);
					col.enabled = false;
				}
				else if (fuzed)
				{
					phys.SetActive(false);
					col.enabled = true;
					grabcol.enabled = false;
					mainphys.DistantGrabbable = false;
				}
			}
		}
	}
}
public class CameraController : MonoBehaviour
{
	public GameObject mTarget;

	public Vector3 mDistance;

	public float mSpeed = 5f;

	private void Update()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		((Component)((Component)this).GetComponent<Camera>()).transform.LookAt(mTarget.transform.position);
		((Component)((Component)this).GetComponent<Camera>()).transform.position = ((Component)((Component)this).GetComponent<Camera>()).transform.position + mSpeed * Time.deltaTime * (mTarget.transform.position + mDistance - ((Component)((Component)this).GetComponent<Camera>()).transform.position);
	}
}
public class IdleUpdate : StateMachineBehaviour
{
	private float mIdleRayCast = 0.5f;

	public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().DisablePlant((AvatarIKGoal)0, 2f);
		((Component)animator).GetComponent<MecFootPlacer>().DisablePlant((AvatarIKGoal)1, 2f);
	}

	public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
	{
		FootPlacementData footPlacementData = ((Component)animator).GetComponents<FootPlacementData>()[0];
		FootPlacementData footPlacementData2 = ((Component)animator).GetComponents<FootPlacementData>()[1];
		if ((Object)(object)footPlacementData != (Object)null)
		{
			if (((AnimatorStateInfo)(ref stateInfo)).normalizedTime > 0.25f)
			{
				footPlacementData.mExtraRayDistanceCheck = mIdleRayCast;
			}
			else
			{
				footPlacementData.mExtraRayDistanceCheck = 0f;
			}
		}
		if ((Object)(object)footPlacementData2 != (Object)null)
		{
			if (((AnimatorStateInfo)(ref stateInfo)).normalizedTime > 0.25f)
			{
				footPlacementData2.mExtraRayDistanceCheck = mIdleRayCast;
			}
			else
			{
				footPlacementData2.mExtraRayDistanceCheck = 0f;
			}
		}
	}
}
public class InputController : MonoBehaviour
{
	public float Speed = 4f;

	public float TurnSpeed = 1f;

	public Camera mCam;

	protected Vector3 mLeftVec = new Vector3(-1f, 0f, 0f);

	protected Vector3 mFwdVec = new Vector3(0f, 0f, 1f);

	protected Vector3 mGOFwdVec = new Vector3(0f, 0f, 1f);

	protected Animator mAnim;

	protected float mTimePassed = 0f;

	protected int mMove = Animator.StringToHash("move");

	protected int mSpeed = Animator.StringToHash("speed");

	protected bool mMecFPActive = true;

	protected GUIStyle mStyle;

	private void Start()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		mStyle = new GUIStyle();
		mAnim = ((Component)this).GetComponent<Animator>();
		mStyle.normal.textColor = new Color(0.5f, 0f, 0.75f, 1f);
		mStyle.fontSize = 20;
	}

	private void OnGUI()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		GUI.Label(new Rect(0f, 0f, 100f, 100f), "Use W, A, S, D to move around\nPress R to activate/deactivate Mec Foot Placer\nHold L to run", mStyle);
	}

	private void Update()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_0397: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
		Animator obj = mAnim;
		AnimatorStateInfo currentAnimatorStateInfo = mAnim.GetCurrentAnimatorStateInfo(0);
		float normalizedTime = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime;
		AnimatorStateInfo currentAnimatorStateInfo2 = mAnim.GetCurrentAnimatorStateInfo(0);
		obj.SetFloat("time", normalizedTime - Mathf.Floor(((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).normalizedTime));
		if (!Input.anyKey)
		{
			float @float = mAnim.GetFloat(mSpeed);
			@float -= 1.5f * Time.deltaTime;
			if (@float < 0f)
			{
				@float = 0f;
				mAnim.SetBool(mMove, false);
			}
			mAnim.SetFloat(mSpeed, @float);
			return;
		}
		bool flag = false;
		Vector3 val = ((Component)mCam).transform.rotation * mFwdVec;
		val.y = 0f;
		Vector3 val2 = ((Component)mCam).transform.rotation * mLeftVec;
		val2.y = 0f;
		mGOFwdVec = ((Component)this).gameObject.transform.rotation * new Vector3(0f, 0f, 1f);
		Vector3 val3 = default(Vector3);
		((Vector3)(ref val3))..ctor(0f, 0f, 0f);
		float num = 1f;
		float num2 = 0f;
		if (Input.GetKey((KeyCode)97))
		{
			val3 += val2;
			flag = true;
		}
		if (Input.GetKey((KeyCode)100))
		{
			val3 -= val2;
			flag = true;
		}
		if (Input.GetKey((KeyCode)119))
		{
			val3 += val;
			flag = true;
		}
		if (Input.GetKey((KeyCode)115))
		{
			val3 -= val;
			flag = true;
		}
		if (Input.GetKey((KeyCode)108))
		{
			float float2 = mAnim.GetFloat(mSpeed);
			if (flag)
			{
				float2 += Time.deltaTime;
				if (float2 > 1f)
				{
					float2 = 1f;
				}
			}
			else
			{
				float2 -= 2f * Time.deltaTime;
				if (float2 < 0f)
				{
					float2 = 0f;
				}
			}
			mAnim.SetFloat(mSpeed, float2);
		}
		else
		{
			float float3 = mAnim.GetFloat(mSpeed);
			float3 -= Time.deltaTime;
			if (float3 < 0f)
			{
				float3 = 0f;
			}
			mAnim.SetFloat(mSpeed, float3);
		}
		if (Input.GetKey((KeyCode)281) && mTimePassed > 0.1f)
		{
			Time.timeScale -= 0.1f;
			if (Time.timeScale < 0f)
			{
				Time.timeScale = 0f;
			}
			mTimePassed = 0f;
			Debug.Log((object)Time.timeScale);
		}
		if (Input.GetKey((KeyCode)280) && mTimePassed > 0.1f)
		{
			Time.timeScale += 0.1f;
			mTimePassed = 0f;
			Debug.Log((object)Time.timeScale);
		}
		if (Input.GetKeyDown((KeyCode)114))
		{
			mMecFPActive = !mMecFPActive;
			((Component)this).GetComponent<MecFootPlacer>().SetActive((AvatarIKGoal)0, mMecFPActive);
			((Component)this).GetComponent<MecFootPlacer>().SetActive((AvatarIKGoal)1, mMecFPActive);
		}
		if (flag)
		{
			num = Vector3.Cross(mGOFwdVec, val3).y;
			if (num != 0f)
			{
				num /= Mathf.Abs(num);
			}
			num2 = Vector3.Angle(mGOFwdVec, val3);
			num2 *= TurnSpeed * Time.deltaTime;
			((Component)this).gameObject.transform.Rotate(new Vector3(0f, num, 0f), num2, (Space)0);
			mAnim.SetBool(mMove, true);
		}
		else if (mAnim.GetFloat("speed") <= 0f)
		{
			mAnim.SetBool(mMove, false);
		}
		mTimePassed += Time.deltaTime;
	}
}
public class LocomotionUpdate : StateMachineBehaviour
{
	public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().EnablePlant((AvatarIKGoal)0, 2f);
		((Component)animator).GetComponent<MecFootPlacer>().EnablePlant((AvatarIKGoal)1, 2f);
	}

	public override void OnStateUpdate(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
	{
		float @float = animator.GetFloat("speed");
		float num = ((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime - Mathf.Floor(((AnimatorStateInfo)(ref animatorStateInfo)).normalizedTime);
		float num2 = 0.5f - 0.25f * @float;
		FootPlacementData[] components = ((Component)animator).GetComponents<FootPlacementData>();
		FootPlacementData footPlacementData = null;
		for (byte b = 0; b < components.Length; b++)
		{
			switch (components[b].mFootID)
			{
			case FootPlacementData.LimbID.LEFT_FOOT:
				footPlacementData = components[b];
				if ((double)num > 0.5 && num < 0.5f + num2)
				{
					footPlacementData.mExtraRayDistanceCheck = 0.7f;
				}
				else
				{
					footPlacementData.mExtraRayDistanceCheck = -0.2f;
				}
				break;
			case FootPlacementData.LimbID.RIGHT_FOOT:
				footPlacementData = components[b];
				if (num < num2)
				{
					footPlacementData.mExtraRayDistanceCheck = 0.7f;
				}
				else
				{
					footPlacementData.mExtraRayDistanceCheck = -0.2f;
				}
				break;
			case FootPlacementData.LimbID.LEFT_HAND:
				footPlacementData = components[b];
				break;
			case FootPlacementData.LimbID.RIGHT_HAND:
				footPlacementData = components[b];
				break;
			}
			footPlacementData.mTransitionTime = 0.15f - 0.1f * @float;
		}
	}
}
public class PelvisSet : StateMachineBehaviour
{
	public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().mAdjustPelvisVertically = true;
	}
}
public class PelvisUnset : StateMachineBehaviour
{
	public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
	{
		((Component)animator).GetComponent<MecFootPlacer>().mAdjustPelvisVertically = false;
	}
}
public class FootPlacementData : MonoBehaviour
{
	public enum LimbID
	{
		LEFT_FOOT,
		RIGHT_FOOT,
		LEFT_HAND,
		RIGHT_HAND
	}

	public enum Target
	{
		FOOT,
		TOE,
		HEEL
	}

	public LimbID mFootID = LimbID.LEFT_FOOT;

	public bool mPlantFoot = true;

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

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

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

	public float mFootOffsetDist = 0.5f;

	public float mFootLength = 0.22f;

	public float mFootHalfWidth = 0.05f;

	public float mFootHeight = 0.1f;

	public float mFootRotationLimit = 45f;

	public float mTransitionTime = 0.2f;

	public float mExtraRayDistanceCheck = 0f;

	public bool mSetExtraRaydistanceCheckAutomatically = false;

	public float mErrorThreshold = 0.05f;

	public float mExtraRayDistanceCheckMin = 0f;

	public float mExtraRayDistanceCheckMax = 2f;

	protected bool mFootPlantIsOnTransition = false;

	protected float mFootPlantBlendSpeed;

	protected Vector3 mTargetPos = new Vector3(0f, 0f, 0f);

	protected Vector3 mTargetToePos = new Vector3(0f, 0f, 0f);

	protected Vector3 mTargetHeelPos = new Vector3(0f, 0f, 0f);

	protected Vector3 mRotatedFwdVec;

	protected Vector3 mRotatedIKHintOffset;

	protected float mTargetFootWeight = 0f;

	protected float mCurrentFootWeight = 0f;

	protected float mGoalBlendSpeed = 0f;

	protected float mPlantBlendFactor = 0f;

	private Vector3 mFootPlantedPos;

	private Quaternion mFootPlantedRot;

	private bool mFootPlanted = false;

	private Vector3 mPreviousFootPos = Vector3.zero;

	public void SetTargetPos(Target target, Vector3 target_pos)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		switch (target)
		{
		case Target.FOOT:
			mTargetPos = target_pos;
			break;
		case Target.TOE:
			mTargetToePos = target_pos;
			break;
		case Target.HEEL:
			mTargetHeelPos = target_pos;
			break;
		}
	}

	public Vector3 GetTargetPos(Target target)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		return (Vector3)(target switch
		{
			Target.FOOT => mTargetPos, 
			Target.TOE => mTargetToePos, 
			Target.HEEL => mTargetHeelPos, 
			_ => Vector3.zero, 
		});
	}

	public void CalculateRotatedFwdVec()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		AvatarIKGoal val = (AvatarIKGoal)0;
		switch (mFootID)
		{
		case LimbID.RIGHT_FOOT:
			val = (AvatarIKGoal)1;
			break;
		case LimbID.LEFT_HAND:
			val = (AvatarIKGoal)2;
			break;
		case LimbID.RIGHT_HAND:
			val = (AvatarIKGoal)3;
			break;
		}
		float num = 0f;
		Quaternion iKRotation = ((Component)this).GetComponent<Animator>().GetIKRotation(val);
		num = ((Quaternion)(ref iKRotation)).eulerAngles.y * (float)Math.PI / 180f;
		Quaternion val2 = default(Quaternion);
		((Quaternion)(ref val2))..ctor(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f));
		if (mFootPlanted && mPlantFoot)
		{
			num = ((Quaternion)(ref mFootPlantedRot)).eulerAngles.y * (float)Math.PI / 180f;
			val2 = Quaternion.Slerp(val2, new Quaternion(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f)), mPlantBlendFactor);
		}
		mRotatedFwdVec = val2 * ((Vector3)(ref mForwardVector)).normalized;
	}

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

	public void CalculateRotatedIKHint()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		Quaternion rotation = ((Component)this).transform.rotation;
		float num = ((Quaternion)(ref rotation)).eulerAngles.y * (float)Math.PI / 180f;
		Quaternion val = default(Quaternion);
		((Quaternion)(ref val))..ctor(0f, Mathf.Sin(num * 0.5f), 0f, Mathf.Cos(num * 0.5f));
		mRotatedIKHintOffset = val * mIKHintOffset;
	}

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

	public void SetTargetFootWeight(float weight)
	{
		mTargetFootWeight = weight;
	}

	public float GetTargetFootWeight()
	{
		return mTargetFootWeight;
	}

	public void SetCurrentFootWeight(float weight)
	{
		mCurrentFootWeight = weight;
	}

	public float GetCurrentFootWeight()
	{
		return mCurrentFootWeight;
	}

	public void SetGoalBlendSpeed(float speed)
	{
		mGoalBlendSpeed = speed;
	}

	public float GetGoalBlendSpeed()
	{
		return mGoalBlendSpeed;
	}

	public float GetPlantBlendFactor()
	{
		return mPlantBlendFactor;
	}

	public void SetPlantBlendFactor(float factor)
	{
		mPlantBlendFactor = factor;
	}

	public void EnablePlantBlend(float blend_speed)
	{
		mFootPlantBlendSpeed = Mathf.Abs(blend_speed);
		mFootPlantIsOnTransition = true;
	}

	public void DisablePlantBlend(float blend_speed)
	{
		mFootPlantBlendSpeed = 0f - Mathf.Abs(blend_speed);
		mFootPlantIsOnTransition = true;
	}

	public float GetFootPlantBlendSpeed()
	{
		return mFootPlantBlendSpeed;
	}

	public void PlantBlendTransitionEnded()
	{
		mFootPlantIsOnTransition = false;
	}

	public bool IsPlantOnTransition()
	{
		return mFootPlantIsOnTransition;
	}

	public void SetFootPlanted(bool planted)
	{
		mFootPlanted = planted;
	}

	public bool GetFootPlanted()
	{
		return mFootPlanted;
	}

	public void SetPlantedPos(Vector3 planted_pos)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		mFootPlantedPos = planted_pos;
	}

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

	public void SetPlantedRot(Quaternion planted_rot)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		mFootPlantedRot = planted_rot;
	}

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

	private void Start()
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		Animator component = ((Component)this).GetComponent<Animator>();
		if (!((Object)(object)component == (Object)null))
		{
			HumanBodyBones val = (HumanBodyBones)5;
			switch (mFootID)
			{
			case LimbID.RIGHT_FOOT:
				val = (HumanBodyBones)6;
				break;
			case LimbID.RIGHT_HAND:
				val = (HumanBodyBones)18;
				break;
			case LimbID.LEFT_HAND:
				val = (HumanBodyBones)17;
				break;
			}
			mPreviousFootPos = component.GetBoneTransform(val).position;
		}
	}

	protected bool IsErrorHigh(HumanBodyBones bone, Vector3 current_position, Vector3 previous_pos)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = previous_pos - current_position;
		float magnitude = ((Vector3)(ref val)).magnitude;
		float num = mErrorThreshold;
		if (Time.deltaTime < 0.033f)
		{
			num = mErrorThreshold * 30f * Time.deltaTime;
		}
		if (magnitude > num)
		{
			return true;
		}
		return false;
	}

	private void OnAnimatorIK()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		if (!mSetExtraRaydistanceCheckAutomatically)
		{
			return;
		}
		Animator component = ((Component)this).GetComponent<Animator>();
		if (!((Object)(object)component == (Object)null))
		{
			HumanBodyBones val = (HumanBodyBones)5;
			switch (mFootID)
			{
			case LimbID.RIGHT_FOOT:
				val = (HumanBodyBones)6;
				break;
			case LimbID.RIGHT_HAND:
				val = (HumanBodyBones)18;
				break;
			case LimbID.LEFT_HAND:
				val = (HumanBodyBones)17;
				break;
			}
			if (IsErrorHigh(val, component.GetBoneTransform(val).position, mPreviousFootPos))
			{
				mExtraRayDistanceCheck = mExtraRayDistanceCheckMin;
			}
			else
			{
				mExtraRayDistanceCheck = mExtraRayDistanceCheckMax;
			}
			mPreviousFootPos = component.GetBoneTransform(val).position;
		}
	}
}
public class MecFootPlacer : MonoBehaviour
{
	public bool mAdjustPelvisVertically = false;

	public bool mDampPelvis = false;

	public float mMaxLegLength = 1f;

	public float mMinLegLength = 0.2f;

	public float mPelvisAdjustmentSpeed = 1f;

	public string[] mLayersToIgnore;

	protected FootPlacementData mLeftFoot = null;

	protected FootPlacementData mRightFoot = null;

	protected FootPlacementData mLeftHand = null;

	protected FootPlacementData mRightHand = null;

	protected Animator mAnim;

	protected LayerMask mLayerMask = LayerMask.op_Implicit(-1);

	private const float mEpsilon = 0.005f;

	private float mCurrentRootVertError = 0f;

	private float mTargetRootVertError = 0f;

	private float mCurrentPelvisSpeed = 0f;

	private Vector3 mLeftFootContact_Ontransition_Disable;

	private Vector3 mLeftToeContact_Ontransition_Disable;

	private Vector3 mLeftHeelContact_Ontransition_Disable;

	private Vector3 mRightFootContact_Ontransition_Disable;

	private Vector3 mRightToeContact_Ontransition_Disable;

	private Vector3 mRightHeelContact_Ontransition_Disable;

	private Vector3 mLeftHandContact_Ontransition_Disable;

	private Vector3 mLeftHandToeContact_Ontransition_Disable;

	private Vector3 mLeftHandHeelContact_Ontransition_Disable;

	private Vector3 mRightHandContact_Ontransition_Disable;

	private Vector3 mRightHandToeContact_Ontransition_Disable;

	private Vector3 mRightHandHeelContact_Ontransition_Disable;

	private bool mRootPosLeftRightFoot = false;

	private bool mLeftFootActive = true;

	private bool mRightFootActive = true;

	private bool mLeftHandActive = true;

	private bool mRightHandActive = true;

	public void SetActive(AvatarIKGoal foot_id, bool active)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Invalid comparison between Unknown and I4
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Invalid comparison between Unknown and I4
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Invalid comparison between Unknown and I4
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		if ((int)foot_id == 0)
		{
			if ((Object)(object)mLeftFoot == (Object)null)
			{
				return;
			}
			if (active && !mLeftFootActive)
			{
				ResetIKParams(foot_id);
			}
			mLeftFootActive = active;
		}
		if ((int)foot_id == 1)
		{
			if ((Object)(object)mRightFoot == (Object)null)
			{
				return;
			}
			if (active && !mRightFootActive)
			{
				ResetIKParams(foot_id);
			}
			mRightFootActive = active;
		}
		if ((int)foot_id == 2)
		{
			if ((Object)(object)mRightHand == (Object)null)
			{
				return;
			}
			if (active && !mLeftHandActive)
			{
				ResetIKParams(foot_id);
			}
			mLeftHandActive = active;
		}
		if ((int)foot_id == 3 && !((Object)(object)mRightHand == (Object)null))
		{
			if (active && !mRightHandActive)
			{
				ResetIKParams(foot_id);
			}
			mRightHandActive = active;
		}
	}

	public bool IsActive(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Invalid comparison between Unknown and I4
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Invalid comparison between Unknown and I4
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Invalid comparison between Unknown and I4
		if ((int)foot_id == 0)
		{
			return mLeftFootActive;
		}
		if ((int)foot_id == 1)
		{
			return mRightFootActive;
		}
		if ((int)foot_id == 2)
		{
			return mLeftHandActive;
		}
		if ((int)foot_id == 3)
		{
			return mRightHandActive;
		}
		return false;
	}

	public void SetLayerMask(LayerMask layer_mask)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		mLayerMask = layer_mask;
	}

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

	public float GetPlantBlendWeight(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		default:
			return -1f;
		}
		return footPlacementData.GetPlantBlendFactor();
	}

	public void SetPlantBlendWeight(AvatarIKGoal foot_id, float weight)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		footPlacementData.SetPlantBlendFactor(weight);
	}

	public void EnablePlant(AvatarIKGoal foot_id, float blend_speed)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		footPlacementData.EnablePlantBlend(blend_speed);
	}

	public void DisablePlant(AvatarIKGoal foot_id, float blend_speed)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		footPlacementData.DisablePlantBlend(blend_speed);
	}

	private void ResetIKParams(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Invalid comparison between Unknown and I4
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Invalid comparison between Unknown and I4
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02af: Invalid comparison between Unknown and I4
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_0312: Unknown result type (might be due to invalid IL or missing references)
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_0347: Unknown result type (might be due to invalid IL or missing references)
		//IL_034d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0362: Unknown result type (might be due to invalid IL or missing references)
		//IL_036d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0372: Unknown result type (might be due to invalid IL or missing references)
		//IL_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_0387: Unknown result type (might be due to invalid IL or missing references)
		//IL_038c: Unknown result type (might be due to invalid IL or missing references)
		if ((int)foot_id == 0)
		{
			Vector3 position = mAnim.GetBoneTransform((HumanBodyBones)5).position;
			mLeftFoot.SetTargetFootWeight(0f);
			mLeftFoot.SetCurrentFootWeight(0f);
			mLeftFoot.SetGoalBlendSpeed(0f);
			mLeftFoot.SetFootPlanted(planted: false);
			mLeftFootContact_Ontransition_Disable = position;
			mLeftToeContact_Ontransition_Disable = mLeftFoot.mUpVector * mLeftFoot.mFootOffsetDist + mLeftFoot.GetRotatedFwdVec() * mLeftFoot.mFootLength;
			mLeftHeelContact_Ontransition_Disable = position + new Quaternion(0f, 0.7071f, 0f, 0.7071f) * mLeftFoot.GetRotatedFwdVec() * mLeftFoot.mFootHalfWidth;
		}
		if ((int)foot_id == 1)
		{
			Vector3 position2 = mAnim.GetBoneTransform((HumanBodyBones)6).position;
			mRightFoot.SetTargetFootWeight(0f);
			mRightFoot.SetCurrentFootWeight(0f);
			mRightFoot.SetGoalBlendSpeed(0f);
			mRightFoot.SetFootPlanted(planted: false);
			mRightFootContact_Ontransition_Disable = position2;
			mRightToeContact_Ontransition_Disable = mRightFoot.mUpVector * mRightFoot.mFootOffsetDist + mRightFoot.GetRotatedFwdVec() * mRightFoot.mFootLength;
			mRightHeelContact_Ontransition_Disable = position2 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mRightFoot.GetRotatedFwdVec() * mRightFoot.mFootHalfWidth;
		}
		if ((int)foot_id == 2)
		{
			Vector3 position3 = mAnim.GetBoneTransform((HumanBodyBones)17).position;
			mLeftHand.SetTargetFootWeight(0f);
			mLeftHand.SetCurrentFootWeight(0f);
			mLeftHand.SetGoalBlendSpeed(0f);
			mLeftHand.SetFootPlanted(planted: false);
			mLeftHandContact_Ontransition_Disable = position3;
			mLeftHandToeContact_Ontransition_Disable = mLeftHand.mUpVector * mLeftHand.mFootOffsetDist + mLeftHand.GetRotatedFwdVec() * mLeftHand.mFootLength;
			mLeftHandHeelContact_Ontransition_Disable = position3 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mLeftHand.GetRotatedFwdVec() * mLeftHand.mFootHalfWidth;
		}
		if ((int)foot_id == 3)
		{
			Vector3 position4 = mAnim.GetBoneTransform((HumanBodyBones)18).position;
			mRightHand.SetTargetFootWeight(0f);
			mRightHand.SetCurrentFootWeight(0f);
			mRightHand.SetGoalBlendSpeed(0f);
			mRightHand.SetFootPlanted(planted: false);
			mRightHandContact_Ontransition_Disable = position4;
			mRightHandToeContact_Ontransition_Disable = mRightHand.mUpVector * mRightHand.mFootOffsetDist + mRightHand.GetRotatedFwdVec() * mRightHand.mFootLength;
			mRightHandHeelContact_Ontransition_Disable = position4 + new Quaternion(0f, 0.7017f, 0f, 0.7071f) * mRightHand.GetRotatedFwdVec() * mRightHand.mFootHalfWidth;
		}
	}

	protected void SetIKWeight(AvatarIKGoal foot_id, float target_weight, float transition_time)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		switch ((int)foot_id)
		{
		case 0:
			if (Mathf.Abs(target_weight - mLeftFoot.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mLeftFoot.SetGoalBlendSpeed((target_weight - mLeftFoot.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mLeftFoot.SetGoalBlendSpeed(0.1f);
					mLeftFoot.SetCurrentFootWeight(target_weight);
				}
			}
			mLeftFoot.SetTargetFootWeight(target_weight);
			break;
		case 1:
			if (Mathf.Abs(target_weight - mRightFoot.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mRightFoot.SetGoalBlendSpeed((target_weight - mRightFoot.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mRightFoot.SetGoalBlendSpeed(0.1f);
					mRightFoot.SetCurrentFootWeight(target_weight);
				}
			}
			mRightFoot.SetTargetFootWeight(target_weight);
			break;
		case 2:
			if (Mathf.Abs(target_weight - mLeftHand.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mLeftHand.SetGoalBlendSpeed((target_weight - mLeftHand.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mLeftHand.SetGoalBlendSpeed(0.1f);
					mLeftHand.SetCurrentFootWeight(target_weight);
				}
			}
			mLeftHand.SetTargetFootWeight(target_weight);
			break;
		case 3:
			if (Mathf.Abs(target_weight - mRightHand.GetTargetFootWeight()) > 0.005f)
			{
				if (transition_time != 0f)
				{
					mRightHand.SetGoalBlendSpeed((target_weight - mRightHand.GetCurrentFootWeight()) / transition_time);
				}
				else
				{
					mRightHand.SetGoalBlendSpeed(0.1f);
					mRightHand.SetCurrentFootWeight(target_weight);
				}
			}
			mRightHand.SetTargetFootWeight(target_weight);
			break;
		}
	}

	protected void CalculateIKGoalWeights(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		float num = Mathf.Sign(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight());
		footPlacementData.SetCurrentFootWeight(footPlacementData.GetCurrentFootWeight() + footPlacementData.GetGoalBlendSpeed() * Time.deltaTime);
		if (num * Mathf.Sign(footPlacementData.GetTargetFootWeight() - footPlacementData.GetCurrentFootWeight()) < 1f || Mathf.Abs(footPlacementData.GetCurrentFootWeight() - footPlacementData.GetTargetFootWeight()) < 0.005f)
		{
			footPlacementData.SetCurrentFootWeight(footPlacementData.GetTargetFootWeight());
		}
		else if (footPlacementData.GetCurrentFootWeight() > 1f || footPlacementData.GetCurrentFootWeight() < 0f)
		{
			footPlacementData.SetCurrentFootWeight(Mathf.Clamp(footPlacementData.GetTargetFootWeight(), 0f, 1f));
		}
	}

	protected void CheckForLimits(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		Vector3 zero = Vector3.zero;
		Vector3 rotatedFwdVec = footPlacementData.GetRotatedFwdVec();
		if (Vector3.Angle(rotatedFwdVec, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE)) > footPlacementData.mFootRotationLimit)
		{
			zero = footPlacementData.mUpVector * footPlacementData.mFootLength * Mathf.Tan(footPlacementData.mFootRotationLimit * ((float)Math.PI / 180f));
			if (Vector3.Angle(footPlacementData.mUpVector, footPlacementData.GetTargetPos(FootPlacementData.Target.TOE)) > 90f)
			{
				zero = -zero;
			}
			footPlacementData.SetTargetPos(FootPlacementData.Target.TOE, rotatedFwdVec * footPlacementData.mFootLength + zero);
		}
		Quaternion val = default(Quaternion);
		((Quaternion)(ref val))..ctor(0f, 0.7071f, 0f, 0.7071f);
		if (Vector3.Angle(val * rotatedFwdVec, footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL)) > footPlacementData.mFootRotationLimit)
		{
			zero = footPlacementData.mUpVector * footPlacementData.mFootHalfWidth * Mathf.Tan(footPlacementData.mFootRotationLimit * ((float)Math.PI / 180f));
			if (Vector3.Angle(footPlacementData.mUpVector, footPlacementData.GetTargetPos(FootPlacementData.Target.HEEL)) > 90f)
			{
				zero = -zero;
			}
			footPlacementData.SetTargetPos(FootPlacementData.Target.HEEL, val * rotatedFwdVec * footPlacementData.mFootHalfWidth + zero);
		}
	}

	protected void UpdateFootPlantBlendWeights(AvatarIKGoal foot_id)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected I4, but got Unknown
		FootPlacementData footPlacementData;
		switch ((int)foot_id)
		{
		default:
			return;
		case 0:
			footPlacementData = mLeftFoot;
			break;
		case 1:
			footPlacementData = mRightFoot;
			break;
		case 2:
			footPlacementData = mLeftHand;
			break;
		case 3:
			footPlacementData = mRightHand;
			break;
		}
		if (!footPlacementData.IsPlantOnTransition())
		{
			return;
		}
		footPlacementData.SetPlantBlendFactor(footPlacementData.GetPlantBlendFactor() + footPlacementData.GetFootPlantBlendSpeed() * Time.deltaTime);
		if (footPlacementData.GetFootPlantBlendSpeed() > 0f)
		{
			if (footPlacementData.GetPlantBlendFactor() > 1f)
			{
				footPlacementData.SetPlantBlendFactor(1f);
				footPlacementData.PlantBlendTransitionEnded();
			}
		}
		else if (footPlacementData.GetPlantBlendFactor() < 0f)
		{
			footPlacementData.SetPlantBlendFactor(0f);
			footPlacementData.PlantBlendTransitionEnded();
		}
	}

	protected void FindContactPoints(AvatarIKGoal foot_id)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Expected I4, but got Unknown
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Expected I4, but got Unknown
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Expected I4, but got Unknown
		//IL_022c: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0269: Unknown result type (might be due to invalid IL or missing references)
		//IL_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Expected I4, but got Unknown
		//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0412: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0426: Unknown result type (might be due to invalid IL or missing references)
		//IL_0431: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_043d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0418: Unknown result type (might be due to invalid IL or missing references)
		//IL_041d: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_0358: Unknown result type (might be due to invalid IL or missing references)
		//IL_0363: Unknown result type (might be due to invalid IL or missing references)
		//IL_0379: Expected I4, but got Unknown
		//IL_0463: Unknown result type (might be due to invalid IL or missing references)
		//IL_0465: Unknown result type (might be due to invalid IL or missing references)
		//IL_0470: Unknown result type (might be due to invalid IL or missing references)
		//IL_0475: Unknown result type (might be due to invalid IL or missing references)
		//IL_047a: Unknown result type (might be due to invalid IL or missing references)
		//IL_047d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0482: Unknown result type (might be due to invalid IL or missing references)
		//IL_0487: Unknown result type (might be due to invalid IL or missing references)
		//IL_048b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0496: Unknown result type (might be due to invalid IL or missing references)
		//IL_049b: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0381: Unknown result type (might be due to invalid IL or missing references)
		//IL_0386: Unknown result type (might be due to invalid IL or missing references)
		//IL_0393: Unknown result type (might be due to invalid IL or missing references)
		//IL_0398: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_0320: Unknown result type (might be due to invalid IL or missing references)
		//IL_061a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0630: Expected I4, but got Unknown
		//IL_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or m

LegoWeaponSet.dll

Decompiled 3 weeks ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

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

	public GameObject objectToToggle;

	private Vector3 originalPosition;

	private void Start()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		originalPosition = targetObject.position;
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		if (targetObject.position != originalPosition)
		{
			if (objectToToggle.activeSelf)
			{
				objectToToggle.SetActive(false);
			}
		}
		else if (!objectToToggle.activeSelf)
		{
			objectToToggle.SetActive(true);
		}
	}
}
namespace Volks.LegoWeaponSet;

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volks.LegoWeaponSet");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.LegoWeaponSet", "", "", "modmas2024_item14", "");
	}
}

Modul_UZI_Modmas.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using Sodalite.Api;
using UnityEngine;
using UnityEngine.UI;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace NotWolfie.Modul_UZI_Modmas
{
	[BepInPlugin("NotWolfie.Modul_UZI_Modmas", "Modul_UZI_Modmas", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	[BepInDependency("h3vr.cityrobo.ModularWorkshopManager", "1.0.0")]
	[BepInDependency("nrgill28.Sodalite", "1.4.1")]
	public class Modul_UZI_ModmasPlugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource Logger;

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

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "NotWolfie.Modul_UZI_Modmas");
			OtherLoader.RegisterDirectLoad(BasePath, "NotWolfie.Modul_UZI_Modmas", "", "", "modmas2024_item19", "");
			GameAPI.PreloadAllAssets(Path.Combine(BasePath, "mw_modul_uzi_modmas"));
		}
	}
}
namespace H3VRUtils.Vehicles
{
	public class ButtonIgnition : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public VehicleAudioSet audioSet;

		public float ignitionTime;

		private float m_it;

		public float failChance;

		public Random rand;

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

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

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

		public float damageMult = 15f;

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

		public Vector3 rotation;

		public int left = -1;

		public int up = -1;

		public int right = -1;

		public int down = -1;

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

		public Text gearText;

		public int currentNode;

		public List<DriveShiftNode> driveShiftNodes;

		public VehicleAudioSet audioSet;

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

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

		public GameObject explosionCentre;

		public float SmokeParticleHPThreshold;

		public float explosionStrength = 200f;

		public GameObject particleSmokePrefab;

		public GameObject particleFirePrefab;

		public GameObject explosionPrefab;

		public GameObject fixedMesh;

		public GameObject damagedMesh;

		public GameObject destroyedMesh;

		private ParticleSystem particleSmoke;

		private ParticleSystem particleFire;

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

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

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

		public override void whileDead()
		{
		}

		public override void whileUndead()
		{
		}

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

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

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

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

		public Vector3 rotRegular;

		public Vector3 rotDownwards;

		public GameObject lift;

		public float liftSpeed;

		public float minLiftY;

		public float maxLiftY;

		public void UpdateInteraction(FVRViveHand hand)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = lift.transform.position;
			((Component)this).transform.localEulerAngles = rotRegular;
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f)
			{
				position.y += liftSpeed / 50f;
				((Component)this).transform.localEulerAngles = rotUpwards;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f)
			{
				position.y -= liftSpeed / 50f;
				((Component)this).transform.localEulerAngles = rotDownwards;
			}
			if (position.y > maxLiftY)
			{
				position.y = maxLiftY;
			}
			else if (position.y < minLiftY)
			{
				position.y = minLiftY;
			}
			lift.transform.position = position;
		}
	}
	public class FuelNeedle : MonoBehaviour
	{
		public FuelTank tank;

		public GameObject needle;

		public bool isImperial;

		public Vector3 needleNoFuel;

		public Vector3 needleMaxFuel;

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

		public float maxFuel;

		public float fuelUsagePer1000Rpm = 0.01f;

		public float leakMult;

		public GameObject explosionEffect;

		public bool BlowsOnDeath;

		public AudioSource leakSound;

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

		public override void onDeath()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			base.onDeath();
			if (BlowsOnDeath)
			{
				Object.Instantiate<GameObject>(explosionEffect, ((Component)this).transform.position, ((Component)this).transform.rotation);
			}
		}

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

		public GameObject LockPos;

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

		public Vector3 positionOff;

		public Vector3 positionOn;

		public Vector3 rotationOff;

		public Vector3 rotationOn;

		public bool isOn;

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

		public GameObject needle;

		public bool isImperial;

		public float maxSpeed;

		public Vector3 needleNoSpeed;

		public Vector3 needleMaxSpeed;

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

		public float resetLerpSpeed;

		public float maxRot;

		public bool isBraking;

		public bool reverseRot;

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

		public float rot;

		public float rh;

		public float lr;

		public float inlerp;

		public float lerp;

		public float rotAmt;

		public VehicleAudioSet audioSet;

		public void BeginInteraction(FVRViveHand hand)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			Transform child = ((Component)this).transform.GetChild(0);
			child.parent = null;
			Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
			((Component)this).transform.LookAt(((Component)hand).transform);
			((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, localEulerAngles.z);
			child.parent = ((Component)this).transform;
		}

		public void EndInteraction(FVRViveHand hand)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			Transform child = ((Component)this).transform.GetChild(0);
			child.parent = null;
			((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, 0f, ((Component)this).transform.localEulerAngles.z);
			child.parent = ((Component)this).transform;
		}

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

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

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

		public AudioEvent VehicleStart;

		public AudioEvent VehicleIdle;

		public AudioEvent VehicleStop;

		public AudioEvent HandbrakeUp;

		public AudioEvent HandbrakeDown;

		public AudioEvent ShiftDownGear;

		public AudioEvent RevLoop;

		public AudioEvent ShiftUpGear;

		public AudioEvent Brake;

		public AudioEvent BrakeLong;

		public AudioEvent PedalSwitchSound;

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

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

		public Transform frontRight;

		public Transform frontLeft;

		public WheelSetting frontSetting;

		public bool backWheelDrive = true;

		public Transform backRight;

		public Transform backLeft;

		public WheelSetting rearSetting;
	}

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

		public float Weight = 1000f;

		public float Distance = 0.2f;
	}

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

		public Light[] reverseLights;
	}

	[Serializable]
	public class CarSounds
	{
		public AudioSource IdleEngine;

		public AudioSource LowEngine;

		public AudioSource HighEngine;

		public float minPitch = 1f;

		public float maxPitch = 10f;

		public AudioSource nitro;

		public AudioSource switchGear;
	}

	[Serializable]
	public class CarParticles
	{
		public GameObject brakeParticlePerfab;

		public ParticleSystem shiftParticle1;

		public ParticleSystem shiftParticle2;

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

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

		public Transform carSteer;

		public HitGround[] hitGround;

		public List<Transform> cameraSwitchView;

		public float springs = 25000f;

		public float dampers = 1500f;

		public float carPower = 120f;

		public float shiftPower = 150f;

		public float brakePower = 8000f;

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

		public float maxSteerAngle = 25f;

		public float shiftDownRPM = 1500f;

		public float shiftUpRPM = 2500f;

		public float idleRPM = 500f;

		public float stiffness = 2f;

		public bool automaticGear = true;

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

		public float LimitBackwardSpeed = 60f;

		public float LimitForwardSpeed = 220f;
	}

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

		public bool grounded = false;

		public AudioClip brakeSound;

		public AudioClip groundSound;

		public Color brakeColor;
	}

	private class WheelComponent
	{
		public Transform wheel;

		public WheelCollider collider;

		public Vector3 startPos;

		public float rotation = 0f;

		public float rotation2 = 0f;

		public float maxSteer;

		public bool drive;

		public float pos_y = 0f;

		public WheelSetting settings;
	}

	public ControlMode controlMode = ControlMode.simple;

	public bool activeControl = false;

	public CarWheels carWheels;

	public CarLights carLights;

	public CarSounds carSounds;

	public CarParticles carParticles;

	public CarSetting carSetting;

	[HideInInspector]
	public float steer = 0f;

	[HideInInspector]
	public float accel = 0f;

	[HideInInspector]
	public bool brake;

	private bool shifmotor;

	[HideInInspector]
	public float curTorque = 100f;

	[HideInInspector]
	public float powerShift = 100f;

	[HideInInspector]
	public bool shift;

	private float torque = 100f;

	[HideInInspector]
	public float speed = 0f;

	private float lastSpeed = -10f;

	private bool shifting = false;

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

	private float efficiencyTableStep = 250f;

	private float Pitch;

	private float PitchDelay;

	private float shiftTime = 0f;

	private float shiftDelay = 0f;

	[HideInInspector]
	public int currentGear = 0;

	[HideInInspector]
	public bool NeutralGear = true;

	[HideInInspector]
	public float motorRPM = 0f;

	[HideInInspector]
	public bool Backward = false;

	[HideInInspector]
	public float accelFwd = 0f;

	[HideInInspector]
	public float accelBack = 0f;

	[HideInInspector]
	public float steerAmount = 0f;

	private float wantedRPM = 0f;

	private float w_rotate;

	private float slip;

	private float slip2 = 0f;

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

	private Vector3 steerCurAngle;

	private Rigidbody myRigidbody;

	private WheelComponent[] wheels;

	public bool isOn = true;

	public bool isForciblyOff = false;

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

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

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

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

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

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

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

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

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

	private void Update()
	{
	}

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

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

		public float meleeMult = 1f;

		public float explosionMult = 1f;

		public float piercingMult = 1f;

		public float cuttingMult = 1f;

		public float thermalMult = 1f;

		public float bluntMult = 1f;

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

		public float maxHealth;

		public float minHealth;

		public VehicleDamagableMult dmgMult;

		public VehicleControl vehicle;

		public bool dead;

		private float prevhealth;

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

		public virtual void onHealthChange()
		{
		}

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

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

		public virtual void onDeath()
		{
		}

		public virtual void whileDead()
		{
		}

		public virtual void whileUndead()
		{
		}

		public virtual void onUndeath()
		{
		}

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

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

		public virtual void Damage()
		{
		}

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

		private void OnCollisionEnter(Collision collision)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Vector3 relativeVelocity = collision.relativeVelocity;
			if (!(((Vector3)(ref relativeVelocity)).magnitude < 2f))
			{
				VehicleDamagable component = collision.gameObject.GetComponent<VehicleDamagable>();
				if ((Object)(object)component != (Object)null)
				{
					component.HealPercent(percentHeal);
				}
			}
		}
	}
	internal class VehicleSeat : MonoBehaviour
	{
		public FVRViveHand hand;

		public GameObject SitPos;

		public GameObject EjectPos;

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

Hotchkiss_M1922_MODMAS.dll

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

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoStopLoopedEffect : MonoBehaviour
{
	public float effectDuration = 2.5f;

	private float d;

	private void OnEnable()
	{
		d = effectDuration;
	}

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

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

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

	public float speed = 30f;

	public Transform rotationCenter;

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

	public Vector3 rotation = Vector3.forward;

	public Vector3 axis = Vector3.forward;

	public bool gravity;

	private Vector3 dir;

	private void Start()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		dir = new Vector3(Random.Range(0f, 360f), Random.Range(0f, 360f), Random.Range(0f, 360f));
		((Vector3)(ref dir)).Scale(rotation);
		((Component)this).transform.localEulerAngles = dir;
	}

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

	public bool orderedSpawns = true;

	public float step = 1f;

	public float range = 5f;

	private float order = -5f;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject[] ParticleExamples;

	private int exampleIndex;

	private string randomSpawnsDelay = "0.5";

	private bool randomSpawns;

	private bool slowMo;

	private bool rotateCam = true;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

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

	public GameObject m4;

	public GameObject m4fps;

	private bool rotate_m4 = true;

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

	public GameObject spawnParticle()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		SetActiveCrossVersions(val, active: true);
		return val;
	}

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

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

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

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

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

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

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

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

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

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

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

	public Collider groundCollider;

	[Space]
	[Space]
	public Image slowMoBtn;

	public Text slowMoLabel;

	public Image camRotBtn;

	public Text camRotLabel;

	public Image groundBtn;

	public Text groundLabel;

	[Space]
	public Text EffectLabel;

	public Text EffectIndexLabel;

	public GameObject[] AdditionalEffects;

	public GameObject ground;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject m4;

	public GameObject m4fps;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

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

	private GameObject[] ParticleExamples;

	private int exampleIndex;

	private bool slowMo;

	private Vector3 defaultCamPosition;

	private Quaternion defaultCamRotation;

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

	private void Awake()
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		List<GameObject> list = new List<GameObject>();
		int childCount = ((Component)this).transform.childCount;
		for (int i = 0; i < childCount; i++)
		{
			GameObject gameObject = ((Component)((Component)this).transform.GetChild(i)).gameObject;
			list.Add(gameObject);
		}
		list.AddRange(AdditionalEffects);
		ParticleExamples = list.ToArray();
		defaultCamPosition = ((Component)Camera.main).transform.position;
		defaultCamRotation = ((Component)Camera.main).transform.rotation;
		((MonoBehaviour)this).StartCoroutine("CheckForDeletedParticles");
		UpdateUI();
	}

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

	public void OnToggleGround()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		groundRenderer.enabled = !groundRenderer.enabled;
		white.a = ((!groundRenderer.enabled) ? 0.33f : 1f);
		((Graphic)groundBtn).color = white;
		((Graphic)groundLabel).color = white;
	}

	public void OnToggleCamera()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		CFX_Demo_RotateCamera.rotating = !CFX_Demo_RotateCamera.rotating;
		white.a = ((!CFX_Demo_RotateCamera.rotating) ? 0.33f : 1f);
		((Graphic)camRotBtn).color = white;
		((Graphic)camRotLabel).color = white;
	}

	public void OnToggleSlowMo()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		slowMo = !slowMo;
		if (slowMo)
		{
			Time.timeScale = 0.33f;
			white.a = 1f;
		}
		else
		{
			Time.timeScale = 1f;
			white.a = 0.33f;
		}
		((Graphic)slowMoBtn).color = white;
		((Graphic)slowMoLabel).color = white;
	}

	public void OnPreviousEffect()
	{
		prevParticle();
	}

	public void OnNextEffect()
	{
		nextParticle();
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	public float delay = 0f;

	public float finalIntensity = 0f;

	private float baseIntensity;

	public bool autodestruct;

	private float p_lifetime = 0f;

	private float p_delay;

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

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

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

	public float lifetime = 10f;

	public float fadeoutpercent = 80f;

	public Vector2 frames;

	public bool randomRotation = false;

	public bool deactivate = false;

	private float life;

	private float fadeout;

	private Color color;

	private float orgAlpha;

	private void Awake()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		color = ((Component)this).GetComponent<Renderer>().material.GetColor("_TintColor");
		orgAlpha = color.a;
	}

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

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

	private float timer;

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

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

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

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

	public bool hideObjectsInHierarchy = false;

	public bool spawnAsChildren = true;

	public bool onlyGetInactiveObjects = false;

	public bool instantiateIfNeeded = false;

	private bool allObjectsLoaded;

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

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

	public static bool AllObjectsLoaded => instance.allObjectsLoaded;

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

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

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

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

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

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

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

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

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Billiam_J_McGoonigan.Hotchkiss_M1922_MODMAS");
		OtherLoader.RegisterDirectLoad(BasePath, "Billiam_J_McGoonigan.Hotchkiss_M1922_MODMAS", "", "", "modmasitem31", "");
	}
}
public enum ControlMode
{
	simple = 1,
	touch
}
public class VehicleControl : MonoBehaviour
{
	[Serializable]
	public class CarWheels
	{
		public ConnectWheel wheels;
	}

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

		public Transform frontRight;

		public Transform frontLeft;

		public WheelSetting frontSetting;

		public bool backWheelDrive = true;

		public Transform backRight;

		public Transform backLeft;

		public WheelSetting rearSetting;
	}

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

		public float Weight = 1000f;

		public float Distance = 0.2f;
	}

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

		public Light[] reverseLights;
	}

	[Serializable]
	public class CarSounds
	{
		public AudioSource IdleEngine;

		public AudioSource LowEngine;

		public AudioSource HighEngine;

		public float minPitch = 1f;

		public float maxPitch = 10f;

		public AudioSource nitro;

		public AudioSource switchGear;
	}

	[Serializable]
	public class CarParticles
	{
		public GameObject brakeParticlePerfab;

		public ParticleSystem shiftParticle1;

		public ParticleSystem shiftParticle2;

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

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

		public Transform carSteer;

		public HitGround[] hitGround;

		public List<Transform> cameraSwitchView;

		public float springs = 25000f;

		public float dampers = 1500f;

		public float carPower = 120f;

		public float shiftPower = 150f;

		public float brakePower = 8000f;

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

		public float maxSteerAngle = 25f;

		public float shiftDownRPM = 1500f;

		public float shiftUpRPM = 2500f;

		public float idleRPM = 500f;

		public float stiffness = 2f;

		public bool automaticGear = true;

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

		public float LimitBackwardSpeed = 60f;

		public float LimitForwardSpeed = 220f;
	}

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

		public bool grounded = false;

		public AudioClip brakeSound;

		public AudioClip groundSound;

		public Color brakeColor;
	}

	private class WheelComponent
	{
		public Transform wheel;

		public WheelCollider collider;

		public Vector3 startPos;

		public float rotation = 0f;

		public float rotation2 = 0f;

		public float maxSteer;

		public bool drive;

		public float pos_y = 0f;

		public WheelSetting settings;
	}

	public ControlMode controlMode = ControlMode.simple;

	public bool activeControl = false;

	public CarWheels carWheels;

	public CarLights carLights;

	public CarSounds carSounds;

	public CarParticles carParticles;

	public CarSetting carSetting;

	[HideInInspector]
	public float steer = 0f;

	[HideInInspector]
	public float accel = 0f;

	[HideInInspector]
	public bool brake;

	private bool shifmotor;

	[HideInInspector]
	public float curTorque = 100f;

	[HideInInspector]
	public float powerShift = 100f;

	[HideInInspector]
	public bool shift;

	private float torque = 100f;

	[HideInInspector]
	public float speed = 0f;

	private float lastSpeed = -10f;

	private bool shifting = false;

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

	private float efficiencyTableStep = 250f;

	private float Pitch;

	private float PitchDelay;

	private float shiftTime = 0f;

	private float shiftDelay = 0f;

	[HideInInspector]
	public int currentGear = 0;

	[HideInInspector]
	public bool NeutralGear = true;

	[HideInInspector]
	public float motorRPM = 0f;

	[HideInInspector]
	public bool Backward = false;

	[HideInInspector]
	public float accelFwd = 0f;

	[HideInInspector]
	public float accelBack = 0f;

	[HideInInspector]
	public float steerAmount = 0f;

	private float wantedRPM = 0f;

	private float w_rotate;

	private float slip;

	private float slip2 = 0f;

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

	private Vector3 steerCurAngle;

	private Rigidbody myRigidbody;

	private WheelComponent[] wheels;

	public bool isOn = true;

	public bool isForciblyOff = false;

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

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

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

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

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

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

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

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

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

	private void Update()
	{
	}

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

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

Meloncorp_M1891_MkIV_Pistol.dll

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

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[RequireComponent(typeof(ParticleSystem))]
public class CFX_AutoStopLoopedEffect : MonoBehaviour
{
	public float effectDuration = 2.5f;

	private float d;

	private void OnEnable()
	{
		d = effectDuration;
	}

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

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

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

	public float speed = 30f;

	public Transform rotationCenter;

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

	public Vector3 rotation = Vector3.forward;

	public Vector3 axis = Vector3.forward;

	public bool gravity;

	private Vector3 dir;

	private void Start()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		dir = new Vector3(Random.Range(0f, 360f), Random.Range(0f, 360f), Random.Range(0f, 360f));
		((Vector3)(ref dir)).Scale(rotation);
		((Component)this).transform.localEulerAngles = dir;
	}

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

	public bool orderedSpawns = true;

	public float step = 1f;

	public float range = 5f;

	private float order = -5f;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject[] ParticleExamples;

	private int exampleIndex;

	private string randomSpawnsDelay = "0.5";

	private bool randomSpawns;

	private bool slowMo;

	private bool rotateCam = true;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

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

	public GameObject m4;

	public GameObject m4fps;

	private bool rotate_m4 = true;

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

	public GameObject spawnParticle()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(ParticleExamples[exampleIndex]);
		if (((Object)val).name.StartsWith("WFX_MF"))
		{
			val.transform.parent = ParticleExamples[exampleIndex].transform.parent;
			val.transform.localPosition = ParticleExamples[exampleIndex].transform.localPosition;
			val.transform.localRotation = ParticleExamples[exampleIndex].transform.localRotation;
		}
		else if (((Object)val).name.Contains("Hole"))
		{
			val.transform.parent = bulletholes.transform;
		}
		SetActiveCrossVersions(val, active: true);
		return val;
	}

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

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

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

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

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

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

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

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

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

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

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

	public Collider groundCollider;

	[Space]
	[Space]
	public Image slowMoBtn;

	public Text slowMoLabel;

	public Image camRotBtn;

	public Text camRotLabel;

	public Image groundBtn;

	public Text groundLabel;

	[Space]
	public Text EffectLabel;

	public Text EffectIndexLabel;

	public GameObject[] AdditionalEffects;

	public GameObject ground;

	public GameObject walls;

	public GameObject bulletholes;

	public GameObject m4;

	public GameObject m4fps;

	public Material wood;

	public Material concrete;

	public Material metal;

	public Material checker;

	public Material woodWall;

	public Material concreteWall;

	public Material metalWall;

	public Material checkerWall;

	private string groundTextureStr = "Checker";

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

	private GameObject[] ParticleExamples;

	private int exampleIndex;

	private bool slowMo;

	private Vector3 defaultCamPosition;

	private Quaternion defaultCamRotation;

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

	private void Awake()
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		List<GameObject> list = new List<GameObject>();
		int childCount = ((Component)this).transform.childCount;
		for (int i = 0; i < childCount; i++)
		{
			GameObject gameObject = ((Component)((Component)this).transform.GetChild(i)).gameObject;
			list.Add(gameObject);
		}
		list.AddRange(AdditionalEffects);
		ParticleExamples = list.ToArray();
		defaultCamPosition = ((Component)Camera.main).transform.position;
		defaultCamRotation = ((Component)Camera.main).transform.rotation;
		((MonoBehaviour)this).StartCoroutine("CheckForDeletedParticles");
		UpdateUI();
	}

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

	public void OnToggleGround()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		groundRenderer.enabled = !groundRenderer.enabled;
		white.a = ((!groundRenderer.enabled) ? 0.33f : 1f);
		((Graphic)groundBtn).color = white;
		((Graphic)groundLabel).color = white;
	}

	public void OnToggleCamera()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		CFX_Demo_RotateCamera.rotating = !CFX_Demo_RotateCamera.rotating;
		white.a = ((!CFX_Demo_RotateCamera.rotating) ? 0.33f : 1f);
		((Graphic)camRotBtn).color = white;
		((Graphic)camRotLabel).color = white;
	}

	public void OnToggleSlowMo()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		Color white = Color.white;
		slowMo = !slowMo;
		if (slowMo)
		{
			Time.timeScale = 0.33f;
			white.a = 1f;
		}
		else
		{
			Time.timeScale = 1f;
			white.a = 0.33f;
		}
		((Graphic)slowMoBtn).color = white;
		((Graphic)slowMoLabel).color = white;
	}

	public void OnPreviousEffect()
	{
		prevParticle();
	}

	public void OnNextEffect()
	{
		nextParticle();
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	public float delay = 0f;

	public float finalIntensity = 0f;

	private float baseIntensity;

	public bool autodestruct;

	private float p_lifetime = 0f;

	private float p_delay;

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

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

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

	public float lifetime = 10f;

	public float fadeoutpercent = 80f;

	public Vector2 frames;

	public bool randomRotation = false;

	public bool deactivate = false;

	private float life;

	private float fadeout;

	private Color color;

	private float orgAlpha;

	private void Awake()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		color = ((Component)this).GetComponent<Renderer>().material.GetColor("_TintColor");
		orgAlpha = color.a;
	}

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

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

	private float timer;

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

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

	public GameObject firstCartridge;

	public int numberOfCartridges = 1;

	public bool mirrorX;

	public float cartridgeOffsetY = 0f;

	public float cartridgeOffsetZ = 0f;

	public bool generateFollowerPoints;

	public bool useFollowerOffsets = false;

	public bool invertFollowerOffsets = false;

	public GameObject follower;

	public float followerOffsetY = 0f;

	public float followerOffsetZ = 0f;

	private GameObject cartridge_root;

	private GameObject[] CartridgeObjectList;

	private MeshFilter[] CartridgeMeshFilterList;

	private MeshRenderer[] CartridgeMeshRendererList;

	private float cartridge_currentX;

	private float cartridge_currentY;

	private float cartridge_currentZ;

	private bool ready1 = true;

	private bool ready2 = true;

	private GameObject follower_root;

	private GameObject[] FollowerObjectList;

	private float follower_currentX;

	private float follower_currentY;

	private float follower_currentZ;

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

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

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

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

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

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

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

	private void Awake()
	{
		LoadAssets();
	}

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

	[SerializeField]
	private bool createMultiMaterialMesh = false;

	[SerializeField]
	private bool combineInactiveChildren = false;

	[SerializeField]
	private bool deactivateCombinedChildren = true;

	[SerializeField]
	private bool deactivateCombinedChildrenMeshRenderers = false;

	[SerializeField]
	private bool generateUVMap = false;

	[SerializeField]
	private bool destroyCombinedChildren = false;

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

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

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

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

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

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

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

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

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

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

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

	public void CombineMeshes(bool showCreatedMeshInfo)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		Vector3 localScale = ((Component)this).transform.localScale;
		int siblingIndex = ((Component)this).transform.GetSiblingIndex();
		Transform parent = ((Component)this).transform.parent;
		((Component)this).transform.parent = null;
		Quaternion rotation = ((Component)this).transform.rotation;
		Vector3 position = ((Component)this).transform.position;
		Vector3 localScale2 = ((Component)this).transform.localScale;
		((Component)this).transform.rotation = Quaternion.identity;
		((Component)this).transform.position = Vector3.zero;
		((Component)this).transform.localScale = Vector3.one;
		if (!createMultiMaterialMesh)
		{
			CombineMeshesWithSingleMaterial(showCreatedMeshInfo);
		}
		else
		{
			CombineMeshesWithMutliMaterial(showCreatedMeshInfo);
		}
		((Component)this).transform.rotation = rotation;
		((Component)this).transform.position = position;
		((Component)this).transform.localScale = localScale2;
		((Component)this).transform.parent = parent;
		((Component)this).transform.SetSiblingIndex(siblingIndex);
		((Component)this).transform.localScale = localScale;
	}

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

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

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

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

	private void GenerateUV(Mesh combinedMesh)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (generateUVMap)
		{
			UnwrapParam val = default(UnwrapParam);
			UnwrapParam.SetDefaults(ref val);
			Unwrapping.GenerateSecondaryUVSet(combinedMesh, val);
		}
	}
}
[ExecuteInEditMode]
public class PostEffectScript : MonoBehaviour
{
	public Material mat;

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

	public Material bloom;

	public bool renderNightVision = true;

	public bool renderBloom = true;

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

	private const int BoxDownPrefilterPass = 0;

	private const int BoxDownPass = 1;

	private const int BoxUpPass = 2;

	private const int ApplyBloomPass = 3;

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

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

VZ25SMG.dll

Decompiled 3 weeks ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

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

	public GameObject objectToToggle;

	private Vector3 originalPosition;

	private void Start()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		originalPosition = targetObject.position;
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		if (targetObject.position != originalPosition)
		{
			if (objectToToggle.activeSelf)
			{
				objectToToggle.SetActive(false);
			}
		}
		else if (!objectToToggle.activeSelf)
		{
			objectToToggle.SetActive(true);
		}
	}
}
namespace Volks.VZ25SMG;

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volks.VZ25SMG");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.VZ25SMG", "", "", "modmas2024_item58", "");
	}
}

9A91_VSK94_Modmas.dll

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

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace NotWolfie.9A91_VSK94_Modmas
{
	[BepInPlugin("NotWolfie.9A91_VSK94_Modmas", "9A91_VSK94_Modmas", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class 9A91_VSK94_ModmasPlugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource Logger;

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

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "NotWolfie.9A91_VSK94_Modmas");
			OtherLoader.RegisterDirectLoad(BasePath, "NotWolfie.9A91_VSK94_Modmas", "", "", "modmas2024_item21", "");
		}
	}
}
namespace H3VRUtils.Vehicles
{
	public class ButtonIgnition : FVRInteractiveObject
	{
		public VehicleControl vehicle;

		public VehicleAudioSet audioSet;

		public float ignitionTime;

		private float m_it;

		public float failChance;

		public Random rand;

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

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

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

		public float damageMult = 15f;

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

		public Vector3 rotation;

		public int left = -1;

		public int up = -1;

		public int right = -1;

		public int down = -1;

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

		public Text gearText;

		public int currentNode;

		public List<DriveShiftNode> driveShiftNodes;

		public VehicleAudioSet audioSet;

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

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

		public GameObject explosionCentre;

		public float SmokeParticleHPThreshold;

		public float explosionStrength = 200f;

		public GameObject particleSmokePrefab;

		public GameObject particleFirePrefab;

		public GameObject explosionPrefab;

		public GameObject fixedMesh;

		public GameObject damagedMesh;

		public GameObject destroyedMesh;

		private ParticleSystem particleSmoke;

		private ParticleSystem particleFire;

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

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

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

		public override void whileDead()
		{
		}

		public override void whileUndead()
		{
		}

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

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

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

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

		public Vector3 rotRegular;

		public Vector3 rotDownwards;

		public GameObject lift;

		public float liftSpeed;

		public float minLiftY;

		public float maxLiftY;

		public void UpdateInteraction(FVRViveHand hand)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = lift.transform.position;
			((Component)this).transform.localEulerAngles = rotRegular;
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f)
			{
				position.y += liftSpeed / 50f;
				((Component)this).transform.localEulerAngles = rotUpwards;
			}
			if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f)
			{
				position.y -= liftSpeed / 50f;
				((Component)this).transform.localEulerAngles = rotDownwards;
			}
			if (position.y > maxLiftY)
			{
				position.y = maxLiftY;
			}
			else if (position.y < minLiftY)
			{
				position.y = minLiftY;
			}
			lift.transform.position = position;
		}
	}
	public class FuelNeedle : MonoBehaviour
	{
		public FuelTank tank;

		public GameObject needle;

		public bool isImperial;

		public Vector3 needleNoFuel;

		public Vector3 needleMaxFuel;

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

		public float maxFuel;

		public float fuelUsagePer1000Rpm = 0.01f;

		public float leakMult;

		public GameObject explosionEffect;

		public bool BlowsOnDeath;

		public AudioSource leakSound;

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

		public override void onDeath()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			base.onDeath();
			if (BlowsOnDeath)
			{
				Object.Instantiate<GameObject>(explosionEffect, ((Component)this).transform.position, ((Component)this).transform.rotation);
			}
		}

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

		public GameObject LockPos;

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

		public Vector3 positionOff;

		public Vector3 positionOn;

		public Vector3 rotationOff;

		public Vector3 rotationOn;

		public bool isOn;

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

		public GameObject needle;

		public bool isImperial;

		public float maxSpeed;

		public Vector3 needleNoSpeed;

		public Vector3 needleMaxSpeed;

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

		public float resetLerpSpeed;

		public float maxRot;

		public bool isBraking;

		public bool reverseRot;

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

		public float rot;

		public float rh;

		public float lr;

		public float inlerp;

		public float lerp;

		public float rotAmt;

		public VehicleAudioSet audioSet;

		public void BeginInteraction(FVRViveHand hand)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			Transform child = ((Component)this).transform.GetChild(0);
			child.parent = null;
			Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles;
			((Component)this).transform.LookAt(((Component)hand).transform);
			((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, localEulerAngles.z);
			child.parent = ((Component)this).transform;
		}

		public void EndInteraction(FVRViveHand hand)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			Transform child = ((Component)this).transform.GetChild(0);
			child.parent = null;
			((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, 0f, ((Component)this).transform.localEulerAngles.z);
			child.parent = ((Component)this).transform;
		}

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

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

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

		public AudioEvent VehicleStart;

		public AudioEvent VehicleIdle;

		public AudioEvent VehicleStop;

		public AudioEvent HandbrakeUp;

		public AudioEvent HandbrakeDown;

		public AudioEvent ShiftDownGear;

		public AudioEvent RevLoop;

		public AudioEvent ShiftUpGear;

		public AudioEvent Brake;

		public AudioEvent BrakeLong;

		public AudioEvent PedalSwitchSound;

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

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

		public Transform frontRight;

		public Transform frontLeft;

		public WheelSetting frontSetting;

		public bool backWheelDrive = true;

		public Transform backRight;

		public Transform backLeft;

		public WheelSetting rearSetting;
	}

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

		public float Weight = 1000f;

		public float Distance = 0.2f;
	}

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

		public Light[] reverseLights;
	}

	[Serializable]
	public class CarSounds
	{
		public AudioSource IdleEngine;

		public AudioSource LowEngine;

		public AudioSource HighEngine;

		public float minPitch = 1f;

		public float maxPitch = 10f;

		public AudioSource nitro;

		public AudioSource switchGear;
	}

	[Serializable]
	public class CarParticles
	{
		public GameObject brakeParticlePerfab;

		public ParticleSystem shiftParticle1;

		public ParticleSystem shiftParticle2;

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

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

		public Transform carSteer;

		public HitGround[] hitGround;

		public List<Transform> cameraSwitchView;

		public float springs = 25000f;

		public float dampers = 1500f;

		public float carPower = 120f;

		public float shiftPower = 150f;

		public float brakePower = 8000f;

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

		public float maxSteerAngle = 25f;

		public float shiftDownRPM = 1500f;

		public float shiftUpRPM = 2500f;

		public float idleRPM = 500f;

		public float stiffness = 2f;

		public bool automaticGear = true;

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

		public float LimitBackwardSpeed = 60f;

		public float LimitForwardSpeed = 220f;
	}

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

		public bool grounded = false;

		public AudioClip brakeSound;

		public AudioClip groundSound;

		public Color brakeColor;
	}

	private class WheelComponent
	{
		public Transform wheel;

		public WheelCollider collider;

		public Vector3 startPos;

		public float rotation = 0f;

		public float rotation2 = 0f;

		public float maxSteer;

		public bool drive;

		public float pos_y = 0f;

		public WheelSetting settings;
	}

	public ControlMode controlMode = ControlMode.simple;

	public bool activeControl = false;

	public CarWheels carWheels;

	public CarLights carLights;

	public CarSounds carSounds;

	public CarParticles carParticles;

	public CarSetting carSetting;

	[HideInInspector]
	public float steer = 0f;

	[HideInInspector]
	public float accel = 0f;

	[HideInInspector]
	public bool brake;

	private bool shifmotor;

	[HideInInspector]
	public float curTorque = 100f;

	[HideInInspector]
	public float powerShift = 100f;

	[HideInInspector]
	public bool shift;

	private float torque = 100f;

	[HideInInspector]
	public float speed = 0f;

	private float lastSpeed = -10f;

	private bool shifting = false;

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

	private float efficiencyTableStep = 250f;

	private float Pitch;

	private float PitchDelay;

	private float shiftTime = 0f;

	private float shiftDelay = 0f;

	[HideInInspector]
	public int currentGear = 0;

	[HideInInspector]
	public bool NeutralGear = true;

	[HideInInspector]
	public float motorRPM = 0f;

	[HideInInspector]
	public bool Backward = false;

	[HideInInspector]
	public float accelFwd = 0f;

	[HideInInspector]
	public float accelBack = 0f;

	[HideInInspector]
	public float steerAmount = 0f;

	private float wantedRPM = 0f;

	private float w_rotate;

	private float slip;

	private float slip2 = 0f;

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

	private Vector3 steerCurAngle;

	private Rigidbody myRigidbody;

	private WheelComponent[] wheels;

	public bool isOn = true;

	public bool isForciblyOff = false;

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

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

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

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

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

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

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

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

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

	private void Update()
	{
	}

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

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

		public float meleeMult = 1f;

		public float explosionMult = 1f;

		public float piercingMult = 1f;

		public float cuttingMult = 1f;

		public float thermalMult = 1f;

		public float bluntMult = 1f;

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

		public float maxHealth;

		public float minHealth;

		public VehicleDamagableMult dmgMult;

		public VehicleControl vehicle;

		public bool dead;

		private float prevhealth;

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

		public virtual void onHealthChange()
		{
		}

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

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

		public virtual void onDeath()
		{
		}

		public virtual void whileDead()
		{
		}

		public virtual void whileUndead()
		{
		}

		public virtual void onUndeath()
		{
		}

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

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

		public virtual void Damage()
		{
		}

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

		private void OnCollisionEnter(Collision collision)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Vector3 relativeVelocity = collision.relativeVelocity;
			if (!(((Vector3)(ref relativeVelocity)).magnitude < 2f))
			{
				VehicleDamagable component = collision.gameObject.GetComponent<VehicleDamagable>();
				if ((Object)(object)component != (Object)null)
				{
					component.HealPercent(percentHeal);
				}
			}
		}
	}
	internal class VehicleSeat : MonoBehaviour
	{
		public FVRViveHand hand;

		public GameObject SitPos;

		public GameObject EjectPos;

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

Modmas2024_Item52.dll

Decompiled 3 weeks ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using OtherLoader;
using UnityEngine;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Modmas2024.Modmas2024_Item52;

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		OtherLoader.RegisterDirectLoad(BasePath, "Modmas2024.Modmas2024_Item52", "", "", "modmas2024_item52", "");
	}
}
public class ProjectileExtractor : MonoBehaviour
{
	public FVRFireArmRound Round;

	public BallisticProjectile Projectile;

	[ContextMenu("Extract")]
	public void Extract()
	{
		if ((Object)(object)Round != (Object)null && (Object)(object)Projectile == (Object)null)
		{
			Projectile = Object.Instantiate<GameObject>(Round.BallisticProjectilePrefab).GetComponent<BallisticProjectile>();
		}
		if ((Object)(object)Projectile.ExtraDisplay != (Object)null)
		{
			Object.Instantiate<GameObject>(Projectile.ExtraDisplay);
		}
		foreach (Submunition submunition in Projectile.Submunitions)
		{
			foreach (GameObject prefab in submunition.Prefabs)
			{
				Object.Instantiate<GameObject>(prefab);
			}
		}
	}
}

Story_LongshotMF.dll

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

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

	public float MaxLightIntensity = 2.3f;

	public float AccelerateTime = 0.15f;

	private float _targetIntensity = 1f;

	private float _lastIntensity = 1f;

	private float _timePassed = 0f;

	private Light _lt;

	private const double Tolerance = 0.0001;

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

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

	public bool scrollY = true;

	private MeshRenderer renderer;

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

	private void Update()
	{
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		float num = Time.time * scrollSpeed;
		((Renderer)renderer).material.SetTextureOffset("_MainTex", (!scrollY) ? new Vector2(0f, num) : new Vector2(num, 0f));
	}
}
namespace Storymods.Story_LongshotMF;

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Storymods.Story_LongshotMF");
		OtherLoader.RegisterDirectLoad(BasePath, "Storymods.Story_LongshotMF", "", "", "modmas2024_item41", "");
	}
}
public class Cabernade : MonoBehaviour
{
	public GameObject caberUnexploded;

	public GameObject caberExploded;

	public bool isCaberKablooey;

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

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

	public float modifierNumber = 1f;

	public bool doesHavePerfectFOV = false;

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

Zbroyar_Z_008.dll

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

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace localpcnerd.Zbroyar_Z_008
{
	[BepInPlugin("localpcnerd.Zbroyar_Z_008", "Zbroyar_Z_008", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class Zbroyar_Z_008Plugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource Logger;

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

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "localpcnerd.Zbroyar_Z_008");
			OtherLoader.RegisterDirectLoad(BasePath, "localpcnerd.Zbroyar_Z_008", "", "", "modmas2024_item64", "");
		}
	}
}
public class LockBoltOnSafe : OpenBoltSecondarySelectorSwitch
{
	public OpenBoltReceiverBolt OBRB;

	public OpenBoltReceiver OBR;

	public void Update()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		if ((int)OBR.FireSelector_Modes[OBR.m_fireSelectorMode].ModeType == 0)
		{
			((FVRInteractiveObject)OBRB).ForceBreakInteraction();
		}
	}
}
public class Powerfist : FVRPhysicalObject
{
	[Header("Fist Properties")]
	public PunchArea punchArea;

	public float velocityThreshold;

	public Animator anim;

	public override void UpdateInteraction(FVRViveHand hand)
	{
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		((FVRPhysicalObject)this).UpdateInteraction(hand);
		float triggerFloat = hand.Input.TriggerFloat;
		anim.SetFloat("Blend", triggerFloat);
		if (triggerFloat > 0.7f)
		{
			Vector3 velocity = ((FVRPhysicalObject)this).RootRigidbody.velocity;
			if (((Vector3)(ref velocity)).magnitude >= velocityThreshold)
			{
				hand.Buzz(hand.Buzzer.Buzz_GunShot);
				punchArea.canPunch = true;
				return;
			}
		}
		punchArea.canPunch = false;
	}
}
public class PunchArea : MonoBehaviour
{
	[HideInInspector]
	public bool canPunch;

	public GameObject spawnOnPunch;

	public Transform SOPPos;

	public void OnTriggerEnter(Collider other)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		Rigidbody componentInParent = ((Component)other).GetComponentInParent<Rigidbody>();
		if (canPunch && Object.op_Implicit((Object)(object)componentInParent))
		{
			Object.Instantiate<GameObject>(spawnOnPunch, SOPPos.position, SOPPos.rotation);
		}
	}
}
public class Ripper : FVRPhysicalObject
{
	[Header("Ripper")]
	public AudioSource SawAudio;

	public AudioSource StartingAudio;

	public AudioClip AudClip_Start;

	public AudioClip AudClip_Idle;

	public AudioClip AudClip_Buzzing;

	public AudioClip AudClip_Hitting;

	private bool m_isRunning;

	private float m_currentCableLength;

	private float m_lastCableLength;

	private float m_motorSpeed;

	private float triggerAmount;

	private float m_sawingIntesity;

	public bool UsesBladeSolidBits = true;

	public Renderer BladeSolid;

	public Renderer BladeBits;

	[Tooltip("Alternative to BladeSolidBits, repeatedly toggles between set of blade objects to emulate movement. When saw is off, defaults to index 0 object.")]
	public bool CycleBladeObjects;

	public GameObject[] BladeObjects;

	[Tooltip("Time each object is enabled, lower to cycle faster.")]
	public float BladeObjectSwitchInterval;

	private Material m_matBladeSolid;

	private Material m_matBladeBits;

	public Collider[] BladeCols;

	private HashSet<Collider> m_bladeCols = new HashSet<Collider>();

	public ParticleSystem Sparks;

	private EmitParams emitParams;

	public Transform BladePoint1;

	public Transform BladePoint2;

	private List<IFVRDamageable> DamageablesToDo;

	private HashSet<IFVRDamageable> DamageablesToDoHS;

	private List<Vector3> DamageableHitPoints;

	private List<Vector3> DamageableHitNormals;

	private float TimeSinceDamageDealing = 0.2f;

	public ParticleSystem EngineSmoke;

	public bool UsesEngineRot = true;

	public Transform EngineRot;

	public float PerceptibleEventVolume = 50f;

	public float PerceptibleEventRange = 30f;

	private float m_timeTilPerceptibleEventTick = 0.2f;

	private float timeSinceCollision = 1f;

	private int framesTilFlash;

	private float bladeObjectCycleTime;

	private int bladeIndex = 0;

	private float timeSinceTryTurnOff;

	public override void Awake()
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		((FVRPhysicalObject)this).Awake();
		emitParams = default(EmitParams);
		if (UsesBladeSolidBits)
		{
			m_matBladeSolid = BladeSolid.materials[0];
			m_matBladeBits = BladeBits.material;
		}
		for (int i = 0; i < BladeCols.Length; i++)
		{
			m_bladeCols.Add(BladeCols[i]);
		}
		DamageablesToDo = new List<IFVRDamageable>();
		DamageablesToDoHS = new HashSet<IFVRDamageable>();
		DamageableHitPoints = new List<Vector3>();
		DamageableHitNormals = new List<Vector3>();
	}

	public override void Start()
	{
		((FVRInteractiveObject)this).Start();
	}

	public override void UpdateInteraction(FVRViveHand hand)
	{
		((FVRPhysicalObject)this).UpdateInteraction(hand);
		if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && !base.IsAltHeld)
		{
			triggerAmount = hand.Input.TriggerFloat;
			if (((hand.IsInStreamlinedMode && hand.Input.BYButtonDown && m_isRunning) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown && m_isRunning)) && timeSinceTryTurnOff <= 0f)
			{
				timeSinceTryTurnOff = 0.2f;
				Debug.Log((object)"attempting to shut off ripper");
				m_motorSpeed = 0f;
				m_isRunning = false;
			}
			if (((hand.IsInStreamlinedMode && hand.Input.BYButtonDown && !m_isRunning) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown && !m_isRunning)) && timeSinceTryTurnOff <= 0f)
			{
				timeSinceTryTurnOff = 0.2f;
				Debug.Log((object)"turning on ripper");
				m_isRunning = true;
				m_currentCableLength = 0f;
				SetCableLength(8f);
			}
		}
	}

	public void OnCollisionStay(Collision col)
	{
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d0: 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_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: 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_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_023a: Unknown result type (might be due to invalid IL or missing references)
		//IL_023c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_024d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0255: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_0296: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		if (!m_isRunning || !(m_sawingIntesity > 0.1f))
		{
			return;
		}
		int num = 0;
		for (int i = 0; i < col.contacts.Length; i++)
		{
			if (!m_bladeCols.Contains(((ContactPoint)(ref col.contacts[i])).thisCollider))
			{
				continue;
			}
			IFVRDamageable component = ((Component)((Component)((ContactPoint)(ref col.contacts[i])).otherCollider).transform).gameObject.GetComponent<IFVRDamageable>();
			if (component != null && DamageablesToDoHS.Add(component))
			{
				DamageablesToDo.Add(component);
				DamageableHitPoints.Add(((ContactPoint)(ref col.contacts[i])).point);
				DamageableHitNormals.Add(((ContactPoint)(ref col.contacts[i])).normal);
			}
			if (component == null && (Object)(object)((ContactPoint)(ref col.contacts[i])).otherCollider.attachedRigidbody != (Object)null)
			{
				component = ((Component)((ContactPoint)(ref col.contacts[i])).otherCollider.attachedRigidbody).gameObject.GetComponent<IFVRDamageable>();
				if (DamageablesToDoHS.Add(component))
				{
					DamageablesToDo.Add(component);
					DamageableHitPoints.Add(((ContactPoint)(ref col.contacts[i])).point);
					DamageableHitNormals.Add(((ContactPoint)(ref col.contacts[i])).normal);
				}
			}
			if (num < 2)
			{
				timeSinceCollision = 0f;
				num++;
				Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(BladePoint1.position, BladePoint2.position, ((ContactPoint)(ref col.contacts[i])).point);
				Vector3 val = ((ContactPoint)(ref col.contacts[i])).point - closestValidPoint;
				val = Vector3.ClampMagnitude(val, 0.04f);
				Vector3 val2 = closestValidPoint + val;
				((EmitParams)(ref emitParams)).position = val2;
				Vector3 val3 = Vector3.Cross(((Vector3)(ref val)).normalized, ((Component)this).transform.right) * Random.Range(1f, 10f);
				val3 += Random.onUnitSphere * 3f;
				val3 += val * 2f;
				((EmitParams)(ref emitParams)).velocity = val3;
				Sparks.Emit(emitParams, 1);
				if (framesTilFlash <= 0)
				{
					framesTilFlash = Random.Range(3, 7);
					FXM.InitiateMuzzleFlash(val2, ((ContactPoint)(ref col.contacts[i])).normal, Random.Range(0.25f, 2f), Color.white, Random.Range(0.5f, 1f));
				}
			}
		}
	}

	public override void FVRUpdate()
	{
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Expected O, but got Unknown
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Expected O, but got Unknown
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_023c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0241: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: 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_069c: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_057b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0580: Unknown result type (might be due to invalid IL or missing references)
		//IL_059f: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04db: Unknown result type (might be due to invalid IL or missing references)
		//IL_0713: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05da: Unknown result type (might be due to invalid IL or missing references)
		//IL_05de: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_062f: Unknown result type (might be due to invalid IL or missing references)
		((FVRPhysicalObject)this).FVRUpdate();
		if (framesTilFlash > 0)
		{
			framesTilFlash--;
		}
		if (timeSinceCollision < 1f)
		{
			timeSinceCollision += Time.deltaTime;
		}
		timeSinceTryTurnOff -= Time.deltaTime;
		if (TimeSinceDamageDealing > 0f)
		{
			TimeSinceDamageDealing -= Time.deltaTime;
		}
		else
		{
			Damage val = new Damage();
			Vector3 velocity = ((FVRPhysicalObject)this).RootRigidbody.velocity;
			val.Dam_Blunt = 100f * Mathf.Clamp(((Vector3)(ref velocity)).magnitude, 1f, 3f);
			Vector3 velocity2 = ((FVRPhysicalObject)this).RootRigidbody.velocity;
			val.Dam_Cutting = 250f * Mathf.Clamp(((Vector3)(ref velocity2)).magnitude, 1f, 2f);
			val.Dam_TotalKinetic = val.Dam_Cutting + val.Dam_Blunt;
			val.Class = (DamageClass)3;
			for (int i = 0; i < DamageablesToDo.Count; i++)
			{
				if ((Object)(MonoBehaviour)DamageablesToDo[i] != (Object)null)
				{
					val.hitNormal = DamageableHitNormals[i];
					val.point = DamageableHitPoints[i];
					val.strikeDir = -val.hitNormal;
					DamageablesToDo[i].Damage(val);
				}
			}
			DamageablesToDo.Clear();
			DamageablesToDoHS.Clear();
			DamageableHitPoints.Clear();
			DamageableHitNormals.Clear();
			TimeSinceDamageDealing = 0.1f;
		}
		if (!m_isRunning)
		{
			SawAudio.volume = m_motorSpeed * 0.7f;
			StartingAudio.volume = m_motorSpeed;
			if (m_motorSpeed <= 0f && StartingAudio.isPlaying)
			{
				StartingAudio.Stop();
			}
			if (UsesBladeSolidBits)
			{
				m_matBladeSolid.SetVector("_MainTexVelocity", Vector4.op_Implicit(new Vector2(0f, 0f)));
				m_matBladeBits.SetVector("_MainTexVelocity", Vector4.op_Implicit(new Vector2(0f, 0f)));
			}
			if (CycleBladeObjects)
			{
				GameObject[] bladeObjects = BladeObjects;
				foreach (GameObject val2 in bladeObjects)
				{
					val2.SetActive(false);
				}
				BladeObjects[0].SetActive(true);
			}
			EmissionModule emission = EngineSmoke.emission;
			MinMaxCurve rate = ((EmissionModule)(ref emission)).rate;
			((MinMaxCurve)(ref rate)).mode = (ParticleSystemCurveMode)0;
			((MinMaxCurve)(ref rate)).constantMax = 0f;
			((MinMaxCurve)(ref rate)).constantMin = 0f;
			((EmissionModule)(ref emission)).rate = rate;
		}
		else
		{
			if (bladeObjectCycleTime < BladeObjectSwitchInterval)
			{
				bladeObjectCycleTime += Time.deltaTime;
			}
			else
			{
				CycleBladeObjectArray();
			}
			if (!SawAudio.isPlaying)
			{
				SawAudio.Play();
			}
			triggerAmount += Random.Range(-0.05f, 0.05f);
			if (((FVRInteractiveObject)this).IsHeld)
			{
				m_sawingIntesity = Mathf.Lerp(m_sawingIntesity, triggerAmount, Time.deltaTime * 5f);
			}
			else
			{
				m_sawingIntesity = Mathf.Lerp(m_sawingIntesity, 0f, Time.deltaTime * 2f);
			}
			if (m_sawingIntesity > 0.1f)
			{
				SawAudio.volume = (0.8f + m_sawingIntesity * 0.5f) * 0.3f;
				SawAudio.pitch = 0.6f + m_sawingIntesity * 0.7f;
				if ((double)timeSinceCollision < 0.2)
				{
					if ((Object)(object)SawAudio.clip != (Object)(object)AudClip_Hitting)
					{
						SawAudio.clip = AudClip_Hitting;
					}
				}
				else if ((Object)(object)SawAudio.clip != (Object)(object)AudClip_Buzzing)
				{
					SawAudio.clip = AudClip_Buzzing;
				}
				if (UsesBladeSolidBits)
				{
					m_matBladeSolid.SetVector("_MainTexVelocity", Vector4.op_Implicit(new Vector2(m_sawingIntesity, 0f)));
					m_matBladeBits.SetVector("_MainTexVelocity", Vector4.op_Implicit(new Vector2(m_sawingIntesity, 0f)));
				}
				if (CycleBladeObjects)
				{
					bladeObjectCycleTime /= 3f;
				}
			}
			else
			{
				SawAudio.volume = 0.25f;
				SawAudio.pitch = 1f;
				if ((Object)(object)SawAudio.clip != (Object)(object)AudClip_Idle)
				{
					SawAudio.clip = AudClip_Idle;
				}
				if (UsesBladeSolidBits)
				{
					m_matBladeSolid.SetVector("_MainTexVelocity", Vector4.op_Implicit(new Vector2(0.01f, 0f)));
					m_matBladeBits.SetVector("_MainTexVelocity", Vector4.op_Implicit(new Vector2(0.01f, 0f)));
				}
				if (CycleBladeObjects)
				{
					bladeObjectCycleTime *= 3f;
				}
			}
			EmissionModule emission2 = EngineSmoke.emission;
			MinMaxCurve rate2 = ((EmissionModule)(ref emission2)).rate;
			((MinMaxCurve)(ref rate2)).mode = (ParticleSystemCurveMode)0;
			((MinMaxCurve)(ref rate2)).constantMax = m_motorSpeed * 2f + m_sawingIntesity * 20f;
			((MinMaxCurve)(ref rate2)).constantMin = m_motorSpeed * 2f + m_sawingIntesity * 20f;
			((EmissionModule)(ref emission2)).rate = rate2;
		}
		if (m_motorSpeed >= 1f)
		{
			m_isRunning = true;
		}
		else
		{
			m_motorSpeed -= Time.deltaTime * 3f;
			m_motorSpeed = Mathf.Clamp(m_motorSpeed, 0f, 1f);
		}
		if (UsesEngineRot)
		{
			float x = EngineRot.localEulerAngles.x;
			x = ((m_sawingIntesity > 0f) ? (x + Time.deltaTime * (360f + m_sawingIntesity * 1200f)) : (x + Time.deltaTime * (360f * m_motorSpeed)));
			x = Mathf.Repeat(x, 360f);
			EngineRot.localEulerAngles = new Vector3(x, 0f, 0f);
		}
		if (m_isRunning)
		{
			m_timeTilPerceptibleEventTick -= Time.deltaTime;
			if (m_timeTilPerceptibleEventTick <= 0f)
			{
				m_timeTilPerceptibleEventTick = Random.Range(0.2f, 0.3f);
			}
		}
	}

	public override void FVRFixedUpdate()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		((FVRPhysicalObject)this).FVRFixedUpdate();
		if (m_isRunning)
		{
			float num = 0.1f;
			num += m_sawingIntesity * 0.3f;
			Rigidbody rootRigidbody = ((FVRPhysicalObject)this).RootRigidbody;
			rootRigidbody.velocity += Random.onUnitSphere * num;
			Rigidbody rootRigidbody2 = ((FVRPhysicalObject)this).RootRigidbody;
			rootRigidbody2.angularVelocity += Random.onUnitSphere * num;
		}
	}

	public void SetCableLength(float f)
	{
		Debug.Log((object)"SetCableLength called");
		if (!m_isRunning && f > m_currentCableLength)
		{
			if (!StartingAudio.isPlaying)
			{
				StartingAudio.Play();
			}
			m_motorSpeed += (f - m_currentCableLength) * 1.5f;
		}
		m_currentCableLength = f;
	}

	public void CycleBladeObjectArray()
	{
		bladeObjectCycleTime = 0f;
		if ((Object)(object)BladeObjects[bladeIndex] != (Object)null)
		{
			BladeObjects[bladeIndex].SetActive(false);
		}
		bladeIndex++;
		if (bladeIndex >= BladeObjects.Length)
		{
			bladeIndex = 0;
		}
		if ((Object)(object)BladeObjects[bladeIndex] != (Object)null)
		{
			BladeObjects[bladeIndex].SetActive(true);
		}
	}
}

M99AMR.dll

Decompiled 3 weeks ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Volks.M99AMR;

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volks.M99AMR");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.M99AMR", "", "", "modmas2024_item67", "");
	}
}

BSAWelgunSMG.dll

Decompiled 3 weeks ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

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

	public GameObject objectToToggle;

	private Vector3 originalPosition;

	private void Start()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		originalPosition = targetObject.position;
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		if (targetObject.position != originalPosition)
		{
			if (objectToToggle.activeSelf)
			{
				objectToToggle.SetActive(false);
			}
		}
		else if (!objectToToggle.activeSelf)
		{
			objectToToggle.SetActive(true);
		}
	}
}
namespace Volks.BSAWelgunSMG;

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

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volks.BSAWelgunSMG");
		OtherLoader.RegisterDirectLoad(BasePath, "Volks.BSAWelgunSMG", "", "", "modmas2024_item57", "");
	}
}

LICC_LWS.dll

Decompiled 3 weeks ago
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using OtherLoader;
using Sodalite.Api;

[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 FraDirahra.LICC_LWS;

[BepInPlugin("FraDirahra.LICC_LWS", "LICC_LWS", "1.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
[BepInDependency("h3vr.cityrobo.ModularWorkshopManager", "1.0.0")]
[BepInDependency("nrgill28.Sodalite", "1.4.1")]
public class LICC_LWSPlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	internal static ManualLogSource Logger;

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

	private void LoadAssets()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "FraDirahra.LICC_LWS");
		OtherLoader.RegisterDirectLoad(BasePath, "FraDirahra.LICC_LWS", "", "", "264round", "");
		OtherLoader.RegisterDirectLoad(BasePath, "FraDirahra.LICC_LWS", "", "", "licc", "");
		GameAPI.PreloadAllAssets(Path.Combine(BasePath, "mw_licc_lws"));
	}
}