using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using H3VRUtils.Vehicles; using HarmonyLib; using OpenScripts2; using OtherLoader; using UnityEditor; using UnityEngine; using UnityEngine.UI; using UnityEngine.Windows.Speech; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace JerryComponent { public class DshapeGrip : MonoBehaviour { public ClosedBoltWeapon gun; public GameObject trigL; public GameObject trigR; public GameObject magrel; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (trigL.transform.localEulerAngles.x > 45f || trigR.transform.localEulerAngles.x > 45f) { gun.Fire(); } if (magrel.transform.localEulerAngles.x > 45f && (Object)(object)((FVRFireArm)gun).Magazine != (Object)null) { ((FVRFireArm)gun).EjectMag(false); } } } public class MGMount2 : MonoBehaviour { public GameObject mgSpace; public GameObject mgX; public GameObject mgY; public GameObject mgObj; private float mgMoveX; private float mgMoveY; public ClosedBoltWeapon gun; public GameObject proxyrounds; private void OnTriggerStay(Collider other) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) if (gun.Chamber.IsFull) { mgObj.transform.position = ((Component)other).gameObject.transform.position; mgMoveX = mgObj.transform.localPosition.x; mgMoveY = mgObj.transform.localPosition.y; if (mgMoveX > 1f) { mgMoveX = 1f; } if (mgMoveX < 0f) { mgMoveX = 0f; } if (mgMoveY > 1f) { mgMoveY = 1f; } if (mgMoveY < 0f) { mgMoveY = 0f; } mgX.transform.localEulerAngles = new Vector3(0f, (1f - mgMoveX) * 40f, 0f); mgY.transform.localEulerAngles = new Vector3(mgMoveY * 40f, 0f, 0f); } } private void Update() { //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRFireArm)gun).Magazine != (Object)null) { if (!gun.Chamber.IsFull && ((FVRFireArm)gun).Magazine.m_numRounds <= 0) { mgMoveX = 0.5f; mgX.transform.localEulerAngles = new Vector3(0f, 20f, 0f); mgMoveY = 0f; mgY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); proxyrounds.SetActive(false); ((FVRFireArm)gun).ConnectedToBox = false; ((FVRFireArm)gun).HasBelt = false; if (((FVRFireArm)gun).BeltDD.m_roundsOnBelt > 0) { ((FVRFireArm)gun).BeltDD.RemoveRound(true); } } if (((FVRFireArm)gun).Magazine.m_numRounds > 0) { proxyrounds.SetActive(true); } } if ((Object)(object)((FVRFireArm)gun).Magazine == (Object)null) { mgMoveX = 0.5f; mgX.transform.localEulerAngles = new Vector3(0f, 20f, 0f); mgMoveY = 0f; mgY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); proxyrounds.SetActive(false); } } } public class turretrotation : MonoBehaviour { public float lowlimit = 2f; public float highlimit = 47f; public GameObject turretX; public GameObject turretY; public GameObject trigger; public ClosedBoltWeapon gun; public float rotX = 180f; public float rotY = 10f; public GameObject followhands; private void OnTriggerStay(Collider other) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) followhands.transform.position = ((Component)other).gameObject.transform.position; } private void OnTriggerExit(Collider other) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) followhands.transform.localPosition = new Vector3(0f, 0f, 0f); } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) if (trigger.transform.localEulerAngles.x > 2f && trigger.transform.localEulerAngles.x < 88f) { gun.Fire(); } if (followhands.transform.localPosition.x >= 0.05f || followhands.transform.localPosition.x <= -0.05f) { rotX += followhands.transform.localPosition.x * 0.75f; turretX.transform.localEulerAngles = new Vector3(0f, rotX, 0f); } if (followhands.transform.localPosition.y >= 0.05f || followhands.transform.localPosition.y <= -0.05f) { rotY += followhands.transform.localPosition.y * 0.25f; turretY.transform.localEulerAngles = new Vector3(0f, 0f, rotY); if (rotY < lowlimit) { rotY = lowlimit; } if (rotY > highlimit) { rotY = highlimit; } } } } public class turretrotation1 : MonoBehaviour { public GameObject seatrot; public GameObject hatch; public float lowlimit = 2f; public float highlimit = 52f; public GameObject turretX; public GameObject turretY; public GameObject trigger; public OpenBoltReceiver gun; public float rotX = 180f; public float rotY = 10f; public GameObject followhands; public string handb; public string handid; public string X; public string Y; public float hx = 0f; public float hy = 0f; public float hz = 0f; public float refx = 0f; public float refy = 0f; public float xrot = 0f; public float yrot = 0f; public SpringJoint SJ; public Rigidbody rigcomt; public Transform rigcomtlock; private void Start() { } private void Update() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) rigcomt.isKinematic = false; rigcomt.useGravity = false; ((Component)rigcomt).gameObject.transform.localEulerAngles = ((Component)rigcomtlock).transform.localEulerAngles; ((Component)rigcomt).gameObject.transform.localPosition = ((Component)rigcomtlock).transform.localPosition; turretX = GameObject.Find(X); turretY = GameObject.Find(Y); if ((Object)(object)GameObject.Find(handid) != (Object)null) { followhands = GameObject.Find(handid); followhands.transform.SetParent(GameObject.Find(handb).transform); if ((Object)(object)SJ == (Object)null) { followhands.transform.localPosition = new Vector3(0f, 0.027f, 0f); SJ = followhands.AddComponent(); ((Joint)SJ).connectedBody = rigcomt; SJ.spring = 2500f; SJ.damper = 10f; SJ.tolerance = 0f; SJ.maxDistance = 0f; SJ.minDistance = 0f; } hx = followhands.transform.localPosition.x; hz = 0f; if (hx > 0.1f) { hx = 0.1f; } else if (hx < -0.1f) { hx = -0.1f; } if (hatch.transform.localEulerAngles.x > 45f && seatrot.transform.localEulerAngles.x > 45f) { if (hy > 0.052f) { hy = 0.052f; } else if (hy < 0.002f) { hy = 0.002f; } hy = followhands.transform.localPosition.y; } else if (hatch.transform.localEulerAngles.x < 45f || seatrot.transform.localEulerAngles.x < 45f) { hy = 0.027f; } followhands.transform.localPosition = new Vector3(hx, hy, hz); } if (trigger.transform.localEulerAngles.x > 2f && trigger.transform.localEulerAngles.x < 88f) { gun.ReleaseSeer(); } else if (trigger.transform.localEulerAngles.x < 2f || trigger.transform.localEulerAngles.x > 88f) { gun.EngageSeer(); } if (seatrot.transform.localEulerAngles.x < 45f && hatch.transform.localEulerAngles.x > 45f) { turretX.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(turretX.transform.localEulerAngles.y, 0f, ref refx, 1f), 0f); } else if (seatrot.transform.localEulerAngles.x > 45f || hatch.transform.localEulerAngles.x < 45f) { turretX.transform.localEulerAngles = new Vector3(0f, turretX.transform.localEulerAngles.y + 1500f * followhands.transform.localPosition.x * Time.deltaTime, 0f); } yrot = Mathf.SmoothDamp(yrot, followhands.transform.localPosition.y * 1000f, ref refy, 2f); turretY.transform.localEulerAngles = new Vector3(0f, 0f, yrot); if (turretY.transform.localEulerAngles.z > highlimit) { turretY.transform.localEulerAngles = new Vector3(0f, 0f, highlimit); } else if (turretY.transform.localEulerAngles.z < lowlimit) { turretY.transform.localEulerAngles = new Vector3(0f, 0f, lowlimit); } } } public class ButtonIgnition : FVRInteractiveObject { public VehicleControl vehicle; public VehicleAudioSet audioSet; public float ignitionTime; private float m_it; public float failChance; public Random rand; public void Start() { rand = new Random(); } public override void BeginInteraction(FVRViveHand hand) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) m_it = ignitionTime; if (vehicle.isOn) { SM.PlayGenericSound(audioSet.VehicleStop, ((Component)this).transform.position); m_it = 999999f; vehicle.TurnOffEngine(forcibly: false); } } public override void UpdateInteraction(FVRViveHand hand) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); m_it -= Time.fixedDeltaTime; if (m_it <= 0f) { vehicle.TurnOnEngine(forcibly: false); SM.PlayGenericSound(audioSet.VehicleStart, ((Component)this).transform.position); m_it = 999999f; } } } internal class CarFollow : MonoBehaviour { public VehicleControl _carControl; public Transform _setPos; private FVRMovementManager _playerMovement; private void Awake() { _playerMovement = Object.FindObjectOfType(); } private void Update() { if (_carControl.isOn) { PlayerForwardFollowSet(); } } private void PlayerForwardFollowSet() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) ((Component)_playerMovement).transform.rotation = Quaternion.RotateTowards(((Component)_playerMovement).transform.rotation, ((Component)_setPos).transform.rotation, 5f); } } public class AddScope : MonoBehaviour { public Camera cam; public Shader shad; public MeshRenderer mr1; public int reticlesize = 1024; public float _VR = 0f; public float _VS = 0.25f; public float _ER = 1f; public float _RS = 4.12f; public float _ROX = 0f; public float _ROY = 0f; private void Start() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown RenderTexture val = new RenderTexture(reticlesize, reticlesize, 16, (RenderTextureFormat)0); val.Create(); cam.targetTexture = val; Material val2 = new Material(shad); val2.SetTexture("_MainTex", (Texture)(object)val); val2.SetFloat("_VignetteRadius", _VR); val2.SetFloat("_VignetteSmoothness", _VS); val2.SetFloat("_EyeRelief", _ER); val2.SetTexture("_ReticleTex", (Texture)(object)val); val2.SetFloat("_ReticleScale", _RS); val2.SetFloat("_ReticleOffsetX", _ROX); val2.SetFloat("_ReticleOffsetY", _ROY); ((Renderer)mr1).material = val2; } private void Update() { } } [Serializable] public class DriveShiftNode { public Vector3 localposition; public Vector3 rotation; public int left = -1; public int up = -1; public int right = -1; public int down = -1; public int gear = 0; } public class DriveShift : FVRInteractiveObject { public VehicleControl vehicle; public Text gearText; public int currentNode; public List driveShiftNodes; public VehicleAudioSet audioSet; public void Update() { if (vehicle.carSetting.automaticGear) { if (vehicle.currentGear > 0 && vehicle.speed > 1f) { gearText.text = vehicle.currentGear.ToString(); } else if (vehicle.speed > 1f) { gearText.text = "R"; } else { gearText.text = "N"; } } else if (vehicle.NeutralGear) { gearText.text = "N"; } else if (vehicle.currentGear != 0) { gearText.text = vehicle.currentGear.ToString(); } else { gearText.text = "R"; } } private void Start() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) vehicle.ShiftTo(driveShiftNodes[currentNode].gear); ((Component)this).transform.localPosition = driveShiftNodes[currentNode].localposition; ((Component)this).transform.localEulerAngles = driveShiftNodes[currentNode].rotation; } public override void UpdateInteraction(FVRViveHand hand) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) bool flag = false; if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].left != -1) { flag = true; currentNode = driveShiftNodes[currentNode].left; } if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].up != -1) { flag = true; currentNode = driveShiftNodes[currentNode].up; } if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].right != -1) { flag = true; currentNode = driveShiftNodes[currentNode].right; } if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].down != -1) { flag = true; currentNode = driveShiftNodes[currentNode].down; } if (flag) { vehicle.ShiftTo(driveShiftNodes[currentNode].gear); ((Component)this).transform.localPosition = driveShiftNodes[currentNode].localposition; ((Component)this).transform.localEulerAngles = driveShiftNodes[currentNode].rotation; } } } public class IfInWater : MonoBehaviour { public GameObject floatScr; public FVRPhysicalObject obj; private void Start() { } private void Update() { if (obj.IsInWater) { floatScr.SetActive(true); } else if (!obj.IsInWater) { floatScr.SetActive(false); } } } public class IsFloating : MonoBehaviour { public FVRPhysicalObject floatObj; public Rigidbody floatObjRB; public Transform floatDir; public float ForceF; private void Start() { } private void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (floatObj.IsInWater) { floatObjRB.AddForce(floatDir.forward * Time.deltaTime * ForceF, (ForceMode)0); } else if (floatObj.IsInWater) { } } } public class ParkingBrakeClick : FVRInteractiveObject { public VehicleControl vehicle; public Vector3 positionOff; public Vector3 positionOn; public Vector3 rotationOff; public Vector3 rotationOn; public bool isOn; public VehicleAudioSet audioSet; public override void SimpleInteraction(FVRViveHand hand) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); isOn = !isOn; if (isOn) { SM.PlayGenericSound(audioSet.HandbrakeUp, ((Component)this).transform.position); ((Component)this).transform.localPosition = positionOn; ((Component)this).transform.localEulerAngles = rotationOn; vehicle.brake = true; } else { SM.PlayGenericSound(audioSet.HandbrakeDown, ((Component)this).transform.position); ((Component)this).transform.localPosition = positionOff; ((Component)this).transform.localEulerAngles = rotationOff; vehicle.brake = false; } } } public class Propeller : MonoBehaviour { public VehicleControl Vehicle; public Rigidbody Prop; public Rigidbody Prop2; public Transform ForceDir; public Transform ForceDir2; public bool propon; public bool isRev; public float ForceP = 400000f; public GameObject PropRot; private void Start() { } public void PropellerON() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (isRev) { Prop.AddForce(ForceDir.forward * Time.deltaTime * ForceP, (ForceMode)0); Prop2.AddForce(ForceDir2.forward * Time.deltaTime * ForceP, (ForceMode)0); } else if (!isRev) { Prop.AddForce(ForceDir.forward * Time.deltaTime * (0f - ForceP), (ForceMode)0); Prop2.AddForce(ForceDir2.forward * Time.deltaTime * (0f - ForceP), (ForceMode)0); } } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (PropRot.transform.localEulerAngles.x >= 45f) { PropellerON(); } else if (!(PropRot.transform.localEulerAngles.x < 45f)) { } if (Vehicle.currentGear == 0) { isRev = true; } else if (Vehicle.currentGear == 1) { isRev = false; } } } internal class SteeringWheel : FVRInteractiveObject { public VehicleControl vehicle; public float resetLerpSpeed; public float maxRot; public bool reverseRot; [Header("Debug Values")] public Text rotText; public float rot; public float rh; public float lr; public float inlerp; public float lerp; public float rotAmt; public VehicleAudioSet audioSet; public override void BeginInteraction(FVRViveHand hand) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_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_0060: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); Transform child = ((Component)this).transform.GetChild(0); child.parent = null; Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles; ((Component)this).transform.LookAt(((Component)hand).transform); ((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, localEulerAngles.z); child.parent = ((Component)this).transform; } public override void EndInteraction(FVRViveHand hand) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).EndInteraction(hand); Transform child = ((Component)this).transform.GetChild(0); child.parent = null; ((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, 0f, ((Component)this).transform.localEulerAngles.z); child.parent = ((Component)this).transform; } public override void UpdateInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00c1: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles; ((Component)this).transform.LookAt(((Component)hand).transform); Vector3 localEulerAngles2 = ((Component)this).transform.localEulerAngles; rot = Mathf.DeltaAngle((float)Math.Round(localEulerAngles2.y), (float)Math.Round(localEulerAngles.y)); rotAmt += rot; if (rotAmt >= maxRot) { rotAmt = maxRot; ((Component)this).transform.localEulerAngles = localEulerAngles; } else if (rotAmt <= 0f - maxRot) { rotAmt = 0f - maxRot; ((Component)this).transform.localEulerAngles = localEulerAngles; } else { ((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles2.y, localEulerAngles.z); } rh = localEulerAngles2.y; lr = localEulerAngles.y; SetRot(); bool flag = false; if (hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f) { flag = true; } if (flag) { vehicle.accel = 0f - (float)Math.Pow(((Vector2)(ref hand.Input.TouchpadAxes)).magnitude, 2.0); vehicle.brake = true; } else { vehicle.accel = (float)Math.Pow(hand.Input.TriggerFloat, 2.0); vehicle.brake = false; } } private void FixedUpdate() { //IL_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() { bool flag = rotAmt <= 0f; lerp = Mathf.Abs(rotAmt) / maxRot; lerp *= -1f; if (flag) { lerp *= -1f; } if (reverseRot) { lerp = 0f - lerp; } if ((Object)(object)rotText != (Object)null) { rotText.text = lerp.ToString(); } vehicle.steer = lerp; } } public class VehicleControl : MonoBehaviour { public enum ControlMode { simple = 1, touch } [Serializable] public class CarWheels { public ConnectWheel wheels; } [Serializable] public class ConnectWheel { public bool frontWheelDrive = true; public Transform frontRight; public Transform frontLeft; public Transform frontRight2; public Transform frontLeft2; public WheelSetting frontSetting; public bool backWheelDrive = true; public Transform backRight; public Transform backLeft; public Transform backRight2; public Transform backLeft2; 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[8]; } [Serializable] public class CarSetting { public bool showNormalGizmos = false; public Transform carSteer; public HitGround[] hitGround; public List 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[8]; private Vector3 steerCurAngle; private Rigidbody myRigidbody; private WheelComponent[] wheels; public bool isOn = true; public bool isForciblyOff = false; public Rigidbody GetRigidbody() { return myRigidbody; } private WheelComponent SetWheelComponent(Transform wheel, float maxSteer, bool drive, float pos_y, WheelSetting setting) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) WheelComponent wheelComponent = new WheelComponent(); GameObject val = new GameObject(((Object)wheel).name + "WheelCollider"); val.transform.parent = ((Component)this).transform; val.transform.position = wheel.position; val.transform.eulerAngles = ((Component)this).transform.eulerAngles; pos_y = val.transform.localPosition.y; WheelCollider val2 = (WheelCollider)val.AddComponent(typeof(WheelCollider)); wheelComponent.wheel = wheel; wheelComponent.collider = val.GetComponent(); 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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_02d1: 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_0332: 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_0377: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) if (carSetting.automaticGear) { NeutralGear = false; } myRigidbody = ((Component)((Component)this).transform).GetComponent(); wheels = new WheelComponent[8]; 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[4] = SetWheelComponent(carWheels.wheels.frontRight2, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontRight2.position.y, carWheels.wheels.frontSetting); wheels[5] = SetWheelComponent(carWheels.wheels.frontLeft2, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontLeft2.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); wheels[6] = SetWheelComponent(carWheels.wheels.backRight2, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backRight2.position.y, carWheels.wheels.rearSetting); wheels[7] = SetWheelComponent(carWheels.wheels.backLeft2, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backLeft2.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().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().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().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 component = ((Component)collision.transform.root).GetComponent(); 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())) { ((Component)collision.transform.root).GetComponent().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_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_077d: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_0aed: Unknown result type (might be due to invalid IL or missing references) //IL_0afe: Unknown result type (might be due to invalid IL or missing references) //IL_0b03: Unknown result type (might be due to invalid IL or missing references) //IL_1006: Unknown result type (might be due to invalid IL or missing references) //IL_1010: Unknown result type (might be due to invalid IL or missing references) //IL_0f22: Unknown result type (might be due to invalid IL or missing references) //IL_0f29: Unknown result type (might be due to invalid IL or missing references) //IL_0f2e: Unknown result type (might be due to invalid IL or missing references) //IL_0f48: Unknown result type (might be due to invalid IL or missing references) //IL_0f53: Unknown result type (might be due to invalid IL or missing references) //IL_0f58: Unknown result type (might be due to invalid IL or missing references) //IL_0f61: Unknown result type (might be due to invalid IL or missing references) //IL_1028: Unknown result type (might be due to invalid IL or missing references) //IL_0b59: Unknown result type (might be due to invalid IL or missing references) //IL_0b5e: Unknown result type (might be due to invalid IL or missing references) //IL_0d41: 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 * -510f); } if (carSetting.automaticGear && currentGear == 1 && accel < 0f) { if (speed < 5f) { ShiftDown(ignoreDelay: false); } } else if (carSetting.automaticGear && currentGear == 0 && accel > 0f) { if (speed < 5f) { ShiftUp(ignoreDelay: false); } } else if (carSetting.automaticGear && motorRPM > carSetting.shiftUpRPM && accel > 0f && speed > 10f && !brake) { ShiftUp(ignoreDelay: false); } else if (carSetting.automaticGear && motorRPM < carSetting.shiftDownRPM && currentGear > 1) { ShiftDown(ignoreDelay: false); } if (speed < 1f) { Backward = true; } if (currentGear != 0 || !Backward) { Backward = false; } Light[] brakeLights = carLights.brakeLights; foreach (Light val in brakeLights) { if (brake || accel < 0f || speed < 1f) { val.intensity = Mathf.MoveTowards(val.intensity, 8f, 0.5f); } else { val.intensity = Mathf.MoveTowards(val.intensity, 0f, 0.5f); } ((Behaviour)val).enabled = val.intensity != 0f; } Light[] reverseLights = carLights.reverseLights; foreach (Light val2 in reverseLights) { if (speed > 2f && currentGear == 0) { val2.intensity = Mathf.MoveTowards(val2.intensity, 8f, 0.5f); } else { val2.intensity = Mathf.MoveTowards(val2.intensity, 0f, 0.5f); } ((Behaviour)val2).enabled = val2.intensity != 0f; } wantedRPM = 5500f * accel * 0.1f + wantedRPM * 0.9f; float num = 0f; int num2 = 0; bool flag = false; int num3 = 0; WheelComponent[] array = wheels; WheelHit val4 = default(WheelHit); foreach (WheelComponent wheelComponent in array) { WheelCollider collider = wheelComponent.collider; if (wheelComponent.drive) { num = ((!NeutralGear && brake && currentGear < 2) ? (num + accel * carSetting.idleRPM) : (NeutralGear ? (num + carSetting.idleRPM * accel) : (num + collider.rpm))); num2++; } if (brake || accel < 0f) { if (accel < 0f || (brake && (wheelComponent == wheels[2] || wheelComponent == wheels[3] || wheelComponent == wheels[6] || wheelComponent == wheels[7]))) { 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().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(carParticles.brakeParticlePerfab, wheelComponent.wheel.position, Quaternion.identity); ((Object)Particle[num3]).name = "WheelParticle"; Particle[num3].transform.parent = ((Component)this).transform; Particle[num3].AddComponent(); Particle[num3].GetComponent().maxDistance = 50f; Particle[num3].GetComponent().spatialBlend = 1f; Particle[num3].GetComponent().dopplerLevel = 5f; Particle[num3].GetComponent().rolloffMode = (AudioRolloffMode)2; } ParticleSystem component = Particle[num3].GetComponent(); 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().clip = carSetting.hitGround[l].brakeSound; } else if ((Object)(object)Particle[num3].GetComponent().clip != (Object)(object)carSetting.hitGround[l].groundSound && !Particle[num3].GetComponent().isPlaying) { Particle[num3].GetComponent().clip = carSetting.hitGround[l].groundSound; } Particle[num3].GetComponent().startColor = carSetting.hitGround[l].brakeColor; } } if (flag2 && speed > 5f && !brake) { component.enableEmission = true; Particle[num3].GetComponent().volume = 0.5f; if (!Particle[num3].GetComponent().isPlaying) { Particle[num3].GetComponent().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] || wheelComponent == wheels[6] || wheelComponent == wheels[7]))) { if (!Particle[num3].GetComponent().isPlaying) { Particle[num3].GetComponent().Play(); } component.enableEmission = true; Particle[num3].GetComponent().volume = 10f; } } else { component.enableEmission = false; Particle[num3].GetComponent().volume = Mathf.Lerp(Particle[num3].GetComponent().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(); 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), carSounds.minPitch, carSounds.maxPitch); shiftTime = Mathf.MoveTowards(shiftTime, 0f, 0.1f); if (Pitch == 1f) { carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1f, 0.1f); carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f); carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.1f); } else { carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1.8f - Pitch, 0.1f); if ((Pitch > PitchDelay || accel > 0f) && shiftTime == 0f) { carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0f, 0.2f); carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 1f, 0.1f); } else { carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f); carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.2f); } carSounds.HighEngine.pitch = Pitch; carSounds.LowEngine.pitch = Pitch; PitchDelay = Pitch; } if (!isOn) { carSounds.IdleEngine.volume = 0f; carSounds.LowEngine.volume = 0f; carSounds.HighEngine.volume = 0f; } } private void OnDrawGizmos() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (carSetting.showNormalGizmos && !Application.isPlaying) { Matrix4x4 matrix = Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.lossyScale); Gizmos.matrix = matrix; Gizmos.color = new Color(1f, 0f, 0f, 0.5f); Gizmos.DrawCube(Vector3.up / 1.5f, new Vector3(2.5f, 2f, 6f)); Gizmos.DrawSphere(carSetting.shiftCentre / ((Component)this).transform.lossyScale.x, 0.2f); } } } public class enginestartsound : MonoBehaviour { public GameObject button; public GameObject sound; public VehicleControl vehicle; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (button.transform.localEulerAngles.x >= 45f && !vehicle.isOn) { sound.SetActive(true); } else if (button.transform.localEulerAngles.x < 45f || vehicle.isOn) { sound.SetActive(false); } } } public class gunpodtrigger : MonoBehaviour { public FVRInteractiveObject obj; public GameObject trigger; private void Start() { } private void Update() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)obj.m_hand != (Object)null) { if (obj.m_hand.Input.TriggerPressed) { trigger.transform.localEulerAngles = new Vector3(90f, 0f, 0f); } else { trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } else { trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } } public class Bikehandle : MonoBehaviour { public GameObject fakebikeh; public GameObject realbikeh; public ConstantForce forceR; public ConstantForce forceF; public float forcesize; private void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) fakebikeh.transform.localEulerAngles = new Vector3(0f, realbikeh.transform.localEulerAngles.y, 0f); if (fakebikeh.transform.localEulerAngles.y >= 2.5f && fakebikeh.transform.localEulerAngles.y <= 35f) { forceF.relativeForce = new Vector3(forcesize, 0f, 0f); forceR.relativeForce = new Vector3(forcesize, 0f, 0f); } if (fakebikeh.transform.localEulerAngles.y <= 357.5f && fakebikeh.transform.localEulerAngles.y >= 325f) { forceF.relativeForce = new Vector3(0f - forcesize, 0f, 0f); forceR.relativeForce = new Vector3(0f - forcesize, 0f, 0f); } if (fakebikeh.transform.localEulerAngles.y < 2.5f || fakebikeh.transform.localEulerAngles.y > 357.5f) { forceF.relativeForce = new Vector3(0f, 0f, 0f); forceR.relativeForce = new Vector3(0f, 0f, 0f); } } } public class moveGC : MonoBehaviour { public VehicleControl vc; public GameObject trackinghead; private float move; private void Update() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) if (vc.isOn) { if (trackinghead.transform.localPosition.x > 0.15f) { move = trackinghead.transform.localPosition.x; vc.carSetting.shiftCentre = new Vector3(move, 0.25f, 0.3f); if (move > 0.2f) { move = 0.2f; } } if (trackinghead.transform.localPosition.x < -0.15f) { move = trackinghead.transform.localPosition.x; vc.carSetting.shiftCentre = new Vector3(move, 0.25f, 0.3f); if (move < -0.2f) { move = -0.2f; } } } if (!vc.isOn || (trackinghead.transform.localPosition.x > -0.15f && trackinghead.transform.localPosition.x < 0.15f)) { vc.carSetting.shiftCentre = new Vector3(0f, 0.25f, 0.3f); } } } public class speedlimit : MonoBehaviour { public HingeJoint joint; public float limit; public VehicleControl vehicle; public GameObject needle; public bool isImperial; public float maxSpeed; public Vector3 needleNoSpeed; public Vector3 needleMaxSpeed; public void Update() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs(vehicle.speed); if (isImperial) { num *= 0.6213712f; } float num2 = Mathf.InverseLerp(0f, maxSpeed, num); needle.transform.localEulerAngles = Vector3.Lerp(needleNoSpeed, needleMaxSpeed, num2); JointLimits limits = joint.limits; ((JointLimits)(ref limits)).min = needle.transform.localEulerAngles.x - limit; ((JointLimits)(ref limits)).max = limit - needle.transform.localEulerAngles.x; joint.limits = limits; } } public class FireRope : MonoBehaviour { public ClosedBoltWeapon gun; public GameObject trigger; public FVRFireArmChamber chamber; public GameObject MuzzleFlash; public Transform muzzle; public bool fired = false; 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_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (trigger.transform.localPosition.z >= 0.1f) { if (chamber.IsFull && !chamber.IsSpent) { gun.Fire(); if (!fired) { Object.Instantiate(MuzzleFlash, ((Component)muzzle).transform.position, ((Component)muzzle).transform.rotation); fired = true; } } } else if (trigger.transform.localPosition.z < 0.1f) { fired = false; } } } public class HMDScope : MonoBehaviour { public FVRFireArmAttachment main; public GameObject HMDpiece; public GameObject HMD; public GameObject Screen; public GameObject Cam; private void Start() { } private void FixedUpdate() { //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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)main.curMount != (Object)null) { HMDpiece.SetActive(true); } else if ((Object)(object)main.curMount == (Object)null) { HMDpiece.SetActive(false); } if (HMD.transform.localEulerAngles.z > 45f) { Screen.SetActive(true); Cam.SetActive(true); } else if (HMD.transform.localEulerAngles.z < 45f) { Screen.SetActive(false); Cam.SetActive(false); } } } public class LookWithMuzzle : MonoBehaviour { public GameObject camerarot; public FVRFireArmAttachment att; private void FixedUpdate() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)att.curMount == (Object)null) { camerarot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } else if ((Object)(object)att.curMount != (Object)null) { if ((Object)(object)((Component)att.curMount.MyObject).gameObject.GetComponent() != (Object)null) { camerarot.transform.eulerAngles = ((Component)((Component)att.curMount.MyObject).gameObject.GetComponent().MuzzlePos).transform.eulerAngles; } else if ((Object)(object)((Component)att.curMount.MyObject).gameObject.GetComponent() == (Object)null) { camerarot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } } } public class SlideScope : MonoBehaviour { public GameObject SlideRot; public Camera Cam1; private RenderTexture rt1; private Material mt1; public MeshRenderer mr1; public Shader sd; private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Cam1.fieldOfView = SlideRot.transform.localEulerAngles.x; } } } namespace MeatyScripts { public class NGSW_FC : FVRInteractiveObject { [Header("NGSW FireControl Config")] public PIPScopeController PIPScopeController; public Transform PostZeroReticleParent; public Transform RaycastOrigin; public LayerMask RangeFinderHitLayers; public GameObject OneEcksReticle; public float OneEcksReticleBaseScale = 1f; public GameObject PreZeroReticle; public float PreZeroReticleBaseScale = 1f; public GameObject PostZeroReticle; public float PostZeroReticleBaseScale = 1f; public Text HeadingText; private float _currentHeading; public float RangeFinderRange = 5000f; public Text ZeroRangeText; public int BulletDropCalculationSingleFrameLimit = 0; public float AsynchAbortEpsilon = 0.1f; public int MaxAsynchIterationsPerFrame = 100; public float ArtificialCalculationDelay = 0.1f; public float IncompleteZeroBlinkInterval = 0.25f; [Header("Zoom Ring")] public float OneEcksThreshold = 0.1f; private bool _isOneEcks = false; private bool _isZeroed = false; private FVRFireArm _fireArm; private RaycastHit _lastHit; private bool _stillCalculatingDrop; private float _consineAdjustedRange; private float _calculatedDrop; private bool _compassEnabled = true; private float _currentMagnification; public bool CompassEnabled => _compassEnabled; public override void Start() { ((FVRInteractiveObject)this).Start(); base.IsSimpleInteract = true; CheckMagnificationLevel(); UpdateReticles(); ResetZero(); } public void Update() { if (Application.isEditor) { UpdateHeading(); CheckMagnificationLevel(); UpdateReticles(); } } public override void FVRUpdate() { ((FVRInteractiveObject)this).FVRUpdate(); UpdateHeading(); CheckMagnificationLevel(); UpdateReticles(); } public void ToggleCompass() { _compassEnabled = !_compassEnabled; } private void FindCurrentFirearm() { if ((Object)(object)((FVRFireArmAttachmentInterface)PIPScopeController).Attachment != (Object)null && (Object)(object)((FVRFireArmAttachmentInterface)PIPScopeController).Attachment.curMount != (Object)null && (Object)(object)((FVRFireArmAttachmentInterface)PIPScopeController).Attachment.curMount.Parent != (Object)null && ((FVRFireArmAttachmentInterface)PIPScopeController).Attachment.curMount.Parent is FVRFireArm) { ref FVRFireArm fireArm = ref _fireArm; FVRPhysicalObject parent = ((FVRFireArmAttachmentInterface)PIPScopeController).Attachment.curMount.Parent; fireArm = (FVRFireArm)(object)((parent is FVRFireArm) ? parent : null); } else if ((Object)(object)PIPScopeController.OverrideFireArm != (Object)null) { _fireArm = PIPScopeController.OverrideFireArm; } else if ((Object)(object)PIPScopeController.OverrideFireArm == (Object)null && (Object)(object)((FVRFireArmAttachmentInterface)PIPScopeController).Attachment != (Object)null && (Object)(object)((FVRFireArmAttachmentInterface)PIPScopeController).Attachment.curMount == (Object)null) { _fireArm = null; } } private void CheckMagnificationLevel() { _currentMagnification = ((PIPScopeController.PScope.currentMagnification != 0f) ? PIPScopeController.PScope.currentMagnification : PIPScopeController.PScope.baseMagnification); if (!_isOneEcks && _currentMagnification < 1f + OneEcksThreshold) { _isOneEcks = true; ResetZero(); } else if (_isOneEcks && !Mathf.Approximately(_currentMagnification, 1f)) { _isOneEcks = false; ResetZero(); } } private void UpdateReticles() { //IL_00a5: 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_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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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) if (_isOneEcks) { OneEcksReticle.SetActive(true); PreZeroReticle.SetActive(false); PostZeroReticle.SetActive(false); } else if (!_stillCalculatingDrop) { OneEcksReticle.SetActive(false); if (_isZeroed) { PreZeroReticle.SetActive(false); PostZeroReticle.SetActive(true); } else { PreZeroReticle.SetActive(true); PostZeroReticle.SetActive(false); } } if (OneEcksReticle.activeSelf) { Vector3 val = Vector3.one * OneEcksReticleBaseScale * _currentMagnification; if (OneEcksReticle.transform.localScale != val) { OneEcksReticle.transform.localScale = val; } } else if (PreZeroReticle.activeSelf) { Vector3 val2 = Vector3.one * PreZeroReticleBaseScale * _currentMagnification; if (PreZeroReticle.transform.localScale != val2) { PreZeroReticle.transform.localScale = val2; } } else if (PostZeroReticle.activeSelf) { Vector3 val3 = Vector3.one * PostZeroReticleBaseScale * _currentMagnification; if (PostZeroReticle.transform.localScale != val3) { PostZeroReticle.transform.localScale = val3; } } } public override void SimpleInteraction(FVRViveHand hand) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); if (_isOneEcks) { return; } if (Physics.Raycast(RaycastOrigin.position, RaycastOrigin.forward, ref _lastHit, RangeFinderRange, LayerMask.op_Implicit(RangeFinderHitLayers))) { FindCurrentFirearm(); if ((Object)(object)_fireArm != (Object)null) { CalculateBulletDrop(); } if (_stillCalculatingDrop) { ResetZero(); ((MonoBehaviour)this).StopCoroutine("WaitForCalculation"); ((MonoBehaviour)this).StartCoroutine("WaitForCalculation"); } else { Zero(); } } else { ResetZero(); } } public void TriggerRangeFinderZeroing() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0072: Unknown result type (might be due to invalid IL or missing references) if (_isOneEcks) { return; } if (Physics.Raycast(RaycastOrigin.position, RaycastOrigin.forward, ref _lastHit, RangeFinderRange, LayerMask.op_Implicit(RangeFinderHitLayers))) { FindCurrentFirearm(); if ((Object)(object)_fireArm != (Object)null) { float num = 90f - Vector3.Angle(Vector3.up, _fireArm.GetMuzzle().forward); _consineAdjustedRange = ((RaycastHit)(ref _lastHit)).distance * Mathf.Cos(num * ((float)Math.PI / 180f)); CalculateBulletDrop(); } if (_stillCalculatingDrop) { ResetZero(); ((MonoBehaviour)this).StopCoroutine("WaitForCalculation"); ((MonoBehaviour)this).StartCoroutine("WaitForCalculation"); } else { Zero(); } } else { ResetZero(); } } private IEnumerator WaitForCalculation() { ((MonoBehaviour)this).StopCoroutine("DisplayBlinker"); ((MonoBehaviour)this).StartCoroutine("DisplayBlinker"); while (_stillCalculatingDrop) { yield return null; } Zero(); } private IEnumerator DisplayBlinker() { if ((Object)(object)ZeroRangeText != (Object)null) { ZeroRangeText.text = $"{Mathf.RoundToInt(((RaycastHit)(ref _lastHit)).distance)}m"; } while (_stillCalculatingDrop) { if ((Object)(object)ZeroRangeText != (Object)null) { ((Component)ZeroRangeText).gameObject.SetActive(false); } PreZeroReticle.SetActive(false); yield return (object)new WaitForSeconds(IncompleteZeroBlinkInterval); if ((Object)(object)ZeroRangeText != (Object)null) { ((Component)ZeroRangeText).gameObject.SetActive(true); } PreZeroReticle.SetActive(true); yield return (object)new WaitForSeconds(IncompleteZeroBlinkInterval); } } private void UpdateHeading() { //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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (_compassEnabled) { Vector3 forward = ((Component)this).transform.forward; forward.y = 0f; Vector3 forward2 = Vector3.forward; Vector3 up = Vector3.up; float currentHeading = AngleSigned(forward2, forward, up); _currentHeading = currentHeading; if (_currentHeading < 0f) { _currentHeading += 360f; } if ((Object)(object)HeadingText != (Object)null) { HeadingText.text = FormatHeadingText(); } } else if ((Object)(object)HeadingText != (Object)null) { HeadingText.text = string.Empty; } } private string FormatHeadingText() { string text = $"{Mathf.RoundToInt(_currentHeading)}°"; string empty = string.Empty; empty = ((_currentHeading < 22.5f || _currentHeading > 337.5f) ? "N " : ((_currentHeading >= 22.5f && _currentHeading < 67.5f) ? "NE " : ((_currentHeading >= 67.5f && _currentHeading < 112.5f) ? "E " : ((_currentHeading >= 112.5f && _currentHeading < 157.5f) ? "SE " : ((_currentHeading >= 157.5f && _currentHeading < 202.5f) ? "S " : ((_currentHeading >= 202.5f && _currentHeading < 247.5f) ? "SW " : ((!(_currentHeading >= 247.5f) || !(_currentHeading < 292.5f)) ? "NW " : "W "))))))); return empty + text; } private float AngleSigned(Vector3 v1, Vector3 v2, Vector3 n) { //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_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return Mathf.Atan2(Vector3.Dot(n, Vector3.Cross(v1, v2)), Vector3.Dot(v1, v2)) * 57.29578f; } public void Zero() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01b3: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: 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) float distance = ((RaycastHit)(ref _lastHit)).distance; if ((Object)(object)_fireArm == (Object)null) { if ((Object)(object)PIPScopeController.OverrideMuzzle != (Object)null) { Vector3 val = PIPScopeController.OverrideMuzzle.position + PIPScopeController.OverrideMuzzle.forward * distance; PostZeroReticleParent.LookAt(val, Vector3.up); _isZeroed = true; } else { PostZeroReticleParent.localRotation = Quaternion.identity; _isZeroed = false; } return; } Transform muzzle = _fireArm.GetMuzzle(); Vector3 val2 = ((RaycastHit)(ref _lastHit)).point - muzzle.position; float magnitude = ((Vector3)(ref val2)).magnitude; Vector3 val3 = Vector3.ProjectOnPlane(val2, Vector3.up); float magnitude2 = ((Vector3)(ref val3)).magnitude; if ((Object)(object)_fireArm != (Object)null) { float calculatedDrop = _calculatedDrop; if (calculatedDrop == float.MinValue) { PostZeroReticleParent.localPosition = Vector3.zero; if ((Object)(object)ZeroRangeText != (Object)null) { ZeroRangeText.text = "Out of range!"; } _isZeroed = false; return; } Vector3 val4 = Vector2.op_Implicit(_fireArm.GetCombinedFixedDrift(_fireArm.AccuracyClass) * 0.0166667f); float num = _fireArm.GetCombinedFixedDrop(_fireArm.AccuracyClass) * 0.0166667f; Quaternion val5 = muzzle.rotation * Quaternion.Euler(val4.y + num, val4.x, 0f); Vector3 val6 = val5 * Vector3.forward; Vector3 val7 = muzzle.position + val6 * magnitude + Vector3.up * calculatedDrop; Camera scopeCam = PIPScopeController.PScope.scopeCam; float num2 = scopeCam.fieldOfView / 2f; float num3 = (float)scopeCam.pixelHeight / 2f; Vector3 val8 = ((Component)scopeCam).transform.InverseTransformPoint(val7); float num4 = Mathf.Atan2(val8.x, val8.z) * 57.29578f; float num5 = Mathf.Atan2(val8.y, val8.z) * 57.29578f; float num6 = Mathf.Tan(num4 * ((float)Math.PI / 180f)) / Mathf.Tan(num2 * ((float)Math.PI / 180f)) * num3; float num7 = Mathf.Tan(num5 * ((float)Math.PI / 180f)) / Mathf.Tan(num2 * ((float)Math.PI / 180f)) * num3; PostZeroReticleParent.localPosition = new Vector3(num6, num7, 0f); } if ((Object)(object)ZeroRangeText != (Object)null) { ZeroRangeText.text = $"{Mathf.RoundToInt(distance)}m"; } _isZeroed = true; } private void ResetZero() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) PostZeroReticleParent.localPosition = Vector3.zero; if ((Object)(object)ZeroRangeText != (Object)null) { ZeroRangeText.text = string.Empty; } _isZeroed = false; } public void CalculateBulletDrop() { //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_001e: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0232: 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_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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: 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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) FVRFireArmChamber currentChamber = OpenScripts2_BasePlugin.GetCurrentChamber(_fireArm); FireArmRoundType roundType = _fireArm.RoundType; FVRFireArmRoundDisplayData val = AM.SRoundDisplayDataDic[roundType]; float num = ((!((Object)(object)currentChamber != (Object)null)) ? 1f : AM.GetChamberVelMult(currentChamber.RoundType, Vector3.Distance(((Component)currentChamber).transform.position, _fireArm.GetMuzzle().position))); float airDensity = 1.225f; float fixedDeltaTime = Time.fixedDeltaTime; float num2 = val.ZeroingVel; float num3 = val.ZeroingMass; float num4 = val.ZeroingXDim; BallisticProjectile val2 = null; if ((Object)(object)currentChamber != (Object)null && currentChamber.IsFull && !currentChamber.IsSpent) { FVRFireArmRound round = currentChamber.GetRound(); if ((Object)(object)round != (Object)null) { val2 = round.BallisticProjectilePrefab.GetComponent(); if ((Object)(object)val2 != (Object)null) { num2 = val2.MuzzleVelocityBase; num3 = val2.Mass; num4 = val2.Dimensions.x; } } } Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(0f, 0f, num2 * num); float num5 = (float)Math.PI * Mathf.Pow(num4 * 0.5f, 2f); Vector3 val4 = Vector3.zero; float num6 = 0f; bool flag = false; int currentKeyframe = 0; bool flag2 = false; int i; for (i = 0; i < BulletDropCalculationSingleFrameLimit; i++) { if (val4.z >= _consineAdjustedRange) { break; } if (!flag && ((Vector3)(ref val3)).magnitude < 430f) { flag = true; } if (!flag2 && val4.y < 0f) { flag2 = true; } val3 += Vector3.down * GetGravity(val2) * fixedDeltaTime; val3 = ApplyDrag(val3, airDensity, fixedDeltaTime, num5, num3); Vector3 val5 = val4 + val3 * fixedDeltaTime; num6 += Vector3.Distance(val5, val4); val4 = val5; } if (i == BulletDropCalculationSingleFrameLimit) { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(ContinueDropCalculationAfterBreak(currentKeyframe, val4, val3, num3, num5, val2)); } else { _calculatedDrop = val4.y; _stillCalculatingDrop = false; } } private IEnumerator ContinueDropCalculationAfterBreak(int currentKeyframe, Vector3 startingBulletPosition, Vector3 startingBulletVelocity, float ZeroingMass, float ZeroingCrossSectionArea, BallisticProjectile projectile) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) _stillCalculatingDrop = true; Vector3 bulletPosition = startingBulletPosition; Vector3 velocityVector2 = startingBulletVelocity; float physicsDeltaTime2 = 0.012f; physicsDeltaTime2 = Time.fixedDeltaTime; float airDensity = 1.225f; Vector3 positionLastFrame; do { positionLastFrame = bulletPosition; for (int i = 0; i < MaxAsynchIterationsPerFrame; i++) { if (bulletPosition.z >= _consineAdjustedRange) { break; } velocityVector2 += Vector3.down * GetGravity(projectile) * physicsDeltaTime2; velocityVector2 = ApplyDrag(velocityVector2, airDensity, physicsDeltaTime2, ZeroingCrossSectionArea, ZeroingMass); Vector3 val = bulletPosition + velocityVector2 * physicsDeltaTime2; if (Mathf.Abs(val.z - bulletPosition.z) < AsynchAbortEpsilon / (float)MaxAsynchIterationsPerFrame) { break; } bulletPosition = val; } if (bulletPosition.z >= _consineAdjustedRange) { break; } yield return (object)new WaitForSeconds(ArtificialCalculationDelay); } while (Mathf.Abs(bulletPosition.z - positionLastFrame.z) > AsynchAbortEpsilon); if (bulletPosition.z < _consineAdjustedRange) { _calculatedDrop = float.MinValue; } else { _calculatedDrop = bulletPosition.y; } _stillCalculatingDrop = false; } private Vector3 ApplyDrag(Vector3 velocityVector, float airDensity, float deltaTime, float frontArea, float Mass) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_005b: Unknown result type (might be due to invalid IL or missing references) float magnitude = ((Vector3)(ref velocityVector)).magnitude; Vector3 normalized = ((Vector3)(ref velocityVector)).normalized; float currentDragCoefficient = GetCurrentDragCoefficient(((Vector3)(ref velocityVector)).magnitude); Vector3 val = (0f - 0.5f * currentDragCoefficient * airDensity * (frontArea / Mass) * magnitude) * velocityVector; return normalized * Mathf.Clamp(magnitude - ((Vector3)(ref val)).magnitude * deltaTime, 0f, magnitude); } private float GetCurrentDragCoefficient(float velocityInMS) { float num = velocityInMS * 0.00291545f; return AM.BDCC.Evaluate(num); } private float GetGravity(BallisticProjectile projectile) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected I4, but got Unknown float num = 1f; if ((Object)(object)projectile != (Object)null) { num = projectile.GravityMultiplier; } GravityMode ballisticGravityMode = GM.Options.SimulationOptions.BallisticGravityMode; return (int)ballisticGravityMode switch { 0 => 9.81f * num, 1 => 5f * num, 2 => 1.622f * num, 3 => 0f * num, _ => 0f * num, }; } } public class NGSW_FC_Button : FVRInteractiveObject { public enum EButtonType { Center, Up, Down, Left, Right } [Header("NGS-FC Button Config")] public NGSW_FC_ScreenController NGSW_FC_ScreenController; public EButtonType ButtonType; public AudioEvent ButtonAudio; public override void Awake() { ((FVRInteractiveObject)this).Awake(); base.IsSimpleInteract = true; } public override void SimpleInteraction(FVRViveHand hand) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); switch (ButtonType) { case EButtonType.Center: NGSW_FC_ScreenController.ButtonCenter(); break; case EButtonType.Up: NGSW_FC_ScreenController.ButtonUp(); break; case EButtonType.Down: NGSW_FC_ScreenController.ButtonDown(); break; case EButtonType.Left: NGSW_FC_ScreenController.ButtonLeft(); break; case EButtonType.Right: NGSW_FC_ScreenController.ButtonRight(); break; } SM.PlayGenericSound(ButtonAudio, ((Component)this).transform.position); } } public class NGSW_FC_Interaction : FVRInteractiveObject { [Header("NGSW FC Interaction Config")] public NGSW_FC_ScreenController ScreenController; public float RotationMagnitudePerOption = 15f; private Vector3 _lastHandRight = Vector3.zero; private float m_curRot; public override void BeginInteraction(FVRViveHand hand) { //IL_000f: 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) ((FVRInteractiveObject)this).BeginInteraction(hand); _lastHandRight = Vector3.ProjectOnPlane(hand.Input.FilteredRight, ((Component)this).transform.up); ScreenController.EnableScreen(); } public override void UpdateInteraction(FVRViveHand hand) { //IL_0015: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_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_026c: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); if (!((FVRInteractiveObject)this).IsHeld) { return; } HandInput input = hand.Input; if (!hand.IsInStreamlinedMode && input.TouchpadDown) { if (Vector2.Angle(input.TouchpadAxes, Vector2.up) < 45f) { ScreenController.ButtonUp(); } else if (Vector2.Angle(input.TouchpadAxes, Vector2.down) < 45f) { ScreenController.ButtonDown(); } else if (Vector2.Angle(input.TouchpadAxes, Vector2.left) < 45f) { ScreenController.ButtonLeft(); } else if (Vector2.Angle(input.TouchpadAxes, Vector2.right) < 45f) { ScreenController.ButtonRight(); } } else if (hand.IsInStreamlinedMode) { if (input.AXButtonDown) { ScreenController.ButtonRight(); } else if (input.BYButtonDown) { ScreenController.ButtonLeft(); } } Vector3 val = Vector3.ProjectOnPlane(base.m_hand.Input.FilteredRight, ((Component)this).transform.up); Vector3 val2 = Vector3.ProjectOnPlane(_lastHandRight, ((Component)this).transform.up); float num = Mathf.Atan2(Vector3.Dot(((Component)this).transform.up, Vector3.Cross(val, val2)), Vector3.Dot(val, val2)) * 57.29578f; if (RotationMagnitudePerOption < 0f) { num = 0f - num; } m_curRot += num; if (m_curRot > Mathf.Abs(RotationMagnitudePerOption)) { m_curRot -= Mathf.Abs(RotationMagnitudePerOption); if (!hand.IsInStreamlinedMode) { ScreenController.IncrementBrightness(); } else { ScreenController.ButtonUp(); } } else if (m_curRot < 0f - Mathf.Abs(RotationMagnitudePerOption)) { m_curRot += Mathf.Abs(RotationMagnitudePerOption); if (!hand.IsInStreamlinedMode) { ScreenController.DecrementBrightness(); } else { ScreenController.ButtonDown(); } } _lastHandRight = val; } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); ScreenController.DisableScreen(); } } public class NGSW_FC_ScreenController : MonoBehaviour { public enum ESetting { Zero, Compass, Laser, Reticle, Color, Brightness } [Header("NGS-FC Button Config")] public NGSW_FC NGSW_FC; public LaserPointer LaserPointer; public float ScreenTimeout = 1f; public ESetting[] Settings; public int CurrentSettingIndex; public GameObject Canvas; public Image Frame; public Text LeftArrow; public Text RightArrow; public Text ZeroingValueText; public Text CompassValueText; [Header("Text Fields")] public Text ZeroingText; public Text LaserText; public Text CompassOptionText; public Text ReticleText; public Text ColorText; public Text BrightnessText; [Header("Reticle Stuff")] public Image OneEcksReticle; public Image PreZeroReticle; public Image PostZeroReticle; [ColorUsage(true, true, 0f, float.MaxValue, 0f, float.MaxValue)] public Color[] ReticleColors; public string[] ColorNames; public int CurrentColor; [ColorUsage(true, true, 0f, float.MaxValue, 0f, float.MaxValue)] public Color[] ReticleBrightnesses; public int CurrentBrightness; public Sprite[] OneEcksReticles; public string[] ReticleNames; public int CurrentReticle; public Transform BrightnessKnob; public Axis KnobAxis; public float KnobRotationStep = 15f; private ESetting _currentSetting = ESetting.Compass; private string _laserStartText; private string _compassStartText; private string _reticleStartText; private string _colorStartText; private string _brightnessStartText; private bool _screenIsOn = false; public void Awake() { _currentSetting = Settings[CurrentSettingIndex]; _laserStartText = LaserText.text; _compassStartText = CompassOptionText.text; _reticleStartText = ReticleText.text; _colorStartText = ColorText.text; _brightnessStartText = BrightnessText.text; UpdateScreen(); UpdateColorAndReticle(); } public void OnDestroy() { } public void EnableScreen() { _screenIsOn = true; Canvas.SetActive(true); ((Component)CompassValueText).gameObject.SetActive(false); ((Component)ZeroingValueText).gameObject.SetActive(false); } public void DisableScreen() { _screenIsOn = false; Canvas.SetActive(false); ((Component)CompassValueText).gameObject.SetActive(true); ((Component)ZeroingValueText).gameObject.SetActive(true); } public void IncrementBrightness() { CurrentBrightness++; if (CurrentBrightness >= ReticleBrightnesses.Length) { CurrentBrightness = ReticleBrightnesses.Length - 1; } UpdateColorAndReticle(); UpdateScreen(); } public void DecrementBrightness() { CurrentBrightness--; if (CurrentBrightness < 0) { CurrentBrightness = 0; } UpdateColorAndReticle(); UpdateScreen(); } public void ButtonCenter() { NGSW_FC.TriggerRangeFinderZeroing(); } public void ButtonUp() { if (_screenIsOn) { CurrentSettingIndex--; if (CurrentSettingIndex < 0) { CurrentSettingIndex = Settings.Length - 1; } _currentSetting = Settings[CurrentSettingIndex]; } UpdateScreen(); } public void ButtonDown() { if (_screenIsOn) { CurrentSettingIndex++; if (CurrentSettingIndex >= Settings.Length) { CurrentSettingIndex = 0; } _currentSetting = Settings[CurrentSettingIndex]; } UpdateScreen(); } public void ButtonLeft() { if (_screenIsOn) { switch (_currentSetting) { case ESetting.Zero: NGSW_FC.TriggerRangeFinderZeroing(); break; case ESetting.Compass: if (NGSW_FC.CompassEnabled) { NGSW_FC.ToggleCompass(); } break; case ESetting.Laser: if (LaserPointer.IsOn) { LaserPointer.ToggleOn(); } break; case ESetting.Reticle: CurrentReticle--; if (CurrentReticle < 0) { CurrentReticle = OneEcksReticles.Length - 1; } break; case ESetting.Color: CurrentColor--; if (CurrentColor < 0) { CurrentColor = ReticleColors.Length - 1; } break; case ESetting.Brightness: CurrentBrightness--; if (CurrentBrightness < 0) { CurrentBrightness = ReticleBrightnesses.Length - 1; } break; } } UpdateColorAndReticle(); UpdateScreen(); } public void ButtonRight() { if (_screenIsOn) { switch (_currentSetting) { case ESetting.Zero: NGSW_FC.TriggerRangeFinderZeroing(); break; case ESetting.Compass: if (!NGSW_FC.CompassEnabled) { NGSW_FC.ToggleCompass(); } break; case ESetting.Laser: if (!LaserPointer.IsOn) { LaserPointer.ToggleOn(); } break; case ESetting.Reticle: CurrentReticle++; if (CurrentReticle >= OneEcksReticles.Length) { CurrentReticle = 0; } break; case ESetting.Color: CurrentColor++; if (CurrentColor >= ReticleColors.Length) { CurrentColor = 0; } break; case ESetting.Brightness: CurrentBrightness++; if (CurrentBrightness >= ReticleBrightnesses.Length) { CurrentBrightness = 0; } break; } } UpdateScreen(); UpdateColorAndReticle(); } private void UpdateScreen() { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01e8: Unknown result type (might be due to invalid IL or missing references) Vector3 localPosition = Vector3.zero; switch (_currentSetting) { case ESetting.Zero: localPosition = ((Component)ZeroingText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(false); ((Component)RightArrow).gameObject.SetActive(false); break; case ESetting.Compass: localPosition = ((Component)CompassOptionText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(NGSW_FC.CompassEnabled); ((Component)RightArrow).gameObject.SetActive(!NGSW_FC.CompassEnabled); break; case ESetting.Laser: localPosition = ((Component)LaserText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(LaserPointer.IsOn); ((Component)RightArrow).gameObject.SetActive(!LaserPointer.IsOn); break; case ESetting.Reticle: localPosition = ((Component)ReticleText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(true); ((Component)RightArrow).gameObject.SetActive(true); break; case ESetting.Color: localPosition = ((Component)ColorText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(true); ((Component)RightArrow).gameObject.SetActive(true); break; case ESetting.Brightness: localPosition = ((Component)BrightnessText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(true); ((Component)RightArrow).gameObject.SetActive(true); break; } CompassOptionText.text = _compassStartText + (NGSW_FC.CompassEnabled ? "on" : "off"); LaserText.text = _laserStartText + (LaserPointer.IsOn ? "on" : "off"); ReticleText.text = _reticleStartText + ReticleNames[CurrentReticle]; ColorText.text = _colorStartText + ColorNames[CurrentColor]; BrightnessText.text = _brightnessStartText + CurrentBrightness; UnityEngineExtensions.ModifyLocalPositionAxisValue(((Component)LeftArrow).transform, (Axis)1, localPosition.y); UnityEngineExtensions.ModifyLocalPositionAxisValue(((Component)RightArrow).transform, (Axis)1, localPosition.y); } private void UpdateColorAndReticle() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0045: 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_005d: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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) Color color = ReticleColors[CurrentColor] * ReticleBrightnesses[CurrentBrightness]; ((Graphic)ZeroingValueText).color = color; ((Graphic)CompassValueText).color = color; ((Graphic)LeftArrow).color = color; ((Graphic)RightArrow).color = color; ((Graphic)ZeroingText).color = color; ((Graphic)LaserText).color = color; ((Graphic)CompassOptionText).color = color; ((Graphic)ReticleText).color = color; ((Graphic)ColorText).color = color; ((Graphic)BrightnessText).color = color; ((Graphic)Frame).color = color; ((Graphic)OneEcksReticle).color = color; ((Graphic)PreZeroReticle).color = color; ((Graphic)PostZeroReticle).color = color; OneEcksReticle.sprite = OneEcksReticles[CurrentReticle]; UnityEngineExtensions.ModifyLocalRotationAxisValue(BrightnessKnob, KnobAxis, (float)CurrentBrightness * KnobRotationStep); } private IEnumerator AutomaticDisplayTimeout() { _screenIsOn = true; Canvas.SetActive(true); ((Component)CompassValueText).gameObject.SetActive(false); ((Component)ZeroingValueText).gameObject.SetActive(false); for (float displayTimeOn = 0f; displayTimeOn < ScreenTimeout; displayTimeOn += Time.deltaTime) { yield return null; } ((Component)CompassValueText).gameObject.SetActive(true); ((Component)ZeroingValueText).gameObject.SetActive(true); Canvas.SetActive(false); _screenIsOn = false; } [ContextMenu("UpdateScreen")] public void ContextMenuUpdateScreen() { //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_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_006c: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) _currentSetting = Settings[CurrentSettingIndex]; Canvas.SetActive(true); Vector3 localPosition = Vector3.zero; switch (_currentSetting) { case ESetting.Zero: localPosition = ((Component)ZeroingText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(false); ((Component)RightArrow).gameObject.SetActive(false); break; case ESetting.Compass: localPosition = ((Component)CompassOptionText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(NGSW_FC.CompassEnabled); ((Component)RightArrow).gameObject.SetActive(!NGSW_FC.CompassEnabled); break; case ESetting.Laser: localPosition = ((Component)LaserText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(LaserPointer.IsOn); ((Component)RightArrow).gameObject.SetActive(!LaserPointer.IsOn); break; case ESetting.Reticle: localPosition = ((Component)ReticleText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(true); ((Component)RightArrow).gameObject.SetActive(true); break; case ESetting.Color: localPosition = ((Component)ColorText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(true); ((Component)RightArrow).gameObject.SetActive(true); break; case ESetting.Brightness: localPosition = ((Component)BrightnessText).transform.localPosition; ((Component)Frame).transform.localPosition = localPosition; ((Component)LeftArrow).gameObject.SetActive(true); ((Component)RightArrow).gameObject.SetActive(true); break; } CompassOptionText.text = _compassStartText + (NGSW_FC.CompassEnabled ? "on" : "off"); LaserText.text = _laserStartText + (LaserPointer.IsOn ? "on" : "off"); ReticleText.text = _reticleStartText + ReticleNames[CurrentReticle]; ColorText.text = _colorStartText + ColorNames[CurrentColor]; BrightnessText.text = _brightnessStartText + CurrentBrightness; UnityEngineExtensions.ModifyLocalPositionAxisValue(((Component)LeftArrow).transform, (Axis)1, localPosition.y); UnityEngineExtensions.ModifyLocalPositionAxisValue(((Component)RightArrow).transform, (Axis)1, localPosition.y); UpdateColorAndReticle(); } } } namespace JerryComponent { public class nvandthr : MonoBehaviour { public PIPScope scope; public AR15HandleSightFlipper nv; public AR15HandleSightFlipper thr; public GameObject power; public AudioEvent click; private void Start() { } private void FixedUpdate() { //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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) if (power.gameObject.transform.localEulerAngles.z > 15f) { scope.enableThermal = false; scope.enableNightvision = false; if (!nv.m_isLargeAperture) { nv.m_isLargeAperture = true; SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position); } if (!thr.m_isLargeAperture) { thr.m_isLargeAperture = true; SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position); } } else if (power.gameObject.transform.localEulerAngles.z < 15f) { if (!nv.m_isLargeAperture) { nv.m_isLargeAperture = true; scope.enableNightvision = true; scope.enableThermal = false; SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position); } if (!thr.m_isLargeAperture) { thr.m_isLargeAperture = true; scope.enableNightvision = false; scope.enableThermal = true; SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position); } } } } public class AircraftSeat : FVRInteractiveObject { public static Dictionary currentSeat = new Dictionary(); public FVRViveHand hand; public GameObject SitPos; public GameObject EjectPos; public Transform _setPos; private FVRMovementManager _playerMovement; public bool isplayerrotated = false; public bool is_inseat = false; public GravityMode gravitymode = (GravityMode)3; public Transform parent; public override void SimpleInteraction(FVRViveHand hand) { //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_004f: 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_0103: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); if (hand.IsThisTheRightHand) { hand = hand.OtherHand; } if ((Object)(object)this.hand == (Object)null) { gravitymode = GM.Options.SimulationOptions.PlayerGravityMode; GM.Options.SimulationOptions.PlayerGravityMode = (GravityMode)3; ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent(parent); if (currentSeat.ContainsKey(hand)) { currentSeat[hand].RemoveHand(); } currentSeat.Add(hand, this); this.hand = hand; hand.MovementManager.TeleportToPoint(SitPos.transform.position, false, SitPos.transform.localEulerAngles); } else if ((Object)(object)hand == (Object)(object)this.hand) { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); if ((int)gravitymode != 3) { GM.Options.SimulationOptions.PlayerGravityMode = gravitymode; } gravitymode = (GravityMode)3; RemoveHand(); is_inseat = false; if ((Object)(object)EjectPos != (Object)null) { ((Component)hand.MovementManager).transform.position = EjectPos.transform.position; } } } public void Awake() { _playerMovement = Object.FindObjectOfType(); } public void Update() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_010c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hand != (Object)null) { if (Vector3.Distance(((Component)hand.MovementManager).transform.position, ((Component)this).transform.position) > 25f) { is_inseat = false; RemoveHand(); } ((Component)hand.MovementManager).transform.position = SitPos.transform.position; Vector3 eulerAngles = ((Component)hand.MovementManager).transform.eulerAngles; ((Component)hand.MovementManager).transform.eulerAngles = Vector3.Lerp(((Component)hand.MovementManager).transform.eulerAngles, eulerAngles, 0.2f * Time.deltaTime); PlayerForwardFollowSet(); isplayerrotated = true; if (GM.CurrentPlayerBody.GetPlayerHealth() <= 0f) { is_inseat = false; RemoveHand(); } if (((Component)hand.MovementManager).transform.position.y < GM.CurrentSceneSettings.CatchHeight) { is_inseat = false; RemoveHand(); } } } public void PlayerForwardFollowSet() { //IL_001e: 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_0038: Unknown result type (might be due to invalid IL or missing references) is_inseat = true; ((Component)_playerMovement).transform.rotation = Quaternion.RotateTowards(((Component)_playerMovement).transform.rotation, ((Component)_setPos).transform.rotation, 5f); } public void RemoveHand() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (currentSeat.ContainsKey(hand)) { currentSeat.Remove(hand); } hand = null; if (isplayerrotated) { ((Component)_playerMovement).transform.eulerAngles = new Vector3(0f, ((Component)_playerMovement).transform.eulerAngles.y, 0f); isplayerrotated = false; } } public void OnDestroy() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_003b: 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_0067: 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_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) ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); if ((int)gravitymode != 3) { GM.Options.SimulationOptions.PlayerGravityMode = gravitymode; } gravitymode = (GravityMode)3; is_inseat = false; ((Component)_playerMovement).transform.eulerAngles = new Vector3(0f, ((Component)_playerMovement).transform.eulerAngles.y, 0f); } } public class CarSteer : FVRPhysicalObject { public VehicleControl vehicle; public VehicleAudioSet audioSet; public GameObject steerwheel; public float steerr; public Text rotText; public float rot; public float rh; public float lr; public float inlerp; public float lerp; public float rotAmt; public float resetLerpSpeed; public float maxRot; public bool reverseRot; public DriveShift driveshift; public override void BeginInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).BeginInteraction(hand); } public override void EndInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).EndInteraction(hand); } public override void UpdateInteraction(FVRViveHand hand) { //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) ((FVRPhysicalObject)this).UpdateInteraction(hand); rotAmt = steerwheel.transform.localEulerAngles.y; SetRot(); bool flag = false; if (hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f) { flag = true; } if (flag) { vehicle.accel = 0f - (float)Math.Pow(((Vector2)(ref hand.Input.TouchpadAxes)).magnitude, 2.0); vehicle.brake = true; } else if (driveshift.currentNode == 1) { vehicle.accel = (float)Math.Pow(hand.Input.TriggerFloat, 2.0); vehicle.brake = false; } else if (driveshift.currentNode == 0) { vehicle.accel = (float)Math.Pow(hand.Input.TriggerFloat, 0.5); vehicle.brake = false; } } private void FixedUpdate() { } private void SetRot() { //IL_002c: 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) if (rotAmt > 510f) { steerwheel.transform.localEulerAngles = new Vector3(0f, 510f, 0f); } if (rotAmt < -510f) { steerwheel.transform.localEulerAngles = new Vector3(0f, -510f, 0f); } bool flag = rotAmt <= 0f; lerp = Mathf.Abs(rotAmt) / maxRot; lerp *= -1f; if (flag) { lerp *= -1f; } if (reverseRot) { lerp = 0f - lerp; } vehicle.steer = lerp; } } public class FireRopeOB : MonoBehaviour { public OpenBoltReceiver gun; public GameObject trigger; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (trigger.transform.localPosition.z >= 0.1f) { gun.Fire(); } else if (!(trigger.transform.localPosition.z < 0.1f)) { } } } public class MGMount : MonoBehaviour { public ClosedBoltWeapon gun; public GameObject mgSpace; public GameObject mgX; public GameObject mgY; public GameObject mgObj; private float mgMoveX; private float mgMoveY; private GameObject player; public GameObject trigger; private void OnTriggerStay(Collider other) { //IL_0032: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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) if (((Object)((Component)other).gameObject).name == "Rcol") { mgObj.transform.position = ((Component)other).gameObject.transform.position; mgMoveX = mgObj.transform.localPosition.x; mgMoveY = mgObj.transform.localPosition.y; if (mgMoveX > 1f) { mgMoveX = 1f; } if (mgMoveX < 0f) { mgMoveX = 0f; } if (mgMoveY > 1f) { mgMoveY = 1f; } if (mgMoveY < 0f) { mgMoveY = 0f; } mgX.transform.localEulerAngles = new Vector3(0f, (1f - mgMoveX) * 40f, 0f); mgY.transform.localEulerAngles = new Vector3(mgMoveY * 40f, 0f, 0f); } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "Rcol") { ((Component)other).gameObject.transform.parent = player.transform; } } private void Start() { } private void Update() { //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_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_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_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) player = GameObject.Find("[CameraRig]Fixed"); if ((Object)(object)player == (Object)null || trigger.transform.localEulerAngles.x < 2f || trigger.transform.localEulerAngles.x > 88f) { } if (trigger.transform.localEulerAngles.x > 2f && trigger.transform.localEulerAngles.x < 88f) { gun.Fire(); } } } } namespace JerryAr.1PN51 { [BepInPlugin("JerryAr.1PN51", "1PN51", "1.0.2")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class 1PN51Plugin : BaseUnityPlugin { private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static ManualLogSource Logger; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; LoadAssets(); } private void LoadAssets() { Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "JerryAr.1PN51"); OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.1PN51", "", "", "1pn51", ""); } } } [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(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(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)("Mesh \"" + ((Object)this).name + "\" was created from " + array.Length + " children meshes and has " + num + " vertices.")); } } else if (showCreatedMeshInfo) { Debug.Log((object)("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).")); } } 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(); List list = new List(); for (int i = 0; i < meshFiltersToCombine.Length - 1; i++) { array[i + 1] = ((Component)meshFiltersToCombine[i + 1]).GetComponent(); 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 list2 = new List(); long num = 0L; for (int k = 0; k < list.Count; k++) { List list3 = new List(); 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)("Mesh \"" + ((Object)this).name + "\" was created from " + (meshFiltersToCombine.Length - 1) + " children meshes and has " + list2.Count + " submeshes, and " + num + " vertices.")); } } else if (showCreatedMeshInfo) { Debug.Log((object)("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).")); } } 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(); 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); } } } namespace JerryComponent { public class ReticleGunDetect : MonoBehaviour { public GameObject laserobj; public LaserLight laser; private void Update() { //IL_0711: 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_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable != (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent() != (Object)null) { if ((Object)(object)GM.CurrentMovementManager.Hands[0].OtherHand.m_currentInteractable == (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos != (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].OtherHand.m_currentInteractable != (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].OtherHand.m_currentInteractable).gameObject.GetComponent() == (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos != (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } else if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos == (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } } else if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].OtherHand.m_currentInteractable).gameObject.GetComponent() != (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos != (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } else if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos == (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[0].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } } } } } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable != (Object)null && (Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent() != (Object)null) { if ((Object)(object)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable == (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().MuzzlePos != (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable != (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable).gameObject.GetComponent() == (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().MuzzlePos != (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } else if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().MuzzlePos == (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[1].m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } } else if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable).gameObject.GetComponent() != (Object)null) { if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable).gameObject.GetComponent().MuzzlePos != (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } else if ((Object)(object)((Component)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable).gameObject.GetComponent().MuzzlePos == (Object)null) { laserobj.transform.eulerAngles = ((Component)((Component)GM.CurrentMovementManager.Hands[1].OtherHand.m_currentInteractable).gameObject.GetComponent().MuzzlePos).gameObject.transform.eulerAngles; laser.IsActive = true; } } } } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null) { laserobj.transform.localEulerAngles = new Vector3(0f, 0f, 0f); laser.IsActive = false; } } } } public class ReticleOverLayOnNV : PIPScopeGUIDrawer { public Material uiMaterial; public Texture2D hostileTexture; public Color hostileColor = new Color(0.9f, 0.3f, 0.25f, 0.8f); public float iconSize = 32f; public float iconEdgeOffset = 8f; public bool scaleWithDistance = true; public Vector2 iconSizeMinMax = new Vector2(16f, 64f); public bool forceCircularBorder; public LaserLight laser; public override void DrawGUI(PIPScope scope, Canvas canvas, Vector2 canvasSize) { //IL_015d: 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) if ((Object)(object)GM.TNH_Manager == (Object)null) { return; } bool flag = (Object)(object)GM.TNH_Manager.CurHoldPoint != (Object)null; bool flag2 = (Object)(object)GM.TNH_Manager.TAHReticle != (Object)null; List list = GM.TNH_Manager.ActiveSupplyPointIndicies(); if (flag || list.Count != 0 || flag2) { float num = Mathf.Max(canvasSize.x, canvasSize.y); float num2 = Mathf.Min(canvasSize.x, canvasSize.y); Transform scopeTransform = ((scope.enableThermal && (Object)(object)scope.thermalScopeCam != (Object)null) ? ((Component)scope.thermalScopeCam).transform : ((Component)scope.scopeCam).transform); float num3 = ((!scope.enableThermal || !(scope.thermalOverlayFOV > 0f)) ? GetCameraFov((scope.enableThermal && (Object)(object)scope.thermalScopeCam != (Object)null) ? scope.thermalScopeCam.cam : scope.pipScopeCam.cam) : scope.thermalOverlayFOV); float degreesToPixels = num / num3; if (laser.IsActive) { uiMaterial.mainTexture = (Texture)(object)hostileTexture; uiMaterial.color = hostileColor; uiMaterial.SetPass(0); DrawTransformIcon(scope, scopeTransform, canvasSize, degreesToPixels, ((Component)laser.laserDot).gameObject.transform); } } } public float GetCameraFov(Camera cam) { if (cam.aspect > 1f) { return VerticalToHorizontalFOV(cam.fieldOfView, cam.aspect); } return cam.fieldOfView; } public void DrawIcon(Vector2 position, Vector2 size) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 val = Matrix4x4.TRS(new Vector3(position.x - size.x * 0.5f, position.y - size.y * 0.5f, 0f), Quaternion.identity, new Vector3(size.x, size.y, 1f)); Graphics.DrawMeshNow(PIPScopeGUIUtility.GetQuad(), val); } public void DrawTransformIcon(PIPScope scope, Transform scopeTransform, Vector2 canvasSize, float degreesToPixels, Transform t) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0227: 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_0193: 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_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) Matrix4x4 worldToLocalMatrix = scopeTransform.worldToLocalMatrix; Vector3 val = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(t.position); Vector3 val2 = Vector3.Normalize(val); Quaternion val3 = Quaternion.LookRotation(val2); Vector3 eulerAngles = ((Quaternion)(ref val3)).eulerAngles; Vector2 val4 = EulerAngleToDirection(eulerAngles, degreesToPixels); float num = iconSize; if (scaleWithDistance) { num *= 25f; float magnitude = ((Vector3)(ref val)).magnitude; num /= Mathf.Max(0.001f, magnitude); num = Mathf.Clamp(num, iconSizeMinMax.x, iconSizeMinMax.y); } num = Mathf.Round(num * 0.5f) * 2f; if (scope.thermalOverlayCircular || forceCircularBorder) { float num2 = (Mathf.Min(canvasSize.x, canvasSize.y) - num) * 0.5f - iconEdgeOffset; float num3 = val4.x * val4.x + val4.y * val4.y; if (num3 > num2 * num2) { val4 *= num2 / Mathf.Sqrt(num3); } } else { Vector2 val5 = default(Vector2); ((Vector2)(ref val5))..ctor((canvasSize.x - num) * 0.5f - iconEdgeOffset, (canvasSize.y - num) * 0.5f - iconEdgeOffset); if (Mathf.Abs(val4.x) > val5.x || Mathf.Abs(val4.y) > val5.y) { Vector2 normalized = ((Vector2)(ref val4)).normalized; float num4 = Vector2.Angle(Vector2.right, normalized); float num5 = Mathf.Abs(val5.y / Mathf.Cos((90f - num4) * ((float)Math.PI / 180f))); float num6 = Mathf.Abs(val5.x / Mathf.Sin((90f - num4) * ((float)Math.PI / 180f))); val4 = normalized * Mathf.Min(num5, num6); } } val4.x = Mathf.Round(val4.x); val4.y = Mathf.Round(val4.y); DrawIcon(val4, new Vector2(num, num)); } public Vector2 EulerAngleToDirection(Vector3 eulerAngle, float degreesToPixels) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) Vector2 result = default(Vector2); ((Vector2)(ref result))..ctor(eulerAngle.y, 0f - eulerAngle.x); result.x = Mathf.Repeat(result.x, 360f); result.y = Mathf.Repeat(result.y, 360f); if (result.x > 180f) { result.x -= 360f; } if (result.y > 180f) { result.y -= 360f; } result.x *= degreesToPixels; result.y *= degreesToPixels; return result; } public float VerticalToHorizontalFOV(float verticalFOV, float aspect) { return Mathf.Atan(Mathf.Tan(verticalFOV * 0.5f * ((float)Math.PI / 180f)) * aspect) * 2f * ((float)Math.PI / 180f); } } namespace JerryComponent { public class TacEarPro2 : MonoBehaviour { public GameObject powerswitch; public AudioLowPassFilter alf; public float alfMax = 10000f; public float alfMin = 200f; public float alfHalfMin = 400f; public float alfIncRate = 10f; public float soundvolumeNorm = 1f; public float soundvolumeInc = 1.5f; public GameObject on; public GameObject off; public GameObject whole; public Transform PlugPort; private void OnShotFired(FVRFireArm firearm) { alf.cutoffFrequency = alfMin; } private void OnSosigGunFired(SosigWeapon sosigWeapon) { alf.cutoffFrequency = alfHalfMin; } private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired); GM.CurrentSceneSettings.SosiggunFiredEvent += new SosiggunFired(OnSosigGunFired); } private void Denoise() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) whole.SetActive(true); if (powerswitch.transform.localEulerAngles.x >= 45f) { on.SetActive(true); off.SetActive(false); AudioListener.volume = soundvolumeInc; if (alf.cutoffFrequency != alfMax) { AudioLowPassFilter obj = alf; obj.cutoffFrequency += alfIncRate; } if (alf.cutoffFrequency > alfMax) { alf.cutoffFrequency = alfMax; } } if (powerswitch.transform.localEulerAngles.x < 45f) { on.SetActive(false); off.SetActive(true); AudioListener.volume = soundvolumeNorm; } } private void Update() { Denoise(); } private void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnShotFired); GM.CurrentSceneSettings.SosiggunFiredEvent -= new SosiggunFired(OnSosigGunFired); } } public class NVGKnob : MonoBehaviour { public PIPScope scope; public GameObject powerknob; public float refgain; public float reflum; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public AudioSource whing; public float volref; public float pitref; public float aref; public float rref; public float gref; public float bref; public float pitch = 1f; public float volume = 0.025f; private void Start() { //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) scope.reticleIllumination = new Color(0f, 0f, 0f, 0f); scope.nvDef.nightVisionTargetBrightness = 0f; scope.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; volref = 0f; pitref = 0f; whing.volume = 0f; whing.pitch = 0f; } private void FixedUpdate() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_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_02f1: 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_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)scope).enabled = true; scope.UpdateParameters(); if (powerknob.transform.localEulerAngles.x <= 15f) { scope.reticleIllumination = new Color(Mathf.SmoothDamp(scope.reticleIllumination.a, 0f, ref aref, offspeed), Mathf.SmoothDamp(scope.reticleIllumination.r, 0f, ref rref, offspeed), Mathf.SmoothDamp(scope.reticleIllumination.g, 0f, ref gref, offspeed), Mathf.SmoothDamp(scope.reticleIllumination.b, 0f, ref bref, offspeed)); scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 0f, ref reflum, offspeed); whing.volume = Mathf.SmoothDamp(whing.volume, 0f, ref volref, offspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, 0f, ref pitref, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x > 15f) { scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 1f, ref reflum, onspeed); whing.volume = Mathf.SmoothDamp(whing.volume, volume, ref volref, onspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, pitch, ref pitref, onspeed); scope.reticleIllumination = new Color(Mathf.SmoothDamp(scope.reticleIllumination.a, 1f, ref aref, onspeed), Mathf.SmoothDamp(scope.reticleIllumination.r, 1f, ref rref, onspeed), Mathf.SmoothDamp(scope.reticleIllumination.g, 1f, ref gref, onspeed), Mathf.SmoothDamp(scope.reticleIllumination.b, 1f, ref bref, onspeed)); if (!started) { scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scope.nvDef.nightVisionTargetBrightness > 0.9f) { scope.reticleIllumination = new Color(1f, 1f, 1f, 1f); scope.nightVisionManualGainFactor = 1f; scope.nvDef.nightVisionTargetBrightness = 1f; started = true; } } } } public class PNV57EControl : MonoBehaviour { public GameObject phys; public GameObject armreal; public GameObject armfake; public Vector3 velLinearWorldL; public Vector3 velLinearWorldR; public Transform slapdirUP; public Transform slapdirDown; public HeadAttachment HA; public PIPScope scopeL; public PIPScope scopeR; public GameObject powerknob; public float refgain; public float reflum; public AudioEvent flip; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public bool isheadmounted = true; public AudioSource whing; public float volref; public float pitref; public float volume; public float pitch; private void Start() { scopeL.nvDef.nightVisionTargetBrightness = 0f; scopeL.nightVisionManualGainFactor = 0f; scopeR.nvDef.nightVisionTargetBrightness = 0f; scopeR.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; volref = 0f; pitref = 0f; whing.volume = 0f; whing.pitch = 0f; } private void FixedUpdate() { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_053a: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Invalid comparison between Unknown and I4 //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: 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_0149: 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_0348: Invalid comparison between Unknown and I4 //IL_029c: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)scopeL).enabled = true; scopeL.UpdateParameters(); ((Behaviour)scopeR).enabled = true; scopeR.UpdateParameters(); if (isheadmounted) { armfake.transform.localEulerAngles = armreal.transform.localEulerAngles; phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; velLinearWorldL = GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld; velLinearWorldR = GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld; if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } } if (powerknob.transform.localEulerAngles.x > 15f) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 0f, ref reflum, offspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 0f, ref reflum, offspeed); whing.volume = Mathf.SmoothDamp(whing.volume, 0f, ref volref, offspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, 0f, ref pitref, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x < 15f) { scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 1f, ref reflum, onspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 1f, ref reflum, onspeed); whing.volume = Mathf.SmoothDamp(whing.volume, volume, ref volref, onspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, pitch, ref pitref, onspeed); if (!started) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scopeL.nvDef.nightVisionTargetBrightness > 0.9f && scopeR.nvDef.nightVisionTargetBrightness > 0.9f) { started = true; } } } private void OnDestroy() { Object.Destroy((Object)(object)phys); } } public class PVS7Control : MonoBehaviour { public GameObject phys; public GameObject armreal; public GameObject armfake; public Vector3 velLinearWorldL; public Vector3 velLinearWorldR; public Transform slapdirUP; public Transform slapdirDown; public HeadAttachment HA; public PIPScope scope; public GameObject powerknob; public float refgain; public float reflum; public AudioEvent flip; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public bool isheadmounted = true; private void Start() { scope.nvDef.nightVisionTargetBrightness = 0f; scope.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; } private void FixedUpdate() { //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: 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_0073: 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_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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Invalid comparison between Unknown and I4 //IL_0107: 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_026a: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Invalid comparison between Unknown and I4 //IL_0285: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: 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_0367: 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_023c: 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_03ba: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)scope).enabled = true; scope.UpdateParameters(); if (isheadmounted) { armfake.transform.localEulerAngles = armreal.transform.localEulerAngles; phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; velLinearWorldL = GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld; velLinearWorldR = GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld; if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } } if (powerknob.transform.localEulerAngles.x > 15f) { scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 0f, ref reflum, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x < 15f) { scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 1f, ref reflum, onspeed); if (!started) { scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scope.nvDef.nightVisionTargetBrightness > 0.9f) { started = true; } } } private void OnDestroy() { Object.Destroy((Object)(object)phys); } } public class bighelmet : MonoBehaviour { public GameObject main; public GameObject l; public GameObject r; public GameObject nvg; public PIPScope caml; public PIPScope camr; public bool onhead = false; public void FixedUpdate() { //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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_0102: 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_014f: 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_01c4: 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_01d7: 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_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0239: 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_0281: 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_02d3: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("Gearbig"); if ((Object)(object)val != (Object)null) { if (!onhead) { l.transform.localEulerAngles = new Vector3(0f, 0f, l.transform.localEulerAngles.z + 10f); r.transform.localEulerAngles = new Vector3(0f, 0f, r.transform.localEulerAngles.z - 10f); caml.cameraClipRearLens = 0.05f; camr.cameraClipRearLens = 0.05f; main.gameObject.transform.localPosition = new Vector3(0f, 0.05f, 0f); main.transform.localScale = new Vector3(1.25f, 1.25f, 1.25f); nvg.gameObject.transform.localScale = new Vector3(1.75f, 1f, 1.75f); l.transform.localScale = new Vector3(0.5f, 0.5f, 1f); r.transform.localScale = new Vector3(0.5f, 0.5f, 1f); onhead = true; } } else if ((Object)(object)val == (Object)null && onhead) { l.transform.localEulerAngles = new Vector3(0f, 0f, l.transform.localEulerAngles.z - 10f); r.transform.localEulerAngles = new Vector3(0f, 0f, r.transform.localEulerAngles.z + 10f); l.transform.localScale = new Vector3(1f, 1f, 1f); r.transform.localScale = new Vector3(1f, 1f, 1f); main.transform.localScale = new Vector3(1f, 1f, 1f); nvg.gameObject.transform.localScale = new Vector3(1f, 1f, 1f); main.gameObject.transform.localPosition = new Vector3(0f, 0f, 0f); caml.cameraClipRearLens = 0.011f; camr.cameraClipRearLens = 0.011f; onhead = false; } } } internal class BikeSteer : FVRPhysicalObject { public VehicleControl vehicle; public VehicleAudioSet audioSet; public GameObject steerwheel; public float steerr; public Text rotText; public float rot; public float rh; public float lr; public float inlerp; public float lerp; public float rotAmt; public float resetLerpSpeed; public float maxRot; public bool reverseRot; public DriveShift driveshift; public override void BeginInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).BeginInteraction(hand); } public override void EndInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).EndInteraction(hand); } public override void UpdateInteraction(FVRViveHand hand) { //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) ((FVRPhysicalObject)this).UpdateInteraction(hand); rotAmt = steerwheel.transform.localEulerAngles.y; SetRot(); bool flag = false; if (hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f) { flag = true; } if (flag) { vehicle.accel = 0f - (float)Math.Pow(((Vector2)(ref hand.Input.TouchpadAxes)).magnitude, 2.0); vehicle.brake = true; } else if (driveshift.currentNode == 1) { vehicle.accel = (float)Math.Pow(hand.Input.TriggerFloat, 2.0); vehicle.brake = false; } else if (driveshift.currentNode == 0) { vehicle.accel = (float)Math.Pow(hand.Input.TriggerFloat, 0.5); vehicle.brake = false; } } private void FixedUpdate() { if ((Object)(object)((FVRInteractiveObject)this).m_hand == (Object)null) { float num = resetLerpSpeed; if (rotAmt > 0f) { num = 0f - num; } if (rotAmt > num || rotAmt < 0f - num) { rotAmt += num; vehicle.accel = 0f; SetRot(); } } } private void SetRot() { bool flag = rotAmt > 180f; if (!flag) { lerp = Mathf.Abs(rotAmt) / maxRot; lerp *= -1f; } else if (flag) { lerp = Mathf.Abs(360f - rotAmt) / maxRot; } if (reverseRot) { lerp = 0f - lerp; } if ((Object)(object)rotText != (Object)null) { rotText.text = lerp.ToString(); } vehicle.steer = lerp; } } public class RandomMusic : MonoBehaviour { public GameObject toggle; public GameObject[] _BGMs; public GameObject _Selected; public AudioSource _BGMnow; public Random Rand; public int _MaxNum; private bool playmusic; private bool musicpicked = false; public void Awake() { } private void RandomPick() { if (playmusic && !musicpicked) { Rand = new Random(); Rand.Next(_MaxNum); _Selected = _BGMs[Rand.Next(_MaxNum)]; _Selected.SetActive(true); musicpicked = true; } } 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (toggle.transform.localEulerAngles.x >= 45f) { playmusic = true; RandomPick(); ref AudioSource bGMnow = ref _BGMnow; Component component = _Selected.GetComponent(typeof(AudioSource)); bGMnow = (AudioSource)(object)((component is AudioSource) ? component : null); if ((!_BGMnow.isPlaying || !musicpicked) && !_BGMnow.isPlaying && musicpicked) { _Selected.SetActive(false); musicpicked = false; RandomPick(); } } if (toggle.transform.localEulerAngles.x < 45f) { _Selected.SetActive(false); playmusic = false; musicpicked = false; } } } public class AutoAdjustHeight2 : MonoBehaviour { public GameObject headpos; public GameObject headposref; public GameObject seatheight; public AircraftSeat acs; public float lasttime = 5f; private void Start() { } private void Update() { //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_012f: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (acs.is_inseat) { if (lasttime > 0f) { lasttime -= Time.deltaTime; headpos.transform.position = ((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position; seatheight.transform.localPosition = new Vector3(seatheight.transform.localPosition.x + (headposref.transform.localPosition.x - headpos.transform.localPosition.x) * Time.deltaTime, seatheight.transform.localPosition.y + (headposref.transform.localPosition.y - headpos.transform.localPosition.y) * Time.deltaTime, seatheight.transform.localPosition.z + (headposref.transform.localPosition.z - headpos.transform.localPosition.z) * Time.deltaTime); } } else { lasttime = 5f; headpos.transform.localPosition = new Vector3(0f, 0f, 0f); seatheight.transform.localPosition = new Vector3(0f, 0f, 0f); } } } public class AutoRange : MonoBehaviour { public PIPScopeController scope; public GameObject Triggerswitch; public int rangenum; public float cal; public Text text; public Transform Direction; public LayerMask layerMask; private void Start() { } public void Awake() { Direction = ((Component)this).gameObject.transform; } public void FixedUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.TransformDirection(Vector3.forward), ref val, float.PositiveInfinity, LayerMask.op_Implicit(layerMask))) { float distance = ((RaycastHit)(ref val)).distance; cal = distance / 100f - 1f; if (cal < 0f) { cal = 0f; } else if (cal > 29f) { cal = 29f; } rangenum = (int)cal; if (Triggerswitch.transform.localEulerAngles.x > 45f) { scope.ZeroDistanceIndex = rangenum; } } } } public class CannonSafety : MonoBehaviour { public ClosedBoltWeapon gun; public FVRFireArmChamber chamber; private void Start() { } private void Update() { if (chamber.IsFull) { gun.m_fireSelectorMode = 0; } else if (!chamber.IsFull) { gun.m_fireSelectorMode = 1; } } } public class ElevLimit : MonoBehaviour { public GameObject MG; 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_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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if (MG.transform.localEulerAngles.z < 2f) { MG.transform.localEulerAngles = new Vector3(0f, 0f, 2f); } else if (MG.transform.localEulerAngles.z > 88f) { MG.transform.localEulerAngles = new Vector3(0f, 0f, 88f); } } } public class FireRopeOB2 : MonoBehaviour { public OpenBoltReceiver gun; public GameObject trigger; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (trigger.transform.localEulerAngles.x > 2f && trigger.transform.localEulerAngles.x < 88f) { gun.ReleaseSeer(); } else if (trigger.transform.localEulerAngles.x < 2f || trigger.transform.localEulerAngles.x > 88f) { gun.EngageSeer(); } } } public class HandCrankHandle : MonoBehaviour { public string objdragged; private void Update() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_007a: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_012f: 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_0106: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameObject.Find(objdragged) != (Object)null) { ((Component)this).gameObject.transform.SetParent(GameObject.Find(objdragged).transform); } if (((Component)this).transform.localPosition.y > 0.05f) { ((Component)this).transform.localPosition = new Vector3(0f, 0.05f, ((Component)this).transform.localPosition.z); } else if (((Component)this).transform.localPosition.y < -0.05f) { ((Component)this).transform.localPosition = new Vector3(0f, -0.05f, ((Component)this).transform.localPosition.z); } if (((Component)this).transform.localPosition.z > 0.05f) { ((Component)this).transform.localPosition = new Vector3(0f, ((Component)this).transform.localPosition.y, 0.05f); } else if (((Component)this).transform.localPosition.z < -0.05f) { ((Component)this).transform.localPosition = new Vector3(0f, ((Component)this).transform.localPosition.y, -0.05f); } } } public class LockExceptXAxis : MonoBehaviour { private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) ((Component)this).gameObject.transform.localEulerAngles = new Vector3(((Component)this).gameObject.transform.localEulerAngles.x, 0f, 0f); } } public class OnlyOne : MonoBehaviour { private void OnEnable() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown int num = 0; Object[] array = Object.FindObjectsOfType(typeof(FVRPhysicalObject)); for (int i = 0; i < array.Length; i++) { FVRPhysicalObject val = (FVRPhysicalObject)array[i]; num++; if (((Object)((Component)val).gameObject).name == ((Object)((Component)this).gameObject).name && !((Object)(object)((Component)val).gameObject == (Object)(object)((Component)this).gameObject) && (Object)(object)((Component)val).gameObject != (Object)(object)((Component)this).gameObject) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void Update() { } } public class SmokeLauncher : MonoBehaviour { public GameObject trigger; public ParticleSystem PS1; public ParticleSystem PS2; public ParticleSystem PS3; public ParticleSystem PS4; public bool shoot = false; 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (trigger.transform.localEulerAngles.x > 2f && trigger.transform.localEulerAngles.x < 88f) { if (!shoot) { PS1.Play(); PS2.Play(); PS3.Play(); PS4.Play(); shoot = true; } } else if (trigger.transform.localEulerAngles.x < 2f || trigger.transform.localEulerAngles.x > 88f) { shoot = false; } } } public class SmokeOnRotate : MonoBehaviour { public GameObject rot; public ParticleSystem PS; 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (rot.transform.localEulerAngles.x > 45f) { PS.Play(); } else if (rot.transform.localEulerAngles.x <= 45f) { PS.Stop(); } } } public class SnapToPointRigidbody : MonoBehaviour { public Transform snapTo; [NonSerialized] private Rigidbody body; public float snapTime = 2f; [NonSerialized] private float dropTimer; public void Start() { body = ((Component)this).GetComponent(); } public void FixedUpdate() { //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_00ae: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) dropTimer += Time.deltaTime / (snapTime / 2f); body.isKinematic = dropTimer > 1f; if (dropTimer > 1f) { ((Component)this).transform.position = snapTo.position; ((Component)this).transform.rotation = snapTo.rotation; return; } float num = Mathf.Pow(35f, dropTimer); body.velocity = Vector3.Lerp(body.velocity, Vector3.zero, Time.fixedDeltaTime * 4f); if (body.useGravity) { body.AddForce(-Physics.gravity); } ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, snapTo.position, Time.fixedDeltaTime * num * 3f); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, snapTo.rotation, Time.fixedDeltaTime * num * 2f); } } public class SpawnID : MonoBehaviour { public FVRObject turret; public FVRObject cannon; public FVRObject wh; public FVRObject wv; public string bh; public string bv; public GameObject t; public GameObject g; public string whid; public string wvid; public string turretid; public string cannonid; public string turretposid; public string cannonposid; public FVRObject hhandle; public string hposid; public string hcrankid; public string hhandleid; public GameObject hhandleobj; public Rigidbody hrig; public SpringJoint hcj; public FVRObject hand; public string handb; public string handid; public FVRObject vhandle; public string vposid; public string vcrankid; public string vhandleid; public GameObject vhandleobj; public Rigidbody vrig; public SpringJoint vcj; public string lsb; public string rsb; public string stl; public string str; public FVRObject ls; public FVRObject rs; private void Awake() { //IL_0033: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: 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_0206: 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) if ((Object)(object)GameObject.Find(stl) == (Object)null) { Object.Instantiate(((AnvilAsset)ls).GetGameObject(), GameObject.Find(lsb).transform.position, GameObject.Find(lsb).transform.rotation); } if ((Object)(object)GameObject.Find(str) == (Object)null) { Object.Instantiate(((AnvilAsset)rs).GetGameObject(), GameObject.Find(rsb).transform.position, GameObject.Find(rsb).transform.rotation); } if ((Object)(object)GameObject.Find(handid) == (Object)null) { Object.Instantiate(((AnvilAsset)hand).GetGameObject(), ((Component)this).gameObject.transform); } if ((Object)(object)GameObject.Find(turretid) == (Object)null) { Object.Instantiate(((AnvilAsset)turret).GetGameObject(), GameObject.Find(turretposid).transform.position, GameObject.Find(turretposid).transform.rotation); } if ((Object)(object)GameObject.Find(cannonid) == (Object)null) { Object.Instantiate(((AnvilAsset)cannon).GetGameObject(), GameObject.Find(cannonposid).transform.position, GameObject.Find(cannonposid).transform.rotation); } if ((Object)(object)GameObject.Find(whid) == (Object)null) { Object.Instantiate(((AnvilAsset)wh).GetGameObject(), GameObject.Find(bh).transform.position, GameObject.Find(bh).transform.rotation); } if ((Object)(object)GameObject.Find(wvid) == (Object)null) { Object.Instantiate(((AnvilAsset)wv).GetGameObject(), GameObject.Find(bv).transform.position, GameObject.Find(bv).transform.rotation); } if ((Object)(object)GameObject.Find(hposid) != (Object)null) { Object.Instantiate(((AnvilAsset)hhandle).GetGameObject(), GameObject.Find(hposid).transform); } if ((Object)(object)GameObject.Find(vposid) != (Object)null) { Object.Instantiate(((AnvilAsset)vhandle).GetGameObject(), GameObject.Find(vposid).transform); } } private void Update() { //IL_009c: 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_023b: 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_0272: 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_02f3: 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_0342: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hhandleobj == (Object)null) { hhandleobj = GameObject.Find(hhandleid); } if ((Object)(object)vhandleobj == (Object)null) { vhandleobj = GameObject.Find(vhandleid); } if ((Object)(object)hcj == (Object)null) { hcj = hhandleobj.AddComponent(); ((Joint)hcj).connectedBody = GameObject.Find(hcrankid).GetComponent(); ((Joint)hcj).anchor = new Vector3(0f, 0f, 0f); hcj.spring = 10000f; hcj.damper = 100f; hcj.tolerance = 1E-11f; } if ((Object)(object)vcj == (Object)null) { vcj = vhandleobj.AddComponent(); ((Joint)vcj).connectedBody = GameObject.Find(vcrankid).GetComponent(); ((Joint)vcj).anchor = new Vector3(0f, 0f, 0f); vcj.spring = 10000f; vcj.damper = 100f; vcj.tolerance = 1E-11f; } if ((Object)(object)hhandleobj != (Object)null && (Object)(object)GameObject.Find(hposid) != (Object)null) { hhandleobj.GetComponent().isKinematic = false; } if ((Object)(object)vhandleobj != (Object)null && (Object)(object)GameObject.Find(vposid) != (Object)null) { vhandleobj.GetComponent().isKinematic = false; } if (!((Object)(object)GameObject.Find(turretid) != (Object)null)) { return; } t = GameObject.Find(turretid); t.transform.SetParent(GameObject.Find(turretposid).transform); t.transform.localPosition = new Vector3(0f, 0f, 0f); t.transform.localEulerAngles = new Vector3(0f, t.transform.localEulerAngles.y, 0f); if ((Object)(object)GameObject.Find(cannonid) != (Object)null) { g = GameObject.Find(cannonid); g.transform.SetParent(GameObject.Find(cannonposid).transform); g.transform.localPosition = new Vector3(0f, 0f, 0f); float num = g.transform.localEulerAngles.z; if (num > 15f) { num = 15f; } else if (num < 0.5f) { num = 0.5f; } g.transform.localEulerAngles = new Vector3(0f, 0f, num); } } } public class TankCommanderVoiceControl : MonoBehaviour { public string geol = "SphereL(Clone)"; public string geor = "SphereR(Clone)"; public GameObject DriverGeo; public GameObject Phys; private KeywordRecognizer keyword; private Dictionary dic = new Dictionary(); public AR15HandleSightFlipper EngineSwitch; public AR15HandleSightFlipper DriverHatch; public AR15HandleSightFlipper Gear; public AR15HandleSightFlipper Light; public bool fore = false; public bool l = false; public bool r = false; public bool hasCrew = false; public bool engineOn = false; public bool moveForward = false; public bool moveRearward = false; public bool turnLeft = false; public bool turnRight = false; private void Start() { //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0808: Expected O, but got Unknown //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Expected O, but got Unknown Phys.SetActive(false); dic.Add("Водитель, введите.", CrewOn); dic.Add("Водитель, уходите.", CrewOff); dic.Add("Driver, on board.", CrewOn); dic.Add("Driver, get in.", CrewOn); dic.Add("Driver, off board.", CrewOff); dic.Add("Driver, bail out.", CrewOff); dic.Add("驾驶员,上车。", CrewOn); dic.Add("驾驶员,登车。.", CrewOn); dic.Add("驾驶员,下车。", CrewOff); dic.Add("驾驶员,弃车。", CrewOff); dic.Add("Водитель, запусти двигатель.", EngineOn); dic.Add("Водитель, выключите двигатель.", EngineOff); dic.Add("Водитель, вперед.", MoveFore); dic.Add("Водитель, подай назад.", MoveRear); dic.Add("Водитель, слева.", TurnLeft); dic.Add("Водитель, справа.", TurnRight); dic.Add("Водитель, впереди.", GoStraight); dic.Add("Водитель, остановись.", HoldStop); dic.Add("Водитель, выходи.", HatchOpen); dic.Add("Водитель, садись.", HatchClose); dic.Add("Driver, turn on the engine.", EngineOn); dic.Add("Driver, start the engine.", EngineOn); dic.Add("Driver, turn off the engine.", EngineOff); dic.Add("Driver, stop the engine.", EngineOff); dic.Add("驾驶员,启动引擎。", EngineOn); dic.Add("驾驶员,引擎启动。", EngineOn); dic.Add("驾驶员,关闭引擎。", EngineOff); dic.Add("驾驶员,引擎关闭。", EngineOff); dic.Add("Driver, keep moving forward.", MoveFore); dic.Add("Driver, move forward.", MoveFore); dic.Add("Driver, forward.", MoveFore2); dic.Add("Driver, keep moving rearward.", MoveRear); dic.Add("Driver, move backward.", MoveRear); dic.Add("Driver, backward.", MoveRear); dic.Add("Driver, keep turning Left.", TurnLeft); dic.Add("Driver, turn Left.", TurnLeft); dic.Add("Driver, Left.", TurnLeft2); dic.Add("Driver, keep turning Right.", TurnRight); dic.Add("Driver, turn Right.", TurnRight); dic.Add("Driver, Right.", TurnRight2); dic.Add("Driver, move straight.", GoStraight); dic.Add("Driver, stop.", HoldStop); dic.Add("Driver, hold position.", HoldStop); dic.Add("驾驶员,保持前进。", MoveFore); dic.Add("驾驶员,向前保持。", MoveFore); dic.Add("驾驶员,前进。", MoveFore2); dic.Add("驾驶员,后退。", MoveRear); dic.Add("驾驶员,倒车。", MoveRear); dic.Add("驾驶员,后撤。", MoveRear); dic.Add("驾驶员,保持左转。", TurnLeft); dic.Add("驾驶员,向左保持。", TurnLeft); dic.Add("驾驶员,左转。", TurnLeft2); dic.Add("驾驶员,保持右转。", TurnRight); dic.Add("驾驶员,向右保持。", TurnRight); dic.Add("驾驶员,右转。", TurnRight2); dic.Add("驾驶员,直行。", GoStraight); dic.Add("驾驶员,停下。", HoldStop); dic.Add("驾驶员,停车。", HoldStop); dic.Add("Driver, turn out.", HatchOpen); dic.Add("Driver, open the hatch.", HatchOpen); dic.Add("Driver, turn in.", HatchClose); dic.Add("Driver, close the hatch.", HatchClose); dic.Add("Driver, turn on the head light.", LightOn); dic.Add("Driver, turn off the head light.", LightOff); dic.Add("Водитель,высунуться.", HatchOpen); dic.Add("Водитель,открытый люк.", HatchOpen); dic.Add("Водитель,сжиматься назад.", HatchClose); dic.Add("Водитель,закрыть люк.", HatchClose); dic.Add("驾驶员,探出。", HatchOpen); dic.Add("驾驶员,打开舱门。", HatchOpen); dic.Add("驾驶员,缩回。", HatchClose); dic.Add("驾驶员,关闭舱门。", HatchClose); keyword = new KeywordRecognizer(dic.Keys.ToArray()); ((PhraseRecognizer)keyword).OnPhraseRecognized += new PhraseRecognizedDelegate(Keyword_OnPhraseRecognized); ((PhraseRecognizer)keyword).Start(); } private void Keyword_OnPhraseRecognized(PhraseRecognizedEventArgs args) { Debug.Log((object)args.text); dic[args.text](); } public void CrewOn() { hasCrew = true; } public void CrewOff() { hasCrew = false; } public void EngineOn() { if (hasCrew) { EngineSwitch.m_isLargeAperture = false; } } public void EngineOff() { if (hasCrew) { EngineSwitch.m_isLargeAperture = true; } } public void MoveFore() { moveForward = true; moveRearward = false; } public void MoveRear() { moveForward = false; moveRearward = true; } public void TurnLeft() { turnLeft = true; turnRight = false; } public void TurnRight() { turnLeft = false; turnRight = true; } public void MoveFore2() { if (hasCrew) { Gear.m_isLargeAperture = true; fore = true; } } public void TurnLeft2() { if (hasCrew) { Gear.m_isLargeAperture = true; l = true; } } public void TurnRight2() { if (hasCrew) { Gear.m_isLargeAperture = true; r = true; } } public void GoStraight() { turnLeft = false; turnRight = false; } public void HoldStop() { moveForward = false; moveRearward = false; turnLeft = false; turnRight = false; } public void HatchOpen() { if (hasCrew) { DriverHatch.m_isLargeAperture = true; } } public void HatchClose() { if (hasCrew) { DriverHatch.m_isLargeAperture = false; } } public void LightOn() { if (hasCrew) { Light.m_isLargeAperture = false; } } public void LightOff() { if (hasCrew) { Light.m_isLargeAperture = true; } } private void Update() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_016d: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_040f: 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_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0488: 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_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) if (hasCrew) { if (fore) { float num = 5f; num -= Time.deltaTime; if (num > 0f) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); fore = false; } } if (l) { float num2 = 5f; num2 -= Time.deltaTime; if (num2 > 0f) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); l = false; } } if (r) { float num3 = 5f; num3 -= Time.deltaTime; if (num3 > 0f) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); } } DriverGeo.SetActive(true); Phys.SetActive(true); if (moveForward) { Gear.m_isLargeAperture = true; if (!turnLeft && !turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); } else if (!turnLeft && turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); } else if (turnLeft && !turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); } } else if (moveRearward) { Gear.m_isLargeAperture = false; if (!turnLeft && !turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); } else if (turnLeft && !turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); } else if (!turnLeft && turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.2f); } } else if (!moveForward && !moveRearward) { Gear.m_isLargeAperture = true; if (!turnLeft && !turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0f); } else if (!turnLeft && turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0f); } else if (turnLeft && !turnRight) { ((Component)GameObject.Find(geol).transform).transform.localPosition = new Vector3(0f, 0f, 0f); ((Component)GameObject.Find(geor).transform).transform.localPosition = new Vector3(0f, 0f, 0.1f); } } } else if (!hasCrew) { DriverGeo.SetActive(false); Phys.SetActive(false); } } private void OnDestroy() { ((PhraseRecognizer)keyword).Stop(); } } public class TankCommanderVoiceControl2 : MonoBehaviour { public SosigLink sosigLink; public GameObject GunnerGeo; public TurretHandCranks THC; public GameObject Phys; public GameObject PhysCannon; private KeywordRecognizer keyword; private Dictionary dic = new Dictionary(); public AR15HandleSightFlipper CannonTrigger; public AR15HandleSightFlipper GunnerHatch; public AR15HandleSightFlipper PKTTrigger; public bool hasCrew = false; public bool moveLeft = false; public bool moveRight = false; public bool moveUp = false; public bool moveDown = false; public bool moveLeft2 = false; public bool moveRight2 = false; public bool moveUp2 = false; public bool moveDown2 = false; public float timer = 0.5f; public GameObject sightX; public GameObject sightY; public float EngageRange = 15f; public float EngageAngle = 45f; public LayerMask LatchingMask; public LayerMask BlockingMask; public Transform FireArm; public float PrecisionAngle = 5f; public AR15HandleSightFlipper IR; public AR15HandleSightFlipper Smoke; private void Start() { //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b18: Expected O, but got Unknown //IL_0b25: Unknown result type (might be due to invalid IL or missing references) //IL_0b2f: Expected O, but got Unknown Phys.SetActive(false); dic.Add("Наводчик, введите.", CrewOn); dic.Add("Наводчик, уходите.", CrewOff); dic.Add("Gunner, on board.", CrewOn); dic.Add("Gunner, get in.", CrewOn); dic.Add("Gunner, off board.", CrewOff); dic.Add("Gunner, bail out.", CrewOff); dic.Add("炮手,上车。", CrewOn); dic.Add("炮手,下车。", CrewOff); dic.Add("炮手,登车。", CrewOn); dic.Add("炮手,弃车。", CrewOff); dic.Add("Наводчик, слева.", TurnLeft2); dic.Add("Наводчик, справа.", TurnRight2); dic.Add("Наводчик, вверх.", MoveUp2); dic.Add("Наводчик, вниз.", MoveDown2); dic.Add("Наводчик, огонь.", FireCannon); dic.Add("Наводчик, пулеметный огонь.", FirePKT); dic.Add("Наводчик, захват цели.", LockTarget); dic.Add("Наводчик, разблокируй.", CancelTarget); dic.Add("Наводчик, выходи.", HatchOpen); dic.Add("Наводчик, садись.", HatchClose); dic.Add("Наводчик, остановись.", HoldStop); dic.Add("Gunner, keep aiming upward.", MoveUp); dic.Add("Gunner, aim upward.", MoveUp); dic.Add("Gunner, upward.", MoveUp2); dic.Add("Gunner, keep aiming downward.", MoveDown); dic.Add("Gunner, aim downward.", MoveDown); dic.Add("Gunner, downward.", MoveDown2); dic.Add("Gunner, keep aiming Left.", TurnRight); dic.Add("Gunner, turn Left.", TurnRight); dic.Add("Gunner, Left.", TurnRight2); dic.Add("Gunner, keep aiming Right.", TurnLeft); dic.Add("Gunner, turn Right ward.", TurnLeft); dic.Add("Gunner, Right.", TurnLeft2); dic.Add("Gunner, fire.", FireCannon); dic.Add("Gunner, open fire.", FireCannon); dic.Add("Gunner, fire main gun.", FireCannon); dic.Add("Gunner, PKT fire.", FirePKT); dic.Add("Gunner, PKT open fire.", FirePKT); dic.Add("Gunner, fire PKT.", FirePKT); dic.Add("Gunner, stop.", HoldStop); dic.Add("Gunner, hold position.", HoldStop); dic.Add("Gunner, search target.", SeekTarget); dic.Add("Gunner, look for target.", SeekTarget); dic.Add("Gunner, lock on.", LockTarget); dic.Add("Gunner, lock target.", LockTarget); dic.Add("Gunner, lock.", LockTarget); dic.Add("Gunner, aim target.", LockTarget); dic.Add("Gunner, aim.", LockTarget); dic.Add("Gunner, cancel target.", CancelTarget); dic.Add("Gunner, cancel locking.", CancelTarget); dic.Add("Gunner, cancel aiming.", CancelTarget); dic.Add("Gunner, cancel.", CancelTarget); dic.Add("炮手,向上瞄准。", MoveUp); dic.Add("炮手,往上瞄准。", MoveUp); dic.Add("炮手,向上。", MoveUp2); dic.Add("炮手,向下瞄准。", MoveDown); dic.Add("炮手,往下瞄准。", MoveDown); dic.Add("炮手,向下。", MoveDown2); dic.Add("炮手,向左瞄准。", TurnLeft); dic.Add("炮手,往左瞄准。", TurnLeft); dic.Add("炮手,向左。", TurnLeft2); dic.Add("炮手,向右瞄准。", TurnRight); dic.Add("炮手,往右瞄准。", TurnRight); dic.Add("炮手,向右。", TurnRight2); dic.Add("炮手,开火。", FireCannon); dic.Add("炮手,发射。", FireCannon); dic.Add("炮手,主炮开火。", FireCannon); dic.Add("炮手,机枪开火。", FirePKT); dic.Add("炮手,机枪发射。", FirePKT); dic.Add("炮手,机枪。", FirePKT); dic.Add("炮手,停下。", HoldStop); dic.Add("炮手,保持位置。", HoldStop); dic.Add("炮手,瞄准目标。", LockTarget); dic.Add("炮手,锁定目标。", LockTarget); dic.Add("炮手,瞄准。", LockTarget); dic.Add("炮手,锁定。", LockTarget); dic.Add("炮手,给我瞅紧了对面那个逼。", LockTarget); dic.Add("炮手,取消目标。", CancelTarget); dic.Add("炮手,放弃目标。", CancelTarget); dic.Add("炮手,取消瞄准。", CancelTarget); dic.Add("炮手,取消。", CancelTarget); dic.Add("Gunner, turn out.", HatchOpen); dic.Add("Gunner, open the hatch.", HatchOpen); dic.Add("Gunner, turn in.", HatchClose); dic.Add("Gunner, close the hatch.", HatchClose); dic.Add("Наводчик,высунуться.", HatchOpen); dic.Add("Наводчик,открытый люк.", HatchOpen); dic.Add("Наводчик,сжиматься назад.", HatchClose); dic.Add("Наводчик,закрыть люк.", HatchClose); dic.Add("炮手,探出。", HatchOpen); dic.Add("炮手,打开舱门。", HatchOpen); dic.Add("炮手,缩回。", HatchClose); dic.Add("炮手,关闭舱门。", HatchClose); dic.Add("Gunner, turn on IR light.", IROn); dic.Add("Gunner, turn off IR light.", IROff); dic.Add("Gunner, deploy smoke.", FireSmoke); dic.Add("炮手,开启红外大灯。", IROn); dic.Add("炮手,关闭红外大灯。", IROff); dic.Add("Наводчик, Включи свет.", IROn); dic.Add("Наводчик, Выключите свет.", IROff); keyword = new KeywordRecognizer(dic.Keys.ToArray()); ((PhraseRecognizer)keyword).OnPhraseRecognized += new PhraseRecognizedDelegate(Keyword_OnPhraseRecognized); ((PhraseRecognizer)keyword).Start(); } private void Keyword_OnPhraseRecognized(PhraseRecognizedEventArgs args) { Debug.Log((object)args.text); dic[args.text](); } public void CrewOn() { hasCrew = true; } public void CrewOff() { hasCrew = false; } public void MoveUp() { moveUp = true; moveDown = false; } public void MoveDown() { moveUp = false; moveDown = true; } public void TurnLeft() { moveLeft = true; moveRight = false; } public void TurnRight() { moveLeft = false; moveRight = true; } public void MoveUp2() { if (hasCrew && (Object)(object)THC.vWheel != (Object)null) { moveUp2 = true; } } public void MoveDown2() { if (hasCrew && (Object)(object)THC.vWheel != (Object)null) { moveDown2 = true; } } public void TurnLeft2() { if (hasCrew && (Object)(object)THC.hWheel != (Object)null) { moveLeft2 = true; } } public void TurnRight2() { if (hasCrew && (Object)(object)THC.hWheel != (Object)null) { moveRight2 = true; } } public void FireCannon() { if (hasCrew) { CannonTrigger.m_isLargeAperture = !CannonTrigger.m_isLargeAperture; } } public void FireSmoke() { if (hasCrew) { Smoke.m_isLargeAperture = !Smoke.m_isLargeAperture; } } public void FirePKT() { if (hasCrew) { PKTTrigger.m_isLargeAperture = !PKTTrigger.m_isLargeAperture; } } public void HoldStop() { moveUp = false; moveDown = false; moveLeft = false; moveRight = false; } public void HatchOpen() { if (hasCrew) { GunnerHatch.m_isLargeAperture = true; } } public void HatchClose() { if (hasCrew) { GunnerHatch.m_isLargeAperture = false; } } public void SeekTarget() { if (hasCrew) { sosigLink = SearchTarget(); } } public void LockTarget() { if (hasCrew) { sosigLink = FindTarget(); } } public void CancelTarget() { if (hasCrew) { sosigLink = null; } } public void IROn() { if (hasCrew) { IR.m_isLargeAperture = false; } } public void IROff() { if (hasCrew) { IR.m_isLargeAperture = true; } } private void Update() { //IL_002d: 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_00a2: 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_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_00e7: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_051c: 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_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sosigLink == (Object)null) { sightX.transform.localEulerAngles = new Vector3(0f, 0f, 0f); sightY.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (hasCrew) { GunnerGeo.SetActive(true); if ((Object)(object)sosigLink != (Object)null) { XAxisLookAt(sightX.transform, ((Component)sosigLink).gameObject.transform.position, Vector3.forward); YAxisLookAt(sightY.transform, ((Component)sosigLink).gameObject.transform.position, Vector3.forward); if (sightY.transform.localEulerAngles.y > 0f && sightY.transform.localEulerAngles.y < 180f) { if ((Object)(object)THC.hWheel != (Object)null) { THC.hWheel.AddRelativeTorque(new Vector3(-200f, 0f, 0f), (ForceMode)0); } } else if (sightY.transform.localEulerAngles.y < 360f && sightY.transform.localEulerAngles.y > 180f && (Object)(object)THC.hWheel != (Object)null) { THC.hWheel.AddRelativeTorque(new Vector3(200f, 0f, 0f), (ForceMode)0); } if (sightX.transform.localEulerAngles.x > 0f && sightX.transform.localEulerAngles.x < 180f) { if ((Object)(object)THC.vWheel != (Object)null) { THC.vWheel.AddRelativeTorque(new Vector3(200f, 0f, 0f), (ForceMode)0); } } else if (sightX.transform.localEulerAngles.x > 180f && sightX.transform.localEulerAngles.x < 360f && (Object)(object)THC.vWheel != (Object)null) { THC.vWheel.AddRelativeTorque(new Vector3(-200f, 0f, 0f), (ForceMode)0); } } if (moveUp2) { timer -= Time.deltaTime; if (timer >= 0f) { if ((Object)(object)THC.vWheel != (Object)null) { THC.vWheel.AddRelativeTorque(new Vector3(-300f, 0f, 0f), (ForceMode)0); } } else if (timer < 0f) { moveUp2 = false; timer = 0.5f; } } if (moveDown2) { timer -= Time.deltaTime; if (timer >= 0f) { if ((Object)(object)THC.vWheel != (Object)null) { THC.vWheel.AddRelativeTorque(new Vector3(300f, 0f, 0f), (ForceMode)0); } } else if (timer < 0f) { moveDown2 = false; timer = 0.5f; } } if (moveLeft2) { timer -= Time.deltaTime; if (timer >= 0f) { if ((Object)(object)THC.hWheel != (Object)null) { THC.hWheel.AddRelativeTorque(new Vector3(-300f, 0f, 0f), (ForceMode)0); } } else if (timer < 0f) { moveLeft2 = false; timer = 0.5f; } } if (moveRight2) { timer -= Time.deltaTime; if (timer >= 0f) { if ((Object)(object)THC.hWheel != (Object)null) { THC.hWheel.AddRelativeTorque(new Vector3(300f, 0f, 0f), (ForceMode)0); } } else if (timer < 0f) { moveRight2 = false; timer = 0.5f; } } Phys.SetActive(true); PhysCannon.SetActive(true); if (moveUp) { if ((Object)(object)THC.vWheel != (Object)null) { THC.vWheel.AddRelativeTorque(new Vector3(-500f, 0f, 0f), (ForceMode)0); } } else if (moveDown && (Object)(object)THC.vWheel != (Object)null) { THC.vWheel.AddRelativeTorque(new Vector3(500f, 0f, 0f), (ForceMode)0); } if (moveLeft) { if ((Object)(object)THC.hWheel != (Object)null) { THC.hWheel.AddRelativeTorque(new Vector3(-500f, 0f, 0f), (ForceMode)0); } } else if (moveRight) { if ((Object)(object)THC.hWheel != (Object)null) { THC.hWheel.AddRelativeTorque(new Vector3(500f, 0f, 0f), (ForceMode)0); } } else if (!moveUp && !moveDown && !moveLeft && moveRight) { } } else if (!hasCrew) { GunnerGeo.SetActive(false); Phys.SetActive(false); PhysCannon.SetActive(false); } } private SosigLink SearchTarget() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Invalid comparison between Unknown and I4 //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_0155: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)FireArm).transform.position, 500f, LayerMask.op_Implicit(LatchingMask)); List list = new List(); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i].attachedRigidbody != (Object)null && !list.Contains(array[i].attachedRigidbody)) { list.Add(array[i].attachedRigidbody); } } SosigLink result = null; float num = 360f; for (int j = 0; j < list.Count; j++) { SosigLink component = ((Component)list[j]).GetComponent(); if ((Object)(object)component != (Object)null && (int)component.S.BodyState != 3) { Vector3 val = ((Component)list[j]).transform.position - ((Component)FireArm).transform.position; float num2 = Vector3.Angle(val, ((Component)FireArm).transform.forward); Sosig s = component.S; SosigLink val2 = ((!(num2 <= 360f)) ? s.Links[1] : s.Links[0]); if (!Physics.Linecast(((Component)FireArm).transform.position, ((Component)val2).transform.position, LayerMask.op_Implicit(BlockingMask), (QueryTriggerInteraction)1)) { result = val2; num = num2; } } } return result; } private SosigLink FindTarget() { //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_004b: 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_0062: 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_0101: Invalid comparison between Unknown and I4 //IL_0114: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) float num = EngageRange * Mathf.Tan(0.5f * EngageAngle * ((float)Math.PI / 180f)); Collider[] array = Physics.OverlapCapsule(((Component)FireArm).transform.position, ((Component)FireArm).transform.position + ((Component)FireArm).transform.forward * EngageRange, num, LayerMask.op_Implicit(LatchingMask)); List list = new List(); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i].attachedRigidbody != (Object)null && !list.Contains(array[i].attachedRigidbody)) { list.Add(array[i].attachedRigidbody); } } SosigLink result = null; float num2 = EngageAngle; for (int j = 0; j < list.Count; j++) { SosigLink component = ((Component)list[j]).GetComponent(); if ((Object)(object)component != (Object)null && (int)component.S.BodyState != 3) { Vector3 val = ((Component)list[j]).transform.position - ((Component)FireArm).transform.position; float num3 = Vector3.Angle(val, ((Component)FireArm).transform.forward); Sosig s = component.S; SosigLink val2 = ((!(num3 <= PrecisionAngle)) ? s.Links[1] : s.Links[0]); if (num3 < num2 && !Physics.Linecast(((Component)FireArm).transform.position, ((Component)val2).transform.position, LayerMask.op_Implicit(BlockingMask), (QueryTriggerInteraction)1)) { result = val2; num2 = num3; } } } return result; } private void XAxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, 0f, 0f); } private void YAxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(0f, tr_self.localEulerAngles.y, 0f); } private void OnDestroy() { ((PhraseRecognizer)keyword).Stop(); } } public class TankControl : MonoBehaviour { public GameObject switchgear; public DriveShift ds; public VehicleControl veh; public GameObject Lstick; public GameObject Rstick; public string lsb; public string rsb; public string stl; public string str; public float zl; public float zr; public string geol; public string geor; 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_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_01da: 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_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0335: 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_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: 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_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: 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_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) if (switchgear.transform.localEulerAngles.x < 45f) { veh.currentGear = 1; ds.currentNode = 1; } if (switchgear.transform.localEulerAngles.x > 45f) { veh.currentGear = 0; ds.currentNode = -1; } if ((Object)(object)GameObject.Find(stl) != (Object)null) { Lstick = GameObject.Find(stl); Lstick.transform.SetParent(GameObject.Find(lsb).transform); zl = Lstick.transform.localPosition.z; if (zl < 0.01f) { zl = 0.01f; } else if (zl > 0.2f) { zl = 0.2f; } Lstick.transform.localPosition = new Vector3(0f, 0f, zl); GameObject.Find(geol).transform.localPosition = new Vector3(0f, 0f, Lstick.transform.localPosition.z * 5f); } if ((Object)(object)GameObject.Find(str) != (Object)null) { Rstick = GameObject.Find(str); Rstick.transform.SetParent(GameObject.Find(rsb).transform); zr = Rstick.transform.localPosition.z; if (zr < 0.01f) { zr = 0.01f; } else if (zr > 0.2f) { zr = 0.2f; } Rstick.transform.localPosition = new Vector3(0f, 0f, zr); GameObject.Find(geor).transform.localPosition = new Vector3(0f, 0f, Rstick.transform.localPosition.z * 5f); } if (!veh.isOn) { return; } if (((Component)GameObject.Find(geol).transform).transform.localPosition.z >= 0.2f || ((Component)GameObject.Find(geor).transform).transform.localPosition.z >= 0.2f) { veh.accel = (GameObject.Find(geol).transform.localPosition.z + GameObject.Find(geor).transform.localPosition.z) / 2f; veh.brake = false; if (GameObject.Find(geor).transform.localPosition.z - GameObject.Find(geol).transform.localPosition.z > 0.2f || GameObject.Find(geor).transform.localPosition.z - GameObject.Find(geol).transform.localPosition.z < -0.2f) { veh.steer = GameObject.Find(geol).transform.localPosition.z - GameObject.Find(geor).transform.localPosition.z; } else if (GameObject.Find(geor).transform.localPosition.z - GameObject.Find(geol).transform.localPosition.z < 0.2f && GameObject.Find(geor).transform.localPosition.z - GameObject.Find(geol).transform.localPosition.z > -0.2f) { veh.steer = 0f; } } else if (GameObject.Find(geol).transform.localPosition.z < 0.2f && GameObject.Find(geor).transform.localPosition.z < 0.2f && GameObject.Find(geol).transform.localPosition.z > -0.2f && GameObject.Find(geor).transform.localPosition.z > -0.2f) { veh.accel = 0f; veh.brake = true; } } } public class TankTurret : MonoBehaviour { public string cannongeoid; public GameObject gun; private void Start() { } private void Update() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameObject.Find(cannongeoid) != (Object)null) { gun.transform.localEulerAngles = new Vector3(0f, 0f, GameObject.Find(cannongeoid).transform.localEulerAngles.z); } } } public class TurnOnEngine : MonoBehaviour { public VehicleControl car; public GameObject engineswitch; public AudioSource audioon; public AudioSource audiooff; public bool ignited = false; 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (engineswitch.transform.localEulerAngles.x > 45f) { if (!ignited) { audioon.Play(); ignited = true; } } else if (engineswitch.transform.localEulerAngles.x < 45f && ignited) { ignited = false; audiooff.Play(); car.isOn = false; } if (ignited && !audioon.isPlaying) { car.isOn = true; } } } public class TurretHandCranks : MonoBehaviour { public FVRObject shell; public Transform shelleject; public GameObject ejector; public bool ejected = false; public Rigidbody bh; public Rigidbody bv; public string whid; public string wvid; public string hMountid; public string vMountid; public GameObject hch; public GameObject hcv; public HingeJoint hh; public HingeJoint hv; public FVRFireArmChamber chamber; public Rigidbody hWheel; public Rigidbody vWheel; public GameObject hMount; public GameObject vMount; public float speedV = 10f; public float speedH = 10f; public GameObject audioh; public GameObject audiov; public Vector3 v_localAngleVelo; public Vector3 h_localAngleVelo; public JointSpring jsX; public JointSpring jsY; private void Awake() { jsX.spring = 10f; jsX.damper = 10f; jsY.spring = 10f; jsY.damper = 10f; } private void Update() { //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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0247: 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_02c4: 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_0300: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: 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_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0360: 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_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) hMount = GameObject.Find(hMountid); vMount = GameObject.Find(vMountid); hch = GameObject.Find(whid); hch.transform.SetParent(((Component)bh).transform); float num = hch.transform.localEulerAngles.x; if (num > 30f && num < 180f) { num = 29.9f; } else if (num > 180f && num < 330f) { num = 330.1f; } hch.transform.localEulerAngles = new Vector3(num, 0f, 0f); hcv = GameObject.Find(wvid); hcv.transform.SetParent(((Component)bv).transform); float num2 = hcv.transform.localEulerAngles.x; if (num2 > 30f && num2 < 180f) { num2 = 29.9f; } else if (num2 > 180f && num2 < 330f) { num2 = 330.1f; } hcv.transform.localEulerAngles = new Vector3(num2, 0f, 0f); hWheel = hch.GetComponent(); h_localAngleVelo = ((Component)hWheel).transform.InverseTransformVector(hWheel.angularVelocity); vWheel = hcv.GetComponent(); v_localAngleVelo = ((Component)vWheel).transform.InverseTransformVector(vWheel.angularVelocity); if ((Object)(object)hh == (Object)null) { hh = hch.AddComponent(); ((Joint)hh).connectedBody = bh; ((Joint)hh).autoConfigureConnectedAnchor = false; ((Joint)hh).connectedAnchor = new Vector3(0f, 0f, 0f); ((Joint)hh).anchor = new Vector3(0f, 0f, 0f); hh.useSpring = true; hh.spring = jsX; } if ((Object)(object)hv == (Object)null) { hv = hcv.AddComponent(); ((Joint)hv).connectedBody = bv; ((Joint)hv).autoConfigureConnectedAnchor = false; ((Joint)hv).connectedAnchor = new Vector3(0f, 0f, 0f); ((Joint)hv).anchor = new Vector3(0f, 0f, 0f); hv.useSpring = true; hv.spring = jsY; } if (!ejected && ejector.transform.localEulerAngles.z > 44f) { GameObject val = Object.Instantiate(((AnvilAsset)shell).GetGameObject(), ((Component)shelleject).transform.position, ((Component)shelleject).transform.rotation); Rigidbody component = val.GetComponent(); component.AddRelativeForce(new Vector3(0f, 0f, 10f), (ForceMode)2); ejected = true; } if (ejector.transform.localEulerAngles.z < 35f) { ejected = false; } if (!chamber.IsFull) { if (vMount.transform.localEulerAngles.z > 8.1f) { vMount.transform.localEulerAngles = new Vector3(0f, 0f, vMount.transform.localEulerAngles.z - 10f * Time.deltaTime); } else if (vMount.transform.localEulerAngles.z < 7.9f) { vMount.transform.localEulerAngles = new Vector3(0f, 0f, vMount.transform.localEulerAngles.z + 10f * Time.deltaTime); } } else if (chamber.IsFull) { if (v_localAngleVelo.x >= 0.01f || v_localAngleVelo.x <= -0.01f) { audiov.SetActive(true); if (vMount.transform.localEulerAngles.z > 15f) { vMount.transform.localEulerAngles = new Vector3(0f, 0f, 15f); vMount.transform.Rotate(0f * Time.deltaTime, 0f, 0f); } if (vMount.transform.localEulerAngles.z < 0.5f) { vMount.transform.localEulerAngles = new Vector3(0f, 0f, 0.5f); vMount.transform.Rotate(0f * Time.deltaTime, 0f, 0f); } else { vMount.transform.Rotate(new Vector3(0f, 0f, v_localAngleVelo.x * (0f - speedV) * Time.deltaTime)); } } else if (v_localAngleVelo.x < 0.01f && v_localAngleVelo.x > -0.01f) { audiov.SetActive(false); } } if (h_localAngleVelo.x >= 0.01f || h_localAngleVelo.x <= -0.01f) { audioh.SetActive(true); hMount.transform.Rotate(new Vector3(0f, h_localAngleVelo.x * speedH * -2f * Time.deltaTime, 0f)); } else if (h_localAngleVelo.x < 0.01f && h_localAngleVelo.x > -0.01f) { audioh.SetActive(false); } } } public class UnFrezeeRig : MonoBehaviour { public Rigidbody rig; private void Start() { } private void Update() { rig.isKinematic = false; } } public class OldAssCarStartUp : MonoBehaviour { public Rigidbody handleLever; public VehicleControl vehicle; public GameObject startblock; public float speed = 0.001f; public GameObject ignitebutton; public AudioSource startaudio; public float pitchspeed = 0.01f; private void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) startblock.transform.localEulerAngles = new Vector3(0f, 0f, 0f); ignitebutton.SetActive(false); startaudio.pitch = 0f; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_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_0152: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) if (startblock.transform.localEulerAngles.x < 90f && !vehicle.isOn && handleLever.angularVelocity.y > 1f) { startaudio.Play(); startaudio.pitch = startblock.transform.localEulerAngles.x * pitchspeed; startblock.transform.Rotate(new Vector3(handleLever.angularVelocity.y * speed * Time.deltaTime, 0f, 0f)); } if (startblock.transform.localEulerAngles.x >= 90f) { startaudio.Stop(); startaudio.pitch = 0f; vehicle.TurnOnEngine(forcibly: true); } if (vehicle.isOn) { ignitebutton.SetActive(true); startblock.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } if (!vehicle.isOn) { ignitebutton.SetActive(false); } } } public class DriveShiftGrab : MonoBehaviour { public VehicleControl VC; public FVRInteractiveObject grabobj; public GameObject DRGeo; public GameObject HBGeo; public DriveShift DR; public GameObject HandRef; public FVRInteractiveObject grabobjHB; public GameObject HandRefHB; public ParkingBrakeClick HB; public GameObject click; public GameObject down; public GameObject gear1; public GameObject gear2; public GameObject gear3; public GameObject gear4; public GameObject gear5; public GameObject gear6; [Header("H档位限制设置")] public float minX = 0f; public float maxX = 2f; public float minZ = 0f; public float maxZ = 1f; private Vector3[] gearPositions = (Vector3[])(object)new Vector3[6] { new Vector3(0f, 0f, 0f), new Vector3(1f, 0f, 0f), new Vector3(2f, 0f, 0f), new Vector3(0f, 0f, 1f), new Vector3(1f, 0f, 1f), new Vector3(2f, 0f, 1f) }; private Vector3[] validPathways = (Vector3[])(object)new Vector3[12] { new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 1f), new Vector3(1f, 0f, 0f), new Vector3(1f, 0f, 1f), new Vector3(2f, 0f, 0f), new Vector3(2f, 0f, 1f), new Vector3(0f, 0f, 0f), new Vector3(1f, 0f, 0f), new Vector3(2f, 0f, 0f), new Vector3(0f, 0f, 1f), new Vector3(1f, 0f, 1f), new Vector3(2f, 0f, 1f) }; private Vector3 currentPosition; private Vector3 targetPosition; private bool isInGear = true; private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0d59: Unknown result type (might be due to invalid IL or missing references) //IL_0d5e: Unknown result type (might be due to invalid IL or missing references) //IL_0b64: Unknown result type (might be due to invalid IL or missing references) //IL_0b69: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_012f: 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_0f3f: Unknown result type (might be due to invalid IL or missing references) //IL_0f44: Unknown result type (might be due to invalid IL or missing references) //IL_0d82: Unknown result type (might be due to invalid IL or missing references) //IL_0d87: Unknown result type (might be due to invalid IL or missing references) //IL_0bc1: Unknown result type (might be due to invalid IL or missing references) //IL_0bc6: Unknown result type (might be due to invalid IL or missing references) //IL_0b9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ba2: Unknown result type (might be due to invalid IL or missing references) //IL_0bab: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_112c: Unknown result type (might be due to invalid IL or missing references) //IL_1131: Unknown result type (might be due to invalid IL or missing references) //IL_1152: Unknown result type (might be due to invalid IL or missing references) //IL_1157: Unknown result type (might be due to invalid IL or missing references) //IL_0f68: Unknown result type (might be due to invalid IL or missing references) //IL_0f6d: Unknown result type (might be due to invalid IL or missing references) //IL_0e0c: Unknown result type (might be due to invalid IL or missing references) //IL_0e11: Unknown result type (might be due to invalid IL or missing references) //IL_0c41: Unknown result type (might be due to invalid IL or missing references) //IL_0c46: Unknown result type (might be due to invalid IL or missing references) //IL_0be4: Unknown result type (might be due to invalid IL or missing references) //IL_0be9: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_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_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0ff2: Unknown result type (might be due to invalid IL or missing references) //IL_0ff7: Unknown result type (might be due to invalid IL or missing references) //IL_0eb4: Unknown result type (might be due to invalid IL or missing references) //IL_0eb9: Unknown result type (might be due to invalid IL or missing references) //IL_0e2f: Unknown result type (might be due to invalid IL or missing references) //IL_0e34: Unknown result type (might be due to invalid IL or missing references) //IL_0c9e: Unknown result type (might be due to invalid IL or missing references) //IL_0ca3: Unknown result type (might be due to invalid IL or missing references) //IL_0c7a: Unknown result type (might be due to invalid IL or missing references) //IL_0c7f: Unknown result type (might be due to invalid IL or missing references) //IL_0c88: Unknown result type (might be due to invalid IL or missing references) //IL_0c1d: Unknown result type (might be due to invalid IL or missing references) //IL_0c22: Unknown result type (might be due to invalid IL or missing references) //IL_0c2b: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_119c: Unknown result type (might be due to invalid IL or missing references) //IL_11a1: Unknown result type (might be due to invalid IL or missing references) //IL_109a: Unknown result type (might be due to invalid IL or missing references) //IL_109f: Unknown result type (might be due to invalid IL or missing references) //IL_1015: Unknown result type (might be due to invalid IL or missing references) //IL_101a: Unknown result type (might be due to invalid IL or missing references) //IL_0cfb: Unknown result type (might be due to invalid IL or missing references) //IL_0d00: Unknown result type (might be due to invalid IL or missing references) //IL_0ccd: Unknown result type (might be due to invalid IL or missing references) //IL_0cd2: Unknown result type (might be due to invalid IL or missing references) //IL_0ce5: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0d2a: Unknown result type (might be due to invalid IL or missing references) //IL_0d2f: Unknown result type (might be due to invalid IL or missing references) //IL_0d42: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0803: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_1209: Unknown result type (might be due to invalid IL or missing references) //IL_120e: Unknown result type (might be due to invalid IL or missing references) //IL_11f3: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_0868: Unknown result type (might be due to invalid IL or missing references) //IL_086d: 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_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0a49: Unknown result type (might be due to invalid IL or missing references) //IL_0a4e: Unknown result type (might be due to invalid IL or missing references) //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_0891: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: 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_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_0a6c: Unknown result type (might be due to invalid IL or missing references) //IL_0a71: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08ee: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0441: 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_039c: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036e: 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_0a90: Unknown result type (might be due to invalid IL or missing references) //IL_0a95: Unknown result type (might be due to invalid IL or missing references) //IL_09eb: Unknown result type (might be due to invalid IL or missing references) //IL_09f0: Unknown result type (might be due to invalid IL or missing references) //IL_09c7: Unknown result type (might be due to invalid IL or missing references) //IL_09cc: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_0922: Unknown result type (might be due to invalid IL or missing references) //IL_0927: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_046b: 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_0483: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_0aed: Unknown result type (might be due to invalid IL or missing references) //IL_0af2: Unknown result type (might be due to invalid IL or missing references) //IL_0ac9: Unknown result type (might be due to invalid IL or missing references) //IL_0ace: Unknown result type (might be due to invalid IL or missing references) //IL_0ad7: Unknown result type (might be due to invalid IL or missing references) //IL_0a24: Unknown result type (might be due to invalid IL or missing references) //IL_0a29: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_0b26: Unknown result type (might be due to invalid IL or missing references) //IL_0b2b: Unknown result type (might be due to invalid IL or missing references) //IL_0b34: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_0789: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Unknown result type (might be due to invalid IL or missing references) //IL_07ce: Unknown result type (might be due to invalid IL or missing references) //IL_07d3: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) HandRef.transform.localPosition = new Vector3(Mathf.Clamp(HandRef.transform.localPosition.x, 0f, 2f), 0f, Mathf.Clamp(HandRef.transform.localPosition.z, 0f, 1f)); HandRefHB.transform.localPosition = new Vector3(0f, Mathf.Clamp(HandRefHB.transform.localPosition.y, 0f, 1f), 0f); if (grabobj.m_isHeld) { if (grabobj.m_hand.Input.TriggerFloat > 0.75f) { HandRef.transform.position = Vector3.Lerp(HandRef.transform.position, ((Component)grabobj.m_hand).gameObject.transform.position, 0.1f); if (HandRef.transform.localPosition.x > 2f) { HandRef.transform.localPosition = new Vector3(2f, 0f, HandRef.transform.localPosition.z); } else if (HandRef.transform.localPosition.x < 0f) { HandRef.transform.localPosition = new Vector3(0f, 0f, HandRef.transform.localPosition.z); } if (HandRef.transform.localPosition.z > 1f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 1f); } else if (HandRef.transform.localPosition.z < 0f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0f); } if (HandRef.transform.localPosition.z <= 0.6f && HandRef.transform.localPosition.z >= 0.4f) { if (HandRef.transform.localPosition.x >= 0f && HandRef.transform.localPosition.x <= 0.1f) { if (HandRef.transform.localPosition.z < 0f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0f); } if (HandRef.transform.localPosition.z > 1f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 1f); } } if (HandRef.transform.localPosition.x > 0.1f && HandRef.transform.localPosition.x < 0.9f) { if (HandRef.transform.localPosition.z < 0.4f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0.4f); } if (HandRef.transform.localPosition.z > 0.6f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0.6f); } } if (HandRef.transform.localPosition.x >= 0.9f && HandRef.transform.localPosition.x <= 1.1f) { if (HandRef.transform.localPosition.z < 0f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0f); } if (HandRef.transform.localPosition.z > 1f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 1f); } } if (HandRef.transform.localPosition.x > 1.1f && HandRef.transform.localPosition.x < 1.9f) { if (HandRef.transform.localPosition.z < 0.4f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0.4f); } if (HandRef.transform.localPosition.z > 0.6f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0.6f); } } if (HandRef.transform.localPosition.x >= 1.9f && HandRef.transform.localPosition.x <= 2f) { if (HandRef.transform.localPosition.z < 0f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0f); } if (HandRef.transform.localPosition.z > 1f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 1f); } } } if (HandRef.transform.localPosition.z > 0.6f || HandRef.transform.localPosition.z < 0.4f) { if (HandRef.transform.localPosition.x >= 0f && HandRef.transform.localPosition.x <= 0.5f) { if (HandRef.transform.localPosition.x < 0f) { HandRef.transform.localPosition = new Vector3(0f, 0f, HandRef.transform.localPosition.z); } if (HandRef.transform.localPosition.x > 0.1f) { HandRef.transform.localPosition = new Vector3(0.1f, 0f, HandRef.transform.localPosition.z); } } if (HandRef.transform.localPosition.x > 0.5f && HandRef.transform.localPosition.x < 1.5f) { if (HandRef.transform.localPosition.x < 0.9f) { HandRef.transform.localPosition = new Vector3(0.9f, 0f, HandRef.transform.localPosition.z); } if (HandRef.transform.localPosition.x > 1.1f) { HandRef.transform.localPosition = new Vector3(1.1f, 0f, HandRef.transform.localPosition.z); } } if (HandRef.transform.localPosition.x >= 1.5f && HandRef.transform.localPosition.x <= 2f) { if (HandRef.transform.localPosition.x < 1.9f) { HandRef.transform.localPosition = new Vector3(1.9f, 0f, HandRef.transform.localPosition.z); } if (HandRef.transform.localPosition.x > 2f) { HandRef.transform.localPosition = new Vector3(2f, 0f, HandRef.transform.localPosition.z); } } } } } else if (!grabobj.m_isHeld) { if (HandRef.transform.localPosition.x >= 1.5f) { HandRef.transform.localPosition = new Vector3(2f, 0f, HandRef.transform.localPosition.z); } if (HandRef.transform.localPosition.x > 0.5f && HandRef.transform.localPosition.x < 1.5f) { HandRef.transform.localPosition = new Vector3(1f, 0f, HandRef.transform.localPosition.z); } if (HandRef.transform.localPosition.x <= 0.5f) { HandRef.transform.localPosition = new Vector3(0f, 0f, HandRef.transform.localPosition.z); } if (HandRef.transform.localPosition.z >= 0.5f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 1f); } if (HandRef.transform.localPosition.z < 0.5f) { HandRef.transform.localPosition = new Vector3(HandRef.transform.localPosition.x, 0f, 0f); } } if ((double)HandRef.transform.localPosition.z > 0.75) { if ((double)HandRef.transform.localPosition.x > 1.75) { DR.currentNode = 5; VC.currentGear = 5; gear1.SetActive(false); gear2.SetActive(false); gear3.SetActive(false); gear4.SetActive(false); gear5.SetActive(true); gear6.SetActive(false); } if (HandRef.transform.localPosition.x > 0.75f && HandRef.transform.localPosition.x < 1.25f) { DR.currentNode = 3; VC.currentGear = 3; gear1.SetActive(false); gear2.SetActive(false); gear3.SetActive(true); gear4.SetActive(false); gear5.SetActive(false); gear6.SetActive(false); } if (HandRef.transform.localPosition.x <= 0.25f) { DR.currentNode = 1; VC.currentGear = 1; gear1.SetActive(true); gear2.SetActive(false); gear3.SetActive(false); gear4.SetActive(false); gear5.SetActive(false); gear6.SetActive(false); } } else if ((double)HandRef.transform.localPosition.z < 0.25) { if ((double)HandRef.transform.localPosition.x > 1.75) { DR.currentNode = 0; VC.currentGear = 0; gear1.SetActive(false); gear2.SetActive(false); gear3.SetActive(false); gear4.SetActive(false); gear5.SetActive(false); gear6.SetActive(true); } if (HandRef.transform.localPosition.x > 0.75f && HandRef.transform.localPosition.x < 1.25f) { DR.currentNode = 4; VC.currentGear = 4; gear1.SetActive(false); gear2.SetActive(false); gear3.SetActive(false); gear4.SetActive(true); gear5.SetActive(false); gear6.SetActive(false); } if (HandRef.transform.localPosition.x <= 0.25f) { DR.currentNode = 2; VC.currentGear = 2; gear1.SetActive(false); gear2.SetActive(true); gear3.SetActive(false); gear4.SetActive(false); gear5.SetActive(false); gear6.SetActive(false); } } AxisLookAt(DRGeo.transform, HandRef.transform.position, Vector3.forward); AxisLookAtY(HBGeo.transform, HandRefHB.transform.position, Vector3.forward); if (grabobjHB.m_isHeld) { if (grabobjHB.m_hand.Input.TriggerFloat > 0.75f || HandRefHB.transform.localPosition.y < 0.25f) { HB.isOn = false; } if (!HB.isOn) { HandRefHB.transform.position = ((Component)grabobjHB.m_hand).gameObject.transform.position; } if (HandRefHB.transform.localPosition.y > 0.75f && grabobjHB.m_hand.Input.TriggerFloat <= 0.75f) { HB.isOn = true; } } if (HB.isOn) { VC.brake = true; down.SetActive(false); click.SetActive(true); } else if (!HB.isOn) { down.SetActive(true); click.SetActive(false); } } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } private void AxisLookAtY(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, 0f, 0f); } private void EnforceHLimits() { //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_0053: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 val = currentPosition; val.x = Mathf.Clamp(val.x, minX, maxX); val.z = Mathf.Clamp(val.z, minZ, maxZ); val.y = 0f; if (!IsOnValidHPath(val)) { val = FindNearestValidPosition(val); } HandRef.transform.localPosition = val; currentPosition = val; } private bool IsOnValidHPath(Vector3 position) { if ((position.x >= 0f && position.x <= 0.1f) || (position.x >= 0.9f && position.x <= 1.1f) || (position.x >= 1.9f && position.x <= 2f)) { return position.z >= minZ && position.z <= maxZ; } if (position.z <= 0.6f && position.z >= 0.4f) { return position.x >= minX && position.x <= maxX; } return false; } private Vector3 FindNearestValidPosition(Vector3 invalidPosition) { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_005a: 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_0079: Unknown result type (might be due to invalid IL or missing references) Vector3 result = invalidPosition; float num = float.MaxValue; for (int i = 0; i < validPathways.Length; i += 2) { Vector3 lineStart = validPathways[i]; Vector3 lineEnd = validPathways[i + 1]; Vector3 nearestPointOnLine = GetNearestPointOnLine(lineStart, lineEnd, invalidPosition); float num2 = Vector3.Distance(invalidPosition, nearestPointOnLine); if (num2 < num) { num = num2; result = nearestPointOnLine; } } return result; } private Vector3 GetNearestPointOnLine(Vector3 lineStart, Vector3 lineEnd, Vector3 point) { //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) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lineEnd - lineStart; Vector3 normalized = ((Vector3)(ref val)).normalized; float num = Vector3.Distance(lineStart, lineEnd); Vector3 val2 = point - lineStart; float num2 = Vector3.Dot(val2, normalized); num2 = Mathf.Clamp(num2, 0f, num); return lineStart + normalized * num2; } public int GetCurrentGear() { //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) for (int i = 0; i < gearPositions.Length; i++) { if (Vector3.Distance(((Component)this).transform.localPosition, gearPositions[i]) < 0.1f) { return i + 1; } } return 0; } public void SnapToNearestGear() { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) Vector3 localPosition = ((Component)this).transform.localPosition; Vector3 val = gearPositions[0]; float num = Vector3.Distance(localPosition, val); for (int i = 1; i < gearPositions.Length; i++) { float num2 = Vector3.Distance(localPosition, gearPositions[i]); if (num2 < num) { num = num2; val = gearPositions[i]; } } ((Component)this).transform.localPosition = val; } public bool CanMoveTo(Vector3 targetPos) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) targetPos.y = 0f; targetPos.x = Mathf.Clamp(targetPos.x, minX, maxX); targetPos.z = Mathf.Clamp(targetPos.z, minZ, maxZ); return IsOnValidHPath(targetPos); } private void OnDrawGizmosSelected() { //IL_0001: 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_002f: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00b9: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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) Gizmos.color = Color.blue; DrawLineInLocalSpace(new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 1f)); DrawLineInLocalSpace(new Vector3(1f, 0f, 0f), new Vector3(1f, 0f, 1f)); DrawLineInLocalSpace(new Vector3(2f, 0f, 0f), new Vector3(2f, 0f, 1f)); DrawLineInLocalSpace(new Vector3(0f, 0f, 0f), new Vector3(2f, 0f, 0f)); DrawLineInLocalSpace(new Vector3(0f, 0f, 1f), new Vector3(2f, 0f, 1f)); Gizmos.color = Color.green; Vector3[] array = gearPositions; foreach (Vector3 val in array) { Gizmos.DrawSphere(((Component)this).transform.TransformPoint(val), 0.05f); } } private void DrawLineInLocalSpace(Vector3 start, Vector3 end) { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Gizmos.DrawLine(((Component)this).transform.TransformPoint(start), ((Component)this).transform.TransformPoint(end)); } } public class ParentPlayer : MonoBehaviour { [NonSerialized] public GameObject player; private void Start() { } private void Update() { //IL_0046: 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_0091: 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) if ((Object)(object)player == (Object)null) { } player = ((Component)GM.CurrentPlayerBody.Head).gameObject; if ((Object)(object)player != (Object)null) { if (Vector3.Distance(player.transform.position, ((Component)this).transform.position) <= 2f) { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent(((Component)this).gameObject.transform); } if (Vector3.Distance(player.transform.position, ((Component)this).transform.position) > 2f) { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); } } } private void OnDestroy() { if ((Object)(object)player != (Object)null) { ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); } } } public class Slotarea : MonoBehaviour { public GameObject parent; private void OnTriggerStay(Collider other) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)other).gameObject; FVRPhysicalObject component = gameObject.GetComponent(); if (!((Object)(object)component != (Object)null) || !((Object)(object)gameObject != (Object)(object)parent) || (int)component.QBSlotType != 0 || ((FVRInteractiveObject)component).m_isHeld || !((Object)(object)component.m_quickbeltSlot == (Object)null)) { return; } float num = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.LeftHand).transform.position); float num2 = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.RightHand).transform.position); if (num < 0.25f || num2 < 0.25f) { Rigidbody component2 = gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { gameObject.transform.SetParent(parent.transform); component2.useGravity = false; component2.isKinematic = true; } } } private void OnTriggerExit(Collider other) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)other).gameObject; FVRPhysicalObject component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)gameObject != (Object)(object)parent && (int)component.QBSlotType == 0 && ((FVRInteractiveObject)component).m_isHeld && (Object)(object)component.m_quickbeltSlot == (Object)null) { Rigidbody component2 = gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { gameObject.transform.SetParent(parent.transform); component2.useGravity = true; component2.isKinematic = false; } } } } 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 seatanimation : MonoBehaviour { public bool is_seated = false; public GameObject seatbody; public GameObject seatgeo; public GameObject normalbody; private Collider seat; private GameObject sitpos; public GameObject head; public GameObject headrot; public GameObject headGEO; public GameObject lockpos; public GameObject lowerbody; public GameObject helmetreal; public GameObject helmetseat; public GameObject leftfootsit; public GameObject rightfootsit; public GameObject hands; public GameObject handsbase; public GameObject handL; public GameObject handR; public GameObject handLGeo; public GameObject handRGeo; public GameObject handLpos; public GameObject handRpos; public GameObject rootreal; public GameObject rootreallock; public GameObject rootgeo; public GameObject rootgeolock; public GameObject sensor; private void Start() { } private void OnTriggerStay(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = true; seat = other; sitpos = ((Component)seat).gameObject; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void OnTriggerExit(Collider other) { if (((Object)((Component)other).gameObject).name == "VehicleSeat") { is_seated = false; } if (!(((Object)((Component)other).gameObject).name != "VehicleSeat")) { } } private void FixedUpdate() { //IL_003b: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_013b: 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_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: 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_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_02f1: 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_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0462: 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_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: 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_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)sitpos == (Object)null || (Object)(object)seat == (Object)null) { } seatbody.transform.position = head.transform.position; handL.transform.position = handLpos.transform.position; handR.transform.position = handRpos.transform.position; handL.transform.eulerAngles = handLpos.transform.eulerAngles; handR.transform.eulerAngles = handRpos.transform.eulerAngles; handLGeo.transform.position = handL.transform.position; handRGeo.transform.position = handR.transform.position; rootreal.transform.localPosition = rootreallock.transform.localPosition; rootgeo.transform.localPosition = rootgeolock.transform.localPosition; sensor.transform.position = seatbody.transform.position; if (is_seated) { sitpos = ((Component)seat).gameObject; seatgeo.SetActive(true); normalbody.SetActive(false); helmetreal.SetActive(false); helmetseat.SetActive(true); seatbody.transform.parent = sitpos.transform; handL.transform.parent = sitpos.transform; handR.transform.parent = sitpos.transform; hands.transform.parent = sitpos.transform; hands.transform.localPosition = new Vector3(0f, 375f, 0f); float num = Mathf.Clamp(seatbody.transform.localPosition.x, -10f, 10f); float num2 = Mathf.Clamp(seatbody.transform.localPosition.y, 400f, 435f); float num3 = Mathf.Clamp(seatbody.transform.localPosition.z, -75f, -55f); float num4 = Mathf.Clamp(handL.transform.localPosition.x, -50f, 45f); float num5 = Mathf.Clamp(handL.transform.localPosition.y, 300f, 460f); float num6 = Mathf.Clamp(handL.transform.localPosition.z, -80f, 10f); float num7 = Mathf.Clamp(handR.transform.localPosition.x, -45f, 50f); float num8 = Mathf.Clamp(handR.transform.localPosition.y, 300f, 460f); float num9 = Mathf.Clamp(handR.transform.localPosition.z, -80f, 10f); seatbody.transform.localPosition = new Vector3(num, num2, num3); headGEO.transform.eulerAngles = headrot.transform.eulerAngles; lockpos.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, headrot.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); handL.transform.localPosition = new Vector3(num4, num5, num6); handR.transform.localPosition = new Vector3(num7, num8, num9); seatbody.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, sitpos.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); lowerbody.transform.eulerAngles = new Vector3(sitpos.transform.eulerAngles.x, sitpos.transform.eulerAngles.y, sitpos.transform.eulerAngles.z); rightfootsit.transform.position = sitpos.transform.GetChild(1).position; leftfootsit.transform.position = sitpos.transform.GetChild(0).position; } if (!is_seated) { seat = null; sitpos = null; seatgeo.SetActive(false); normalbody.SetActive(true); helmetreal.SetActive(true); helmetseat.SetActive(false); seatbody.transform.parent = head.transform; seatbody.transform.localEulerAngles = new Vector3(0f, 0f, 0f); seatbody.transform.localPosition = new Vector3(0f, 0f, 0f); handL.transform.parent = hands.transform; handR.transform.parent = hands.transform; hands.transform.parent = handsbase.transform; hands.transform.localEulerAngles = new Vector3(0f, 0f, 0f); hands.transform.localPosition = new Vector3(0f, 0f, 0f); } } } public class seatdetect : MonoBehaviour { public AircraftSeat seat; public bool isHead = false; public seatanimation sa = null; public GameObject head = null; private void OnTriggerEnter(Collider other) { if (((Object)((Component)other).gameObject).name == "HeadSensor") { isHead = true; head = ((Component)other).gameObject; sa = head.GetComponent(); } } private void Update() { if (seat.isplayerrotated && isHead && (Object)(object)head != (Object)null && (Object)(object)sa != (Object)null) { sa.is_seated = true; } if (!seat.isplayerrotated) { isHead = false; sa.is_seated = false; head = null; sa = null; } if (!((Object)(object)head == (Object)null) && !((Object)(object)sa == (Object)null)) { } } } public class Slotarea1 : MonoBehaviour { public GameObject parent; private void OnTriggerStay(Collider other) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)other).gameObject; FVRPhysicalObject component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)gameObject != (Object)(object)parent && (int)component.QBSlotType == 0 && !((FVRInteractiveObject)component).m_isHeld && (Object)(object)component.m_quickbeltSlot == (Object)null) { Rigidbody component2 = gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { gameObject.transform.SetParent(parent.transform); component2.useGravity = false; component2.isKinematic = true; } } } private void OnTriggerExit(Collider other) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)other).gameObject; FVRPhysicalObject component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)gameObject != (Object)(object)parent && (int)component.QBSlotType == 0 && ((FVRInteractiveObject)component).m_isHeld && (Object)(object)component.m_quickbeltSlot == (Object)null) { Rigidbody component2 = gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { gameObject.transform.SetParent(parent.transform); component2.useGravity = true; component2.isKinematic = false; } } } } }