Decompiled source of EIW97 v1.0.1
EIW97.dll
Decompiled 3 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using H3VRUtils.FVRInteractiveObjects; using HarmonyLib; using OtherLoader; using UnityEngine; using UnityEngine.UI; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace JerryEIW97 { public class EIW97 : MonoBehaviour { public GameObject ScreenNoCon; public GameObject ScreenHasCon; public Text RoundsFired; public Text Mode; public FVRFireArmAttachmentMount RS232PlugPort; public AR15HandleSightFlipper Upper; public L85Trainer GunPlug; private void Start() { } private void FixedUpdate() { if (Upper.m_isLargeAperture) { ScreenNoCon.SetActive(false); ScreenHasCon.SetActive(false); } else { if (Upper.m_isLargeAperture) { return; } if (RS232PlugPort.HasAttachmentsOnIt()) { if ((Object)(object)((Component)RS232PlugPort.AttachmentsList[0]).gameObject.GetComponent<L85Trainer>() != (Object)null) { GunPlug = ((Component)RS232PlugPort.AttachmentsList[0]).gameObject.GetComponent<L85Trainer>(); ScreenNoCon.SetActive(false); ScreenHasCon.SetActive(true); RoundsFired.text = GunPlug.ShotsFired.ToString(); Mode.text = (1 + GunPlug.Switch.CurModeIndex).ToString(); } else { ScreenNoCon.SetActive(true); ScreenHasCon.SetActive(false); } } else { ScreenNoCon.SetActive(true); ScreenHasCon.SetActive(false); } } } } public class L85Trainer : FVRFireArmAttachment { public Rigidbody weight; public GameObject plugphys; public GameObject spring; public GameObject PlugRef; public GameObject PlugThis; public GameObject PlugThat; public LineRenderer LR; public ClosedBoltWeapon L85; public GameObject Trigger; public AudioEvent TriggerPull; public AudioEvent TriggerReset; public bool isReset = false; public ClosedBoltSecondarySwitch Switch; public int ShotsFired = 0; public Material YellowLight; public Material RedLight; public float YellowRef = 0f; public float FireCd1 = 0.2f; public float FireCd2 = 0.1f; public float RedCd = 0.1f; public bool Fire = false; public bool ReadyToShoot = true; public int curburst = 0; public float yellowEmiWeight = 0f; public bool Red = false; private void Update() { //IL_0073: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: 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_0577: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_0632: 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_0609: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)L85 == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } ((Component)this).transform.SetParent((Transform)null); if ((Object)(object)spring != (Object)null) { spring.transform.SetParent((Transform)null); } if (!((Object)(object)L85 != (Object)null)) { return; } LR.SetPosition(0, PlugThis.transform.position); LR.SetPosition(1, PlugThat.transform.position); YellowLight.SetFloat("_EmissionWeight", yellowEmiWeight); yellowEmiWeight = Mathf.SmoothDamp(yellowEmiWeight, 0f, ref YellowRef, 0.05f); if ((Object)(object)base.curMount == (Object)null && !((FVRInteractiveObject)this).m_isHeld) { plugphys.SetActive(true); weight.useGravity = true; ((Component)this).gameObject.transform.position = PlugRef.transform.position; ((Component)this).gameObject.transform.eulerAngles = PlugRef.transform.eulerAngles; } if ((Object)(object)base.curMount != (Object)null || ((FVRInteractiveObject)this).m_isHeld) { plugphys.SetActive(false); weight.useGravity = false; PlugRef.transform.position = ((Component)this).gameObject.transform.position; PlugRef.transform.eulerAngles = ((Component)this).gameObject.transform.eulerAngles; } if ((Object)(object)base.curMount != (Object)null) { ((Component)this).gameObject.transform.position = ((Component)base.curMount).gameObject.transform.position; ((Component)this).gameObject.transform.eulerAngles = ((Component)base.curMount).gameObject.transform.eulerAngles; } if (Fire) { if (Switch.CurModeIndex == 0 && ReadyToShoot) { yellowEmiWeight = 1f; ShotsFired++; ReadyToShoot = false; } if (Switch.CurModeIndex == 1) { FireCd1 -= Time.deltaTime; if (ReadyToShoot && curburst < 3 && FireCd1 <= 0f) { yellowEmiWeight = 1f; FireCd1 = 0.2f; curburst++; ShotsFired++; } if (curburst >= 3) { ReadyToShoot = false; } } if (Switch.CurModeIndex == 2) { FireCd2 -= Time.deltaTime; if (ReadyToShoot && curburst < 5 && FireCd2 <= 0f) { yellowEmiWeight = 1f; FireCd2 = 0.1f; curburst++; ShotsFired++; } if (curburst >= 5) { ReadyToShoot = false; } } } else if (!Fire) { FireCd1 = 0f; FireCd2 = 0f; curburst = 0; ReadyToShoot = true; } if ((Object)(object)base.curMount == (Object)null) { Red = false; } else if ((Object)(object)base.curMount != (Object)null) { if ((Object)(object)((FVRFireArm)L85).Magazine == (Object)null || L85.FireSelectorModeIndex == 0) { RedCd -= Time.deltaTime; if (RedCd <= 0f) { RedCd = 0.1f; Red = !Red; } } if ((Object)(object)((FVRFireArm)L85).Magazine != (Object)null && L85.FireSelectorModeIndex == 1) { Red = true; } } if (Red) { RedLight.SetFloat("_EmissionWeight", 1f); } else if (!Red) { RedLight.SetFloat("_EmissionWeight", 0f); } if (Trigger.gameObject.transform.localEulerAngles.x < 7.5f && !isReset) { SM.PlayCoreSound((FVRPooledAudioType)41, TriggerReset, Trigger.transform.position); isReset = true; } if (((FVRInteractiveObject)L85).m_isHeld) { Trigger.gameObject.transform.localEulerAngles = new Vector3(15f * ((FVRInteractiveObject)L85).m_hand.Input.TriggerFloat, 0f, 0f); if (Trigger.gameObject.transform.localEulerAngles.x > 10f) { if (isReset) { if ((Object)(object)((FVRFireArm)L85).Magazine != (Object)null && (Object)(object)base.curMount != (Object)null && L85.FireSelectorModeIndex == 1) { Fire = true; } SM.PlayCoreSound((FVRPooledAudioType)41, TriggerPull, Trigger.transform.position); isReset = false; } } else if (Trigger.gameObject.transform.localEulerAngles.x < 7.5f) { Fire = false; } } if (!((FVRInteractiveObject)L85).m_isHeld) { Fire = false; Trigger.gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } private void OnDestroy() { if ((Object)(object)L85 != (Object)null) { Object.Destroy((Object)(object)((Component)L85).gameObject); } if ((Object)(object)spring != (Object)null) { Object.Destroy((Object)(object)spring.gameObject); } if ((Object)(object)PlugRef != (Object)null) { Object.Destroy((Object)(object)PlugRef.gameObject); } } } } [Serializable] public class BlurCircle { [Range(0f, 1f)] public float positionX = 0.5f; [Range(0f, 1f)] public float positionY = 0.5f; [Range(0.01f, 0.5f)] public float radius = 0.1f; [Range(0.1f, 5f)] public float transitionSharpness = 1f; [Range(0f, 1f)] public float intensity = 1f; public bool isActive = true; [HideInInspector] public float pulseTimer = 0f; [HideInInspector] public float pulseSpeed = 1f; [HideInInspector] public float minRadius = 0.05f; [HideInInspector] public float maxRadius = 0.2f; public Vector2 Position { get { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return new Vector2(positionX, positionY); } set { positionX = Mathf.Clamp01(value.x); positionY = Mathf.Clamp01(value.y); } } } public class EnhancedCircleBlur : MonoBehaviour { [Header("Blur Settings")] [Range(0f, 10f)] public float blurStrength = 5f; [Range(0.1f, 10f)] public float globalTransitionSharpness = 3f; [Range(0f, 1f)] public float globalIntensity = 1f; public bool invertEffect = false; [Header("Circle Management")] public List<BlurCircle> circles = new List<BlurCircle>(); public int maxCircles = 60; [Header("Animation")] public bool animateCircles = false; public float animationSpeed = 1f; public bool pulseRadius = false; public float pulseMin = 0.05f; public float pulseMax = 0.2f; [Header("Performance")] public int updateRate = 30; public bool useFastBlur = true; [Header("References")] public Material targetMaterial; public Renderer targetRenderer; private Texture2D circleDataTexture; private float updateTimer = 0f; private bool materialAssigned = false; private static readonly int CircleDataTexID = Shader.PropertyToID("_CircleDataTex"); private static readonly int CircleCountID = Shader.PropertyToID("_CircleCount"); private static readonly int BlurStrengthID = Shader.PropertyToID("_BlurStrength"); private static readonly int TransitionSharpnessID = Shader.PropertyToID("_TransitionSharpness"); private static readonly int InvertEffectID = Shader.PropertyToID("_InvertEffect"); private static readonly int GlobalIntensityID = Shader.PropertyToID("_GlobalIntensity"); private void Start() { if ((Object)(object)targetRenderer == (Object)null) { targetRenderer = ((Component)this).GetComponent<Renderer>(); } if ((Object)(object)targetMaterial == (Object)null && (Object)(object)targetRenderer != (Object)null) { targetMaterial = targetRenderer.sharedMaterial; } if (circles.Count == 0) { circles.Add(new BlurCircle()); } if (circles.Count > maxCircles) { circles.RemoveRange(maxCircles, circles.Count - maxCircles); } CreateCircleDataTexture(); if ((Object)(object)targetMaterial != (Object)null) { targetMaterial.SetTexture(CircleDataTexID, (Texture)(object)circleDataTexture); UpdateMaterialProperties(); materialAssigned = true; } InitializeAnimation(); } private void Update() { updateTimer += Time.deltaTime; float num = 1f / (float)updateRate; if (updateTimer >= num) { if (animateCircles) { UpdateAnimations(); } UpdateCircleDataTexture(); if (materialAssigned) { UpdateMaterialProperties(); } updateTimer = 0f; } } private void CreateCircleDataTexture() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown circleDataTexture = new Texture2D(maxCircles, 1, (TextureFormat)20, false); ((Texture)circleDataTexture).wrapMode = (TextureWrapMode)1; ((Texture)circleDataTexture).filterMode = (FilterMode)0; ((Object)circleDataTexture).name = "CircleDataTexture"; UpdateCircleDataTexture(); } private void UpdateCircleDataTexture() { //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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)circleDataTexture == (Object)null) { return; } Color[] array = (Color[])(object)new Color[maxCircles]; for (int i = 0; i < maxCircles; i++) { ref Color reference = ref array[i]; reference = Color.black; } int num = 0; for (int j = 0; j < circles.Count && j < maxCircles; j++) { if (circles[j].isActive) { BlurCircle blurCircle = circles[j]; float num2 = Mathf.Clamp01(blurCircle.radius / 0.5f); float num3 = Mathf.Clamp01(blurCircle.transitionSharpness / 5f); ref Color reference2 = ref array[num]; reference2 = new Color(blurCircle.positionX, blurCircle.positionY, num2, num3); num++; } } circleDataTexture.SetPixels(array); circleDataTexture.Apply(); if ((Object)(object)targetMaterial != (Object)null) { targetMaterial.SetTexture(CircleDataTexID, (Texture)(object)circleDataTexture); targetMaterial.SetInt(CircleCountID, num); } } private void UpdateMaterialProperties() { if (!((Object)(object)targetMaterial == (Object)null)) { targetMaterial.SetFloat(BlurStrengthID, blurStrength); targetMaterial.SetFloat(TransitionSharpnessID, globalTransitionSharpness); targetMaterial.SetFloat(GlobalIntensityID, globalIntensity); targetMaterial.SetFloat(InvertEffectID, (!invertEffect) ? 0f : 1f); } } private void InitializeAnimation() { foreach (BlurCircle circle in circles) { circle.pulseTimer = Random.Range(0f, (float)Math.PI * 2f); circle.pulseSpeed = Random.Range(0.5f, 2f); circle.minRadius = pulseMin; circle.maxRadius = pulseMax; } } private void UpdateAnimations() { if (!animateCircles) { return; } foreach (BlurCircle circle in circles) { if (circle.isActive) { circle.pulseTimer += Time.deltaTime * animationSpeed * circle.pulseSpeed; if (pulseRadius) { float num = (Mathf.Sin(circle.pulseTimer) + 1f) * 0.5f; circle.radius = Mathf.Lerp(circle.minRadius, circle.maxRadius, num); } circle.positionX = Mathf.Clamp01(circle.positionX); circle.positionY = Mathf.Clamp01(circle.positionY); circle.radius = Mathf.Clamp(circle.radius, 0.01f, 0.5f); } } } public void AddCircle(Vector2 position, float radius, float transitionSharpness) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (circles.Count >= maxCircles) { Debug.LogWarning((object)("Maximum number of circles reached:" + maxCircles)); return; } BlurCircle blurCircle = new BlurCircle(); blurCircle.Position = position; blurCircle.radius = Mathf.Clamp(radius, 0.01f, 0.5f); blurCircle.transitionSharpness = Mathf.Clamp(transitionSharpness, 0.1f, 5f); blurCircle.isActive = true; BlurCircle item = blurCircle; circles.Add(item); } public void RemoveCircle(int index) { if (index >= 0 && index < circles.Count) { circles.RemoveAt(index); } } public void SetCircleActive(int index, bool active) { if (index >= 0 && index < circles.Count) { circles[index].isActive = active; } } public void ClearCircles() { circles.Clear(); } public void RandomizeCircles(int count) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) circles.Clear(); for (int i = 0; i < count && i < maxCircles; i++) { AddCircle(new Vector2(Random.value, Random.value), Random.Range(0.05f, 0.2f), Random.Range(0.5f, 3f)); } } private void OnValidate() { blurStrength = Mathf.Clamp(blurStrength, 0f, 10f); globalTransitionSharpness = Mathf.Clamp(globalTransitionSharpness, 0.1f, 10f); globalIntensity = Mathf.Clamp01(globalIntensity); foreach (BlurCircle circle in circles) { circle.positionX = Mathf.Clamp01(circle.positionX); circle.positionY = Mathf.Clamp01(circle.positionY); circle.radius = Mathf.Clamp(circle.radius, 0.01f, 0.5f); circle.transitionSharpness = Mathf.Clamp(circle.transitionSharpness, 0.1f, 5f); circle.intensity = Mathf.Clamp01(circle.intensity); } if (Application.isPlaying && (Object)(object)circleDataTexture != (Object)null) { UpdateCircleDataTexture(); UpdateMaterialProperties(); } } private void OnDrawGizmosSelected() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_007f: 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_00b2: 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_00ce: Unknown result type (might be due to invalid IL or missing references) if (circles == null || !((Behaviour)this).enabled) { return; } Color color = default(Color); foreach (BlurCircle circle in circles) { if (circle.isActive) { Vector3 val = ((Component)this).transform.TransformPoint(new Vector3(circle.positionX - 0.5f, 0f, circle.positionY - 0.5f)); Gizmos.color = Color.green; Gizmos.DrawWireSphere(val, circle.radius * 0.5f); ((Color)(ref color))..ctor(0f, 1f, 0f, 0.2f); Gizmos.color = color; Gizmos.DrawSphere(val, circle.radius * 0.5f); Gizmos.color = Color.red; Gizmos.DrawSphere(val, 0.01f); } } } private void OnDestroy() { if ((Object)(object)circleDataTexture != (Object)null) { Object.DestroyImmediate((Object)(object)circleDataTexture); } } } public class CircleDataMul { public Vector2 position; public float radius; public float transitionSpeed; public CircleDataMul(Vector2 pos, float rad, float speed) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) position = pos; radius = rad; transitionSpeed = speed; } } public class MultiCircleBlurController : MonoBehaviour { [Header("Shader Properties")] public Material targetMaterial; [Range(0f, 1f)] public float blurStrength = 0.5f; public float defaultRadius = 0.1f; public float transitionSmoothness = 2f; [Header("Circle Settings")] public List<Vector2> circlePositions = new List<Vector2>(); public List<float> circleRadii = new List<float>(); public List<float> circleTransitions = new List<float>(); [Header("Animation Settings")] public bool animateTransitions = true; public float transitionDuration = 2f; private List<float> currentTransitionValues = new List<float>(); private List<float> targetTransitionValues = new List<float>(); private float transitionTimer = 0f; private const int MAX_CIRCLES = 8; private void Start() { InitializeCircles(); UpdateShaderProperties(); for (int i = 0; i < circleTransitions.Count; i++) { currentTransitionValues.Add(circleTransitions[i]); targetTransitionValues.Add(circleTransitions[i]); } } private void Update() { if (animateTransitions) { UpdateTransitions(); } UpdateShaderProperties(); } private void InitializeCircles() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (circlePositions.Count == 0) { circlePositions.Add(new Vector2(0.5f, 0.5f)); circleRadii.Add(defaultRadius); circleTransitions.Add(1f); } while (circleRadii.Count < circlePositions.Count) { circleRadii.Add(defaultRadius); } while (circleTransitions.Count < circlePositions.Count) { circleTransitions.Add(1f); } } private void UpdateTransitions() { transitionTimer += Time.deltaTime; if (transitionTimer >= transitionDuration) { transitionTimer = 0f; for (int i = 0; i < targetTransitionValues.Count; i++) { targetTransitionValues[i] = Random.Range(0.1f, 3f); } } float num = transitionTimer / transitionDuration; float num2 = Mathf.SmoothStep(0f, 1f, num); for (int j = 0; j < currentTransitionValues.Count; j++) { currentTransitionValues[j] = Mathf.Lerp(circleTransitions[j], targetTransitionValues[j], num2); } } private void UpdateShaderProperties() { //IL_007c: 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_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_0088: 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_0227: 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_0249: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: 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_0263: 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_026a: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_040b: 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_042f: 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_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetMaterial == (Object)null) { return; } targetMaterial.SetFloat("_BlurStrength", blurStrength); targetMaterial.SetFloat("_CircleRadius", defaultRadius); targetMaterial.SetFloat("_TransitionSmoothness", transitionSmoothness); int num = Mathf.Min(circlePositions.Count, 8); targetMaterial.SetInt("_CircleCount", num); Vector4 zero = Vector4.zero; Vector4 zero2 = Vector4.zero; Vector4 zero3 = Vector4.zero; for (int i = 0; i < Mathf.Min(num, 4); i++) { if (i == 0) { zero.x = circlePositions[i].x; } if (i == 0) { zero.y = circlePositions[i].y; } if (i == 1) { zero.z = circlePositions[i].x; } if (i == 1) { zero.w = circlePositions[i].y; } if (i == 0) { zero2.x = circleRadii[i]; } if (i == 1) { zero2.y = circleRadii[i]; } if (i == 2) { zero2.z = circleRadii[i]; } if (i == 3) { zero2.w = circleRadii[i]; } float num2 = ((!animateTransitions) ? circleTransitions[i] : currentTransitionValues[i]); if (i == 0) { zero3.x = num2; } if (i == 1) { zero3.y = num2; } if (i == 2) { zero3.z = num2; } if (i == 3) { zero3.w = num2; } } targetMaterial.SetVector("_CirclePositions", zero); targetMaterial.SetVector("_CircleRadii", zero2); targetMaterial.SetVector("_CircleTransitions", zero3); if (num <= 4) { return; } Vector4 zero4 = Vector4.zero; Vector4 zero5 = Vector4.zero; Vector4 zero6 = Vector4.zero; for (int j = 4; j < Mathf.Min(num, 8); j++) { int num3 = j - 4; if (num3 == 0) { zero4.x = circlePositions[j].x; } if (num3 == 0) { zero4.y = circlePositions[j].y; } if (num3 == 1) { zero4.z = circlePositions[j].x; } if (num3 == 1) { zero4.w = circlePositions[j].y; } if (num3 == 0) { zero5.x = circleRadii[j]; } if (num3 == 1) { zero5.y = circleRadii[j]; } if (num3 == 2) { zero5.z = circleRadii[j]; } if (num3 == 3) { zero5.w = circleRadii[j]; } float num4 = ((!animateTransitions) ? circleTransitions[j] : currentTransitionValues[j]); if (num3 == 0) { zero6.x = num4; } if (num3 == 1) { zero6.y = num4; } if (num3 == 2) { zero6.z = num4; } if (num3 == 3) { zero6.w = num4; } } targetMaterial.SetVector("_CirclePositions2", zero4); targetMaterial.SetVector("_CircleRadii2", zero5); targetMaterial.SetVector("_CircleTransitions2", zero6); } public void AddCircle(Vector2 position, float radius, float transitionSpeed) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (circlePositions.Count >= 8) { Debug.LogWarning((object)("已达到最大圆数量限制 (" + 8 + ")")); return; } circlePositions.Add(position); circleRadii.Add(radius); circleTransitions.Add(transitionSpeed); currentTransitionValues.Add(transitionSpeed); targetTransitionValues.Add(transitionSpeed); } public void RemoveCircle(int index) { if (index >= 0 && index < circlePositions.Count) { circlePositions.RemoveAt(index); circleRadii.RemoveAt(index); circleTransitions.RemoveAt(index); currentTransitionValues.RemoveAt(index); targetTransitionValues.RemoveAt(index); } } public void UpdateCircle(int index, Vector2 position, float radius, float transitionSpeed) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (index >= 0 && index < circlePositions.Count) { circlePositions[index] = position; circleRadii[index] = radius; circleTransitions[index] = transitionSpeed; } } public void SetCircleTransition(int index, float transitionValue) { if (index >= 0 && index < circleTransitions.Count) { circleTransitions[index] = transitionValue; if (index < currentTransitionValues.Count) { currentTransitionValues[index] = transitionValue; } } } private void OnDrawGizmosSelected() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_00ab: 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) if (circlePositions == null) { return; } for (int i = 0; i < circlePositions.Count; i++) { if (i < circleRadii.Count) { Vector3 val = ((Component)this).transform.TransformPoint(new Vector3(circlePositions[i].x - 0.5f, 0f, circlePositions[i].y - 0.5f)); Gizmos.color = Color.green; Gizmos.DrawWireSphere(val, circleRadii[i] * 0.5f); Gizmos.color = new Color(0f, 1f, 0f, 0.3f); Gizmos.DrawSphere(val, circleRadii[i] * 0.5f); } } } } namespace JerryComponent { public class G11Handle : FVRInteractiveObject { public Transform RotPiece; public AudioEvent HandleCrank; [NonSerialized] public float m_curRot; public Transform FlapPiece; [NonSerialized] public Vector3 lastHandForward = Vector3.zero; public override void BeginInteraction(FVRViveHand hand) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); SetFlapState(isOut: true); lastHandForward = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, ((Component)this).transform.right); } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); } public void SetFlapState(bool isOut) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (isOut) { FlapPiece.localEulerAngles = new Vector3(0f, 90f, -90f); } else { FlapPiece.localEulerAngles = new Vector3(0f, 90f, 0f); } } public override void FVRFixedUpdate() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)this).IsHeld) { float curRot = m_curRot; Vector3 val = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, -((Component)this).transform.right); Vector3 val2 = Vector3.ProjectOnPlane(lastHandForward, -((Component)this).transform.right); float num = Mathf.Atan2(Vector3.Dot(-((Component)this).transform.right, Vector3.Cross(val, val2)), Vector3.Dot(val, val2)) * 57.29578f; if (num > 0f) { m_curRot -= num; } if (curRot > -180f && m_curRot <= -180f) { SM.PlayCoreSound((FVRPooledAudioType)10, HandleCrank, ((Component)this).transform.position); } if (m_curRot <= -360f) { RotPiece.localEulerAngles = new Vector3(0f, 0f, 0f); SM.PlayCoreSound((FVRPooledAudioType)10, HandleCrank, ((Component)this).transform.position); m_curRot = 0f; SetFlapState(isOut: false); base.m_hand.EndInteractionIfHeld((FVRInteractiveObject)(object)this); ((FVRInteractiveObject)this).ForceBreakInteraction(); } else { RotPiece.localEulerAngles = new Vector3(0f, 0f, m_curRot); } lastHandForward = val; } ((FVRInteractiveObject)this).FVRFixedUpdate(); } } public class GM6Barrel : MonoBehaviour { public Rigidbody gunrig; public GameObject barrelRig; public Mac11_Stock grab; public GameObject grabtarg; public GameObject barreltarg; public ClosedBoltReceiverDustCoverTrigger dustcover; public WaggleJoint dustcoverJoint; public AR15HandleSightFlipper barrelLatch; public Vector2 ZbarrelLimit; public float rear; public float fore; public GameObject snapbarrel; public ClosedBolt bolt; public GameObject boltGeo; public ClosedBoltWeapon gun; public GameObject boltrot; public AudioEvent snaptorearaud; public bool reachedtorear = false; public bool shot = false; public GameObject foreexp; public GameObject rearexp; public bool pulled = false; public bool startrecoil = false; public float recoverspeedbarrel; public float recoverspeedbolt; public bool blowback1 = false; public bool blowback2 = false; public float mul1 = 1f; public float mul2 = 1f; private void OnShotFired(FVRFireArm firearm) { if ((Object)(object)firearm == (Object)(object)gun) { if (((FVRInteractiveObject)bolt).IsHeld) { ((FVRInteractiveObject)bolt).ForceBreakInteraction(); } ((FVRInteractiveObject)bolt).IsSimpleInteract = true; bolt.Speed_Rearward = 0f; shot = true; startrecoil = true; } } private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired); } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_09be: Unknown result type (might be due to invalid IL or missing references) //IL_09c3: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_0944: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Unknown result type (might be due to invalid IL or missing references) //IL_0960: Unknown result type (might be due to invalid IL or missing references) //IL_0878: Unknown result type (might be due to invalid IL or missing references) if ((int)((FVRPhysicalObject)gun).Size == 3 && (Object)(object)((FVRPhysicalObject)gun).m_quickbeltSlot != (Object)null && ((FVRPhysicalObject)gun).m_isHardnessed) { ((FVRPhysicalObject)gun).m_isHardnessed = false; } if (((FVRInteractiveObject)bolt).IsHeld) { boltGeo.gameObject.transform.localPosition = ((Component)bolt).gameObject.transform.localPosition; if (boltrot.transform.localEulerAngles.y >= 1f && !pulled) { barrelRig.gameObject.transform.localPosition = ((Component)bolt).gameObject.transform.localPosition; } else if (boltrot.transform.localEulerAngles.y < 1f) { pulled = true; blowback1 = false; blowback2 = false; } } dustcoverJoint.angleLimitRight = -1f * ((Component)dustcover).gameObject.transform.localEulerAngles.z; barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, barrelRig.gameObject.transform.localPosition.z); boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, boltGeo.gameObject.transform.localPosition.z); barrelRig.gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f); boltGeo.gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f); if (barrelRig.gameObject.transform.localPosition.z < rear) { barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, rear); } if (barrelRig.gameObject.transform.localPosition.z > fore) { pulled = false; if (mul1 != 1f) { if (!((FVRInteractiveObject)bolt).IsHeld) { SM.PlayCoreSound((FVRPooledAudioType)41, snaptorearaud, barrelRig.gameObject.transform.position); } mul1 = 1f; } barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, fore); } if (boltGeo.gameObject.transform.localPosition.z < rear) { boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, rear); } if (boltGeo.gameObject.transform.localPosition.z > fore) { pulled = false; if (mul2 != 1f) { if (!((FVRInteractiveObject)bolt).IsHeld) { SM.PlayCoreSound((FVRPooledAudioType)41, snaptorearaud, boltGeo.gameObject.transform.position); } mul2 = 1f; } boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, fore); } if (boltGeo.gameObject.transform.localPosition.z >= fore) { pulled = false; } if (barrelRig.gameObject.transform.localPosition.z < rear + 0.01f && !barrelLatch.m_isLargeAperture) { snapbarrel.SetActive(true); if (((FVRInteractiveObject)grab).IsHeld) { ((FVRInteractiveObject)grab).ForceBreakInteraction(); ((FVRInteractiveObject)grab).IsSimpleInteract = true; } ((FVRPhysicalObject)gun).Size = (FVRPhysicalObjectSize)2; barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, rear); if (!dustcover.m_isOpen) { dustcover.ToggleDustCoverState(); } ((FVRInteractiveObject)bolt).IsSimpleInteract = true; } if (barrelLatch.m_isLargeAperture && !((FVRInteractiveObject)grab).IsHeld) { ((FVRPhysicalObject)gun).Size = (FVRPhysicalObjectSize)3; ((Component)grab).transform.position = grabtarg.transform.position; ((Component)grab).transform.eulerAngles = grabtarg.transform.eulerAngles; ((FVRInteractiveObject)grab).IsSimpleInteract = false; ((FVRInteractiveObject)bolt).IsSimpleInteract = false; snapbarrel.SetActive(false); if (barrelRig.gameObject.transform.localPosition.z < fore) { mul1 += Time.deltaTime; barrelRig.transform.localPosition = new Vector3(0f, 0f, barrelRig.transform.localPosition.z + recoverspeedbarrel * mul1); } } if (((FVRInteractiveObject)grab).IsHeld) { if (!dustcover.m_isOpen) { dustcover.ToggleDustCoverState(); } snapbarrel.SetActive(false); ((FVRInteractiveObject)bolt).IsSimpleInteract = false; barrelRig.gameObject.transform.eulerAngles = barreltarg.transform.eulerAngles; barrelRig.gameObject.transform.position = barreltarg.transform.position; } if (startrecoil && barrelRig.gameObject.transform.localPosition.z > rear) { barrelRig.gameObject.transform.localPosition = new Vector3(0f, 0f, barrelRig.gameObject.transform.localPosition.z - recoverspeedbarrel * 25f); } if (barrelRig.gameObject.transform.localPosition.z < fore - 0.01f) { if (boltGeo.gameObject.transform.localPosition.z > rear + 0.01f) { boltGeo.gameObject.transform.localPosition = barrelRig.gameObject.transform.localPosition; } else if (boltGeo.gameObject.transform.localPosition.z < rear + 0.01f) { boltGeo.gameObject.transform.localPosition = new Vector3(0f, 0f, rear); if (!reachedtorear && shot) { startrecoil = false; SM.PlayCoreSound((FVRPooledAudioType)41, snaptorearaud, boltGeo.gameObject.transform.position); reachedtorear = true; shot = false; blowback1 = false; blowback2 = false; } } } else if (barrelRig.gameObject.transform.localPosition.z >= fore - 0.01f) { if (!((FVRInteractiveObject)bolt).IsHeld && boltGeo.gameObject.transform.localPosition.z < fore) { mul2 += Time.deltaTime; boltGeo.transform.localPosition = new Vector3(0f, 0f, boltGeo.transform.localPosition.z + recoverspeedbolt * mul2); } if (reachedtorear) { if (!((FVRInteractiveObject)bolt).IsHeld) { bolt.Speed_Rearward = -100f; bolt.SnapToRear(); } reachedtorear = false; } } if (boltGeo.gameObject.transform.localPosition.z >= fore - 0.01f) { ((FVRInteractiveObject)bolt).IsSimpleInteract = false; } } private void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnShotFired); } } public class G50Seeker : MonoBehaviour { public QuadcopterController QC; public AR15HandleSightFlipper trigger; public GameObject wingrot; public GameObject explosion; public GameObject audseek; public GameObject audfly; public FVRPhysicalObject main; public Collider detectcol; [NonSerialized] public List<SosigLink> currentAI = new List<SosigLink>(); [NonSerialized] public Transform nearestAI; public GameObject lookdir; public LayerMask lm; public bool clicked = false; public bool triggered = true; public GameObject lookdir2; private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } private void OnTriggerStay(Collider other) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Invalid comparison between Unknown and I4 if (!trigger.m_isLargeAperture && !((FVRInteractiveObject)main).m_isHeld && (Object)(object)main.m_quickbeltSlot == (Object)null && ((Object)((Component)other).gameObject).name == "Sosig_Torso" && (Object)(object)((Component)other).gameObject.GetComponent<SosigLink>() != (Object)null && (Object)(object)GM.CurrentPlayerBody != (Object)null && !currentAI.Contains(((Component)other).gameObject.GetComponent<SosigLink>()) && (int)((Component)other).gameObject.GetComponent<SosigLink>().S.BodyState != 3) { currentAI.Add(((Component)other).gameObject.GetComponent<SosigLink>()); } } private void Update() { //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Invalid comparison between Unknown and I4 //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)main).m_isHeld) { if (((FVRInteractiveObject)main).m_hand.Input.TriggerFloat > 0.75f) { if (!clicked) { triggered = !triggered; clicked = true; } } else { clicked = false; } } else if (!((FVRInteractiveObject)main).m_isHeld) { clicked = false; } trigger.m_isLargeAperture = triggered; if ((Object)(object)main == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } if (trigger.m_isLargeAperture || ((FVRInteractiveObject)main).m_isHeld || (Object)(object)main.m_quickbeltSlot != (Object)null) { detectcol.enabled = false; audfly.SetActive(false); audseek.SetActive(false); nearestAI = null; wingrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f); ((Behaviour)QC).enabled = false; } if (trigger.m_isLargeAperture || ((FVRInteractiveObject)main).m_isHeld || !((Object)(object)main.m_quickbeltSlot == (Object)null)) { return; } detectcol.enabled = true; audfly.SetActive(true); wingrot.transform.localEulerAngles = new Vector3(90f, 0f, 0f); ((Behaviour)QC).enabled = true; if (currentAI == null || (Object)(object)nearestAI == (Object)null) { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { QC.SetFollowTarget(((Component)GM.CurrentPlayerBody.Head).gameObject.transform); QC.SetTargetHeight(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.y + 0.25f); } QC.obstacleCheckDistanceY = 1f; QC.followDistance = 1f; audseek.SetActive(false); } if ((Object)(object)nearestAI != (Object)null) { AxisLookAt(lookdir.transform, ((Component)nearestAI).gameObject.transform.position, Vector3.forward); RaycastHit val = default(RaycastHit); if (Physics.Raycast(lookdir2.transform.position, lookdir2.transform.forward, ref val, 25f, LayerMask.op_Implicit(lm))) { if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponentInParent<SosigLink>() != (Object)null) { audseek.SetActive(true); QC.SetFollowTarget(((Component)nearestAI).gameObject.transform); QC.SetTargetHeight(((Component)nearestAI).gameObject.transform.position.y); QC.followDistance = 0f; QC.obstacleCheckDistanceY = 0.1f; } else { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { QC.SetFollowTarget(((Component)GM.CurrentPlayerBody.Head).gameObject.transform); QC.SetTargetHeight(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.y + 0.25f); } QC.obstacleCheckDistanceY = 1f; QC.followDistance = 1f; audseek.SetActive(false); } } else { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { QC.SetFollowTarget(((Component)GM.CurrentPlayerBody.Head).gameObject.transform); QC.SetTargetHeight(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.y + 0.25f); } QC.obstacleCheckDistanceY = 1f; QC.followDistance = 1f; audseek.SetActive(false); } if ((Object)(object)GM.CurrentPlayerBody != (Object)null && Vector3.Distance(((Component)main).gameObject.transform.position, ((Component)nearestAI).gameObject.transform.position) <= 1f && Vector3.Distance(((Component)main).gameObject.transform.position, ((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position) >= 2.5f) { Object.Instantiate<GameObject>(explosion, ((Component)this).gameObject.transform.position, ((Component)this).gameObject.transform.rotation); Object.Destroy((Object)(object)((Component)main).gameObject); } } if (currentAI == null) { return; } for (int i = 0; i < currentAI.Count; i++) { if ((Object)(object)currentAI[i] == (Object)null || (int)currentAI[i].S.BodyState == 3 || Vector3.Distance(((Component)main).gameObject.transform.position, ((Component)currentAI[i]).gameObject.transform.position) > 25f) { currentAI.Remove(currentAI[i]); } } nearestAI = GetNearestGameObject(((Component)this).gameObject.transform, currentAI); } public Transform GetNearestGameObject(Transform player, List<SosigLink> objects) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Transform val = null; if (objects == null || (Object)(object)val == (Object)null) { } if (objects.Count > 0 && (Object)(object)objects[0] != (Object)null) { val = ((Component)objects[0]).transform; float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position); for (int i = 1; i < objects.Count; i++) { float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position); if (num > num2) { num = num2; val = ((Component)objects[i]).transform; } } } return val; } } [RequireComponent(typeof(Rigidbody))] public class QuadcopterController : MonoBehaviour { [Header("悬停设置")] public float targetHeight = 1.8f; public float heightTolerance = 0.1f; public float maxLiftForce = 50f; [Header("PID控制器参数")] public float P_Gain = 5f; public float I_Gain = 0.5f; public float D_Gain = 2f; [Header("避障设置")] public LayerMask obstacleMask = LayerMask.op_Implicit(-1); public float obstacleCheckDistance = 3f; public float avoidanceForce = 15f; public float obstacleCheckDistanceY = 1f; public float sideRayOffset = 0.5f; [Header("跟随设置")] public Transform followTarget; public float followDistance = 3f; public float followForce = 10f; public float rotationSpeed = 5f; [Header("稳定设置")] public float stability = 10f; public float stabilitySpeed = 100f; private Rigidbody rb; private float heightErrorIntegral = 0f; private float previousHeightError = 0f; private Vector3 avoidanceVector = Vector3.zero; private float horizontalErrorIntegralX = 0f; private float horizontalErrorIntegralZ = 0f; private Vector3 previousHorizontalError = Vector3.zero; private void Start() { rb = ((Component)this).GetComponent<Rigidbody>(); rb.drag = 1f; rb.angularDrag = 5f; rb.useGravity = true; if ((Object)(object)followTarget == (Object)null) { ((MonoBehaviour)this).StartCoroutine(HoverInPlace()); } } private void FixedUpdate() { AvoidObstacles(); ControlHeight(); FollowTarget(); StabilizeRotation(); } private void ControlHeight() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) float y = ((Component)this).transform.position.y; float num = targetHeight - y; heightErrorIntegral += num * Time.fixedDeltaTime; float num2 = (num - previousHeightError) / Time.fixedDeltaTime; previousHeightError = num; float num3 = num * P_Gain + heightErrorIntegral * I_Gain + num2 * D_Gain; num3 = Mathf.Clamp(num3, 0f - maxLiftForce, maxLiftForce); Vector3 val = Vector3.up * (num3 + Mathf.Abs(Physics.gravity.y) * rb.mass); rb.AddForce(val); if (Mathf.Abs(num) < heightTolerance) { heightErrorIntegral *= 0.9f; } } private void AvoidObstacles() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) avoidanceVector = Vector3.zero; Vector3[] array = (Vector3[])(object)new Vector3[7] { ((Component)this).transform.forward, -((Component)this).transform.forward, ((Component)this).transform.right, -((Component)this).transform.right, ((Component)this).transform.forward + ((Component)this).transform.right, ((Component)this).transform.forward - ((Component)this).transform.right, Vector3.up }; Vector3[] array2 = array; RaycastHit val2 = default(RaycastHit); foreach (Vector3 val in array2) { if (Physics.Raycast(((Component)this).transform.position, val, ref val2, obstacleCheckDistance, LayerMask.op_Implicit(obstacleMask))) { Vector3 val3 = ((Component)this).transform.position - ((RaycastHit)(ref val2)).point; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = 1f - ((RaycastHit)(ref val2)).distance / obstacleCheckDistance; avoidanceVector += normalized * avoidanceForce * num; Debug.DrawLine(((Component)this).transform.position, ((RaycastHit)(ref val2)).point, Color.red); } else { Debug.DrawRay(((Component)this).transform.position, val * obstacleCheckDistance, Color.green); } } RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, Vector3.down, ref val4, obstacleCheckDistanceY, LayerMask.op_Implicit(obstacleMask))) { Vector3 val5 = ((Component)this).transform.position - ((RaycastHit)(ref val4)).point; Vector3 normalized2 = ((Vector3)(ref val5)).normalized; float num2 = 1f - ((RaycastHit)(ref val4)).distance / obstacleCheckDistance; avoidanceVector += normalized2 * avoidanceForce * num2; Debug.DrawLine(((Component)this).transform.position, ((RaycastHit)(ref val4)).point, Color.red); } else { Debug.DrawRay(((Component)this).transform.position, Vector3.down * obstacleCheckDistance, Color.green); } if (avoidanceVector != Vector3.zero) { rb.AddForce(avoidanceVector); } } private void FollowTarget() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)followTarget == (Object)null)) { Vector3 val = followTarget.position + followTarget.forward * followDistance; val.y = targetHeight; Vector3 val2 = val - ((Component)this).transform.position; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(val2.x, 0f, val2.z); horizontalErrorIntegralX += val3.x * Time.fixedDeltaTime; horizontalErrorIntegralZ += val3.z * Time.fixedDeltaTime; Vector3 val4 = (val3 - previousHorizontalError) / Time.fixedDeltaTime; previousHorizontalError = val3; Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(val3.x * P_Gain + horizontalErrorIntegralX * I_Gain + val4.x * D_Gain, 0f, val3.z * P_Gain + horizontalErrorIntegralZ * I_Gain + val4.z * D_Gain); val5 = Vector3.ClampMagnitude(val5, followForce); Vector3 val6 = val5 - Vector3.Project(val5, ((Vector3)(ref avoidanceVector)).normalized); rb.AddForce(val6); if (((Vector3)(ref val2)).magnitude > 0.5f) { Quaternion val7 = Quaternion.LookRotation(new Vector3(val2.x, 0f, val2.z)); rb.MoveRotation(Quaternion.Slerp(rb.rotation, val7, rotationSpeed * Time.fixedDeltaTime)); } } } private void StabilizeRotation() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = rb.rotation; Quaternion val = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f); Quaternion val2 = val * Quaternion.Inverse(rb.rotation); Vector3 val3 = new Vector3(val2.x, val2.y, val2.z) * stabilitySpeed; rb.AddTorque(val3 - rb.angularVelocity * stability); } private IEnumerator HoverInPlace() { Vector3 hoverPosition = ((Component)this).transform.position + Vector3.up * targetHeight; Vector3 val = default(Vector3); while ((Object)(object)followTarget == (Object)null) { Vector3 targetPos = new Vector3(hoverPosition.x, targetHeight, hoverPosition.z); Vector3 direction = targetPos - ((Component)this).transform.position; if (((Vector3)(ref direction)).magnitude > 0.5f) { Rigidbody obj = rb; ((Vector3)(ref val))..ctor(direction.x, 0f, direction.z); obj.AddForce(((Vector3)(ref val)).normalized * followForce * 0.5f); } yield return (object)new WaitForFixedUpdate(); } } public void SetFollowTarget(Transform target) { followTarget = target; ((MonoBehaviour)this).StopCoroutine("HoverInPlace"); } public void ClearFollowTarget() { followTarget = null; ((MonoBehaviour)this).StartCoroutine(HoverInPlace()); } public void SetTargetHeight(float height) { targetHeight = height; } private void OnDrawGizmosSelected() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (Application.isPlaying) { Gizmos.color = Color.blue; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Component)this).transform.position.x - 2f, targetHeight, ((Component)this).transform.position.z); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(((Component)this).transform.position.x + 2f, targetHeight, ((Component)this).transform.position.z); Gizmos.DrawLine(val, val2); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, obstacleCheckDistance); if ((Object)(object)followTarget != (Object)null) { Gizmos.color = Color.green; Gizmos.DrawLine(((Component)this).transform.position, followTarget.position); } } } } public class SMLEQuickBolt : MonoBehaviour { public BoltActionRifle rifle; public BoltActionRifle_Handle handle; public Vector3 velLinearWorld; public Vector3 velLinearWorld2; public FVRAlternateGrip grip; public Transform slapdirOpen; public Transform slapdirClose; public bool Slamed = false; public float drive = 0f; public bool stop = true; public Vector3 gunrecoilref; public Vector3 gunholdref; public Transform clipEjectdir; private Vector3 Pos; private Vector3 Rot; private GameObject shoulderpos; private GameObject headpos; private GameObject Gunholder; private GameObject Gunref; private float shoulderdis = 0.25f; private bool shouldered = false; public bool wasHarnessed; public FVRQuickBeltSlot slot; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(shotthis); } private void shotthis(FVRFireArm gun) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) Gunref.transform.localPosition = new Vector3(Gunref.transform.localPosition.x, Gunref.transform.localPosition.y, Gunref.transform.localPosition.z - 0.05f); } private void FixedUpdate() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Invalid comparison between Unknown and I4 //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Invalid comparison between Unknown and I4 //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) if (!Slamed && !stop) { drive -= 10f * Time.deltaTime; handle.DriveBolt(drive); if ((int)handle.HandleState == 0 && handle.rotAngle <= handle.MinRot + 1f) { stop = true; } } if (Slamed && !stop) { drive += 2f * Time.deltaTime; handle.DriveBolt(drive); if ((int)handle.HandleState == 2 && handle.rotAngle == handle.MaxRot) { stop = true; } } drive = Mathf.Clamp(drive, 0f, 1f); if (((FVRPhysicalObject)rifle).IsAltHeld && (Object)(object)((FVRFireArm)rifle).Clip != (Object)null) { velLinearWorld2 = ((FVRInteractiveObject)rifle).m_hand.OtherHand.Input.VelLinearWorld; if (Vector3.Distance(((FVRInteractiveObject)rifle).m_hand.OtherHand.PalmTransform.position, clipEjectdir.position) < 0.1f && Vector3.Angle(velLinearWorld2, clipEjectdir.forward) < 50f && ((Vector3)(ref velLinearWorld2)).magnitude > 0.5f) { ((FVRFireArm)rifle).EjectClip(); } } if (((FVRPhysicalObject)rifle).IsAltHeld && !((FVRInteractiveObject)handle).m_isHeld && (Object)(object)((FVRInteractiveObject)rifle).m_hand.OtherHand.m_currentInteractable != (Object)(object)rifle && (Object)(object)((FVRInteractiveObject)rifle).m_hand.OtherHand.m_currentInteractable != (Object)(object)handle) { velLinearWorld = ((FVRInteractiveObject)rifle).m_hand.OtherHand.Input.VelLinearWorld; if (!Slamed && Vector3.Distance(((FVRInteractiveObject)rifle).m_hand.OtherHand.PalmTransform.position, slapdirOpen.position) < 0.1f && Vector3.Angle(velLinearWorld, slapdirOpen.forward) < 50f && ((Vector3)(ref velLinearWorld)).magnitude > 1f) { stop = false; Slamed = true; } if (Slamed && Vector3.Distance(((FVRInteractiveObject)rifle).m_hand.OtherHand.PalmTransform.position, slapdirClose.position) < 0.1f && Vector3.Angle(velLinearWorld, slapdirClose.forward) < 50f && ((Vector3)(ref velLinearWorld)).magnitude > 1f) { stop = false; Slamed = false; } } if (((FVRInteractiveObject)handle).m_isHeld) { if ((int)handle.HandleState == 2 && handle.rotAngle >= handle.MaxRot - 1f) { Slamed = true; } if ((int)handle.HandleState == 0 && handle.rotAngle <= handle.MaxRot + 1f) { Slamed = false; } drive = Mathf.Abs(handle.BoltActionHandleRoot.localPosition.z / handle.Point_Rearward.localPosition.z); } } private void Update() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Gunholder == (Object)null) { Gunholder = new GameObject("Gunholder"); Debug.Log((object)"GunHolder"); } if ((Object)(object)Gunref == (Object)null) { Gunref = new GameObject("Gunref"); Gunref.transform.SetParent(Gunholder.transform); Debug.Log((object)"Gunref"); } if ((Object)(object)headpos == (Object)null) { headpos = new GameObject("HeadPos"); Debug.Log((object)"Headpos"); } if ((Object)(object)shoulderpos == (Object)null) { shoulderpos = new GameObject("ShoulderPos"); Debug.Log((object)"ShoulderPos"); if ((Object)(object)headpos != (Object)null) { shoulderpos.transform.SetParent(headpos.transform); shoulderpos.transform.localPosition = new Vector3(0.05f, -0.05f, 0f); } } headpos.transform.position = ((Component)GM.CurrentMovementManager.Head).transform.position; headpos.transform.eulerAngles = ((Component)GM.CurrentMovementManager.Head).transform.eulerAngles; if (Vector3.Distance(((FVRFireArm)rifle).StockPos.position, shoulderpos.transform.position) < shoulderdis && ((FVRPhysicalObject)rifle).IsAltHeld && ((FVRInteractiveObject)handle).IsHeld && ((((FVRInteractiveObject)handle).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)handle).m_hand.Input.AXButtonPressed) || (!((FVRInteractiveObject)handle).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)handle).m_hand.Input.TouchpadAxes.y <= -0.9f))) { if (((FVRPhysicalObject)rifle).m_isHardnessed) { wasHarnessed = true; slot = ((FVRPhysicalObject)rifle).m_quickbeltSlot; slot.CurObject = null; ((FVRPhysicalObject)rifle).m_quickbeltSlot = null; ((FVRPhysicalObject)rifle).m_isHardnessed = false; } if (!shouldered) { Gunholder.transform.position = ((FVRFireArm)rifle).Foregrip.transform.position; Gunholder.transform.eulerAngles = ((FVRFireArm)rifle).Foregrip.transform.eulerAngles; Gunref.transform.position = ((Component)rifle).transform.position; Gunref.transform.eulerAngles = ((Component)rifle).transform.eulerAngles; gunholdref = Gunref.transform.localPosition; ((FVRInteractiveObject)rifle).ForceBreakInteraction(); ((FVRInteractiveObject)grip).ForceBreakInteraction(); ((FVRPhysicalObject)rifle).StoreAndDestroyRigidbody(); shouldered = true; } } if (shouldered && GM.CurrentMovementManager.Hands[0].Input.GripPressed) { if (((FVRInteractiveObject)handle).m_isHeld) { if (((FVRInteractiveObject)handle).m_hand.Input.TriggerFloat >= 0.75f && (int)rifle.CurBoltHandleState == 0 && (int)rifle.FireSelector_Modes[rifle.m_fireSelectorMode].ModeType != 0) { rifle.Fire(); } ((Component)rifle).gameObject.transform.SetParent(Gunref.transform); ((Component)rifle).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f); ((Component)rifle).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f); Gunref.transform.localEulerAngles = Vector3.zero; Gunref.transform.localPosition = Vector3.SmoothDamp(Gunref.transform.localPosition, gunholdref, ref gunrecoilref, 0.1f); Gunholder.transform.position = ((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position; AxisLookAt(Gunholder.transform, shoulderpos.transform.position, Vector3.back); GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(false); } else if (!((FVRInteractiveObject)handle).m_isHeld) { if (wasHarnessed && (Object)(object)slot != (Object)null) { ((FVRPhysicalObject)rifle).m_quickbeltSlot = slot; slot.CurObject = (FVRPhysicalObject)(object)rifle; ((FVRPhysicalObject)rifle).m_isHardnessed = true; wasHarnessed = false; } ((FVRPhysicalObject)rifle).BeginInteractionThroughAltGrip(GM.CurrentMovementManager.Hands[0], grip); shouldered = false; } } else if (shouldered && !GM.CurrentMovementManager.Hands[0].Input.GripPressed) { if (wasHarnessed && (Object)(object)slot != (Object)null) { ((FVRPhysicalObject)rifle).m_quickbeltSlot = slot; slot.CurObject = (FVRPhysicalObject)(object)rifle; ((FVRPhysicalObject)rifle).m_isHardnessed = true; wasHarnessed = false; } ((Component)rifle).gameObject.transform.SetParent((Transform)null); ((FVRPhysicalObject)rifle).RecoverRigidbody(); GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(true); shouldered = false; } } private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f); } private void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(shotthis); } } public class LightSaber : MonoBehaviour { public LightsaberTrail trail; public AudioSource whooshAudio; public GameObject bladeGeo; public AR15HandleSightFlipper flipper; public FVRPhysicalObject main; public GameObject togglebutton; public GameObject bladeball; public Vector3 bladeballref; public AudioSource on; public AudioSource idle; public AudioSource off; public bool isOn = false; public float volumeref; public float pitchref; public float v; public float p; public GameObject bladeballtarg; public float bladeballSmooth; public float volumeSmooth; public float pitchSmooth; public float volumeMul; public float pitchMul; public Collider damcol; public GameObject mainobj; public Light l; public float lengthMul = 1.15f; public GameObject thisObj; public float speed; public Vector3 lastPosition; public float speedlim = 10f; public LayerMask lm; public GameObject bladeHolderScale; public AudioSource hitaud; public bool buttonpressed = false; public float bladelength = 0.935f; public float ThermalDamage = 100f; public void OnTriggerStay(Collider other) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) IFVRDamageable component = ((Component)other).GetComponent<IFVRDamageable>(); if (component == null && (Object)(object)other.attachedRigidbody != (Object)null) { component = ((Component)other.attachedRigidbody).GetComponent<IFVRDamageable>(); } if (component != null) { IFVRDamageable obj = component; Damage val = new Damage(); val.Class = (DamageClass)0; val.Dam_Thermal = ThermalDamage; val.Dam_Blunt = ThermalDamage * 0.5f; val.Dam_TotalEnergetic = ThermalDamage * 0.5f; val.point = ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass); Vector3 val2 = ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass) - ((Component)this).transform.position; val.hitNormal = ((Vector3)(ref val2)).normalized; Vector3 val3 = ((Component)this).transform.position - ((Component)other).transform.TransformPoint(other.attachedRigidbody.centerOfMass); val.strikeDir = ((Vector3)(ref val3)).normalized; obj.Damage(val); } FVRIgnitable component2 = ((Component)other).GetComponent<FVRIgnitable>(); if ((Object)(object)component2 == (Object)null && (Object)(object)other.attachedRigidbody != (Object)null) { ((Component)other.attachedRigidbody).GetComponent<FVRIgnitable>(); } if ((Object)(object)component2 != (Object)null) { FXM.Ignite(component2, ThermalDamage / 500f); } } public void OnTriggerEnter(Collider other) { IFVRDamageable component = ((Component)other).GetComponent<IFVRDamageable>(); if (component == null && (Object)(object)other.attachedRigidbody != (Object)null) { component = ((Component)other.attachedRigidbody).GetComponent<IFVRDamageable>(); } if (component != null) { hitaud.Play(); } FVRIgnitable component2 = ((Component)other).GetComponent<FVRIgnitable>(); if ((Object)(object)component2 == (Object)null && (Object)(object)other.attachedRigidbody != (Object)null) { ((Component)other.attachedRigidbody).GetComponent<FVRIgnitable>(); } if ((Object)(object)component2 != (Object)null) { hitaud.Play(); } } private void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) lastPosition = Vector3.zero; whooshAudio.volume = 0f; } private void Update() { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unk