Decompiled source of BoringFlamethrower v1.0.0
BoringFlamethrower.dll
Decompiled a week 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using HarmonyLib; using OpenScripts2; using OtherLoader; using Sodalite.Api; using Sodalite.Utilities; using UnityEditor; using UnityEngine; using UnityEngine.AI; using UnityEngine.UI; using VolksScripts; [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 VolksScripts { public class NVGPowerSwitch : FVRInteractiveObject { public PIPScope Scope; [HideInInspector] public bool Toggle = true; public override void SimpleInteraction(FVRViveHand hand) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); SM.PlayCoreSound((FVRPooledAudioType)10, ManagerSingleton<SM>.Instance.AudioEvent_AttachmentClick_Minor, ((Component)this).transform.position); if (Toggle) { Scope.enableNightvision = (Scope.enableThermal = false); } else { Scope.enableNightvision = (Scope.enableThermal = true); } Toggle = !Toggle; } } public class ANVIS21Control : MonoBehaviour { [Header("References")] public PIPScope scope; public Transform NVGObject; [Header("Positions")] public Vector3 OnLocalPosition; public Vector3 OffLocalPosition; public Vector3 OnLocalRotation; public Vector3 OffLocalRotation; [Header("Transition")] public float TransitionSpeed = 5f; [Header("Power State")] public bool IsPoweredOn = false; private Vector3 targetPos; private Quaternion targetRot; private void Start() { SetState(IsPoweredOn, instant: true); } private void Update() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)NVGObject != (Object)null) { NVGObject.localPosition = Vector3.Lerp(NVGObject.localPosition, targetPos, Time.deltaTime * TransitionSpeed); NVGObject.localRotation = Quaternion.Slerp(NVGObject.localRotation, targetRot, Time.deltaTime * TransitionSpeed); } if ((Object)(object)scope != (Object)null) { ((Behaviour)scope).enabled = IsPoweredOn; } } public void TogglePower() { SetState(!IsPoweredOn, instant: false); } public void SetState(bool on, bool instant) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0081: Unknown result type (might be due to invalid IL or missing references) IsPoweredOn = on; if (on) { targetPos = OnLocalPosition; targetRot = Quaternion.Euler(OnLocalRotation); } else { targetPos = OffLocalPosition; targetRot = Quaternion.Euler(OffLocalRotation); } if (instant && (Object)(object)NVGObject != (Object)null) { NVGObject.localPosition = targetPos; NVGObject.localRotation = targetRot; } if ((Object)(object)scope != (Object)null) { ((Behaviour)scope).enabled = on; } } private void OnTriggerEnter(Collider other) { TogglePower(); } } } public class ForceBindToHead : MonoBehaviour { [Tooltip("The object that should follow the player's head (e.g. NVG physical root).")] public GameObject phys; [Tooltip("Optional: if true, runs even when not equipped.")] public bool alwaysFollow = true; private Transform headTransform; private void Start() { if ((Object)(object)GM.CurrentMovementManager != (Object)null && (Object)(object)GM.CurrentMovementManager.Head != (Object)null) { headTransform = ((Component)GM.CurrentMovementManager.Head).transform; } else { Debug.LogWarning((object)"[ForceBindToHead] Could not find head transform."); } } private void FixedUpdate() { //IL_00ac: 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) if (!((Object)(object)phys == (Object)null) && (alwaysFollow || !((Object)(object)headTransform == (Object)null))) { if ((Object)(object)headTransform == (Object)null && (Object)(object)GM.CurrentMovementManager != (Object)null) { headTransform = ((Component)GM.CurrentMovementManager.Head).transform; } if ((Object)(object)phys.transform.parent != (Object)(object)headTransform) { phys.transform.SetParent(headTransform); } phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; } } } namespace JerryComponent { public class PNV57EControl : MonoBehaviour { public GameObject phys; public GameObject armreal; public GameObject armfake; public Vector3 velLinearWorldL; public Vector3 velLinearWorldR; public Transform slapdirUP; public Transform slapdirDown; public HeadAttachment HA; public PIPScope scopeL; public PIPScope scopeR; public GameObject powerknob; public float refgain; public float reflum; public AudioEvent flip; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public bool isheadmounted = true; public AudioSource whing; public float volref; private void Start() { scopeL.nvDef.nightVisionTargetBrightness = 0f; scopeL.nightVisionManualGainFactor = 0f; scopeR.nvDef.nightVisionTargetBrightness = 0f; scopeR.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; volref = 0f; whing.volume = 0f; whing.pitch = 0f; } private void FixedUpdate() { //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Invalid comparison between Unknown and I4 //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Invalid comparison between Unknown and I4 //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)scopeL).enabled = true; scopeL.UpdateParameters(); ((Behaviour)scopeR).enabled = true; scopeR.UpdateParameters(); if (isheadmounted) { armfake.transform.localEulerAngles = armreal.transform.localEulerAngles; phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; velLinearWorldL = GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld; velLinearWorldR = GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld; if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } } if (powerknob.transform.localEulerAngles.x > 15f) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 0f, ref reflum, offspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 0f, ref reflum, offspeed); whing.volume = Mathf.SmoothDamp(whing.volume, 0f, ref volref, offspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, 0f, ref volref, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x < 15f) { scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 1f, ref reflum, onspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 1f, ref reflum, onspeed); whing.volume = Mathf.SmoothDamp(whing.volume, 0.5f, ref volref, onspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, 1.3f, ref volref, onspeed); if (!started) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scopeL.nvDef.nightVisionTargetBrightness > 0.9f && scopeR.nvDef.nightVisionTargetBrightness > 0.9f) { started = true; } } } private void OnDestroy() { Object.Destroy((Object)(object)phys); } } public class PNV57EControlAdj : MonoBehaviour { public GameObject phys; public PIPScope scopeL; public PIPScope scopeR; public GameObject powerknob; public float refgain; public float reflum; public AudioEvent flip; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public bool isheadmounted = true; public AudioSource whing; public float volref; public float pitref; public float volume; public float pitch; public GameObject root; public int scopePara; private void Start() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) scopePara = GM.Options.SimulationOptions.ScopeRecursiveRendering; GM.Options.SimulationOptions.ScopeRecursiveRendering = 0; GM.RefreshQuality(); powerknob.transform.localEulerAngles = new Vector3(30f, 0f, 0f); scopeL.nvDef.nightVisionTargetBrightness = 0f; scopeL.nightVisionManualGainFactor = 0f; scopeR.nvDef.nightVisionTargetBrightness = 0f; scopeR.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; volref = 0f; pitref = 0f; whing.volume = 0f; whing.pitch = 0f; } private void FixedUpdate() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_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) root.transform.localPosition = new Vector3(0f, 0f, 0f); ((Behaviour)scopeL).enabled = true; scopeL.UpdateParameters(); ((Behaviour)scopeR).enabled = true; scopeR.UpdateParameters(); if (isheadmounted) { phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; } if (powerknob.transform.localEulerAngles.x > 15f) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 0f, ref reflum, offspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 0f, ref reflum, offspeed); whing.volume = Mathf.SmoothDamp(whing.volume, 0f, ref volref, offspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, 0f, ref pitref, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x < 15f) { scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 1f, ref reflum, onspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 1f, ref reflum, onspeed); whing.volume = Mathf.SmoothDamp(whing.volume, volume, ref volref, onspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, pitch, ref pitref, onspeed); if (!started) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scopeL.nvDef.nightVisionTargetBrightness > 0.9f && scopeR.nvDef.nightVisionTargetBrightness > 0.9f) { started = true; } } } private void OnDestroy() { Object.Destroy((Object)(object)phys); GM.Options.SimulationOptions.ScopeRecursiveRendering = scopePara; GM.RefreshQuality(); } } public class PVS7Control : MonoBehaviour { public GameObject phys; public GameObject armreal; public GameObject armfake; public Vector3 velLinearWorldL; public Vector3 velLinearWorldR; public Transform slapdirUP; public Transform slapdirDown; public HeadAttachment HA; public PIPScope scope; public GameObject powerknob; public float refgain; public float reflum; public AudioEvent flip; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public bool isheadmounted = true; private void Start() { scope.nvDef.nightVisionTargetBrightness = 0f; scope.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; } private void FixedUpdate() { //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Invalid comparison between Unknown and I4 //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)scope).enabled = true; scope.UpdateParameters(); if (isheadmounted) { armfake.transform.localEulerAngles = armreal.transform.localEulerAngles; phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; velLinearWorldL = GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld; velLinearWorldR = GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld; if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } } if (powerknob.transform.localEulerAngles.x > 15f) { scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 0f, ref reflum, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x < 15f) { scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 1f, ref reflum, onspeed); if (!started) { scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scope.nvDef.nightVisionTargetBrightness > 0.9f) { started = true; } } } private void OnDestroy() { Object.Destroy((Object)(object)phys); } } } public class Compass : FVRPhysicalObject { [Header("Compass Lid")] public Transform Lid; public float openRotationX = 90f; public float openRotationY = 0f; public float openRotationZ = 0f; public float closeRotationX = 0f; public float closeRotationY = 0f; public float closeRotationZ = 0f; public float lidRotationSpeed = 5f; public AudioSource openCloseAudioSource; public AudioClip openClip; public AudioClip closeClip; [Header("Compass Needle")] public Transform Needle; [Tooltip("The direction that is considered North. Default is (0,0,1) (Z+).")] public Vector3 NorthDirection = Vector3.forward; public float needleSmoothTime = 0.5f; public float needleWobbleAmount = 2f; public float needleWobbleSpeed = 5f; private bool isOpen = false; private bool isTouching = false; private Vector2 initTouch = Vector2.zero; private Vector2 lastTouchPoint = Vector2.zero; private float currentNeedleAngle = 0f; private float needleVelocity = 0f; private void Update() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ba: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0135: Unknown result type (might be due to invalid IL or missing references) Quaternion val = ((!isOpen) ? Quaternion.Euler(closeRotationX, closeRotationY, closeRotationZ) : Quaternion.Euler(openRotationX, openRotationY, openRotationZ)); if ((Object)(object)Lid != (Object)null) { Lid.localRotation = Quaternion.Lerp(Lid.localRotation, val, Time.deltaTime * lidRotationSpeed); } if ((Object)(object)Needle != (Object)null) { Vector3 normalized = ((Vector3)(ref NorthDirection)).normalized; Vector3 val2 = Vector3.ProjectOnPlane(((Component)this).transform.forward, Vector3.up); Vector3 val3 = Vector3.ProjectOnPlane(normalized, Vector3.up); float num = Mathf.Atan2(Vector3.Cross(val2, val3).y, Vector3.Dot(val2, val3)) * 57.29578f; float num2 = Mathf.Sin(Time.time * needleWobbleSpeed) * needleWobbleAmount; num += num2; currentNeedleAngle = Mathf.SmoothDampAngle(currentNeedleAngle, num, ref needleVelocity, needleSmoothTime); Needle.localRotation = Quaternion.Euler(0f, currentNeedleAngle, 0f); } } public void ToggleLid() { isOpen = !isOpen; if ((Object)(object)openCloseAudioSource != (Object)null) { openCloseAudioSource.PlayOneShot((!isOpen) ? closeClip : openClip); } } public override void UpdateInteraction(FVRViveHand hand) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_00b6: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if (hand.Input.BYButtonDown || hand.Input.AXButtonDown) { ToggleLid(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 val = lastTouchPoint; float y = (val - initTouch).y; if (y > 0.5f || y < -0.5f) { ToggleLid(); } initTouch = Vector2.zero; val = Vector2.zero; } lastTouchPoint = hand.Input.TouchpadAxes; } } public class FlamethrowerValve : FVRInteractiveObject { [Header("References")] public Transform RefFrame; public Transform Valve; [Header("Rotation Settings")] public Vector2 ValveRotRange = new Vector2(-50f, 50f); private float m_valveRot; [Header("Runtime")] public float Lerp = 0.5f; private Vector3 refDir = Vector3.one; public override void BeginInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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) Vector3 up = ((HandInput)(ref hand.Input)).Up; Vector3 val = Vector3.ProjectOnPlane(up, RefFrame.right); refDir = ((Vector3)(ref val)).normalized; ((FVRInteractiveObject)this).BeginInteraction(hand); } public override void UpdateInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_001e: 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_0026: 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_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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_00e9: 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) Vector3 up = ((HandInput)(ref hand.Input)).Up; Vector3 val = Vector3.ProjectOnPlane(up, RefFrame.right); Vector3 normalized = ((Vector3)(ref val)).normalized; float num = Mathf.Atan2(Vector3.Dot(RefFrame.right, Vector3.Cross(refDir, normalized)), Vector3.Dot(refDir, normalized)) * 57.29578f; num = Mathf.Clamp(num, -5f, 5f); m_valveRot += num; m_valveRot = Mathf.Clamp(m_valveRot, ValveRotRange.x, ValveRotRange.y); Valve.localEulerAngles = new Vector3(m_valveRot, 0f, 0f); Lerp = Mathf.InverseLerp(ValveRotRange.x, ValveRotRange.y, m_valveRot); refDir = normalized; ((FVRInteractiveObject)this).UpdateInteraction(hand); } } public class FlyingHotdog : MonoBehaviour { [Tooltip("Seconds to wait before the hotdog starts flying.")] public float waitTime = 2f; [Header("Speed Settings")] [Tooltip("Minimum speed the hotdog can fly.")] public float minFlySpeed = 3f; [Tooltip("Maximum speed the hotdog can fly.")] public float maxFlySpeed = 7f; [Tooltip("How often the hotdog changes direction (seconds).")] public float directionChangeInterval = 1f; [Tooltip("How much the hotdog can move up or down per direction change.")] public float verticalVariance = 2f; [Tooltip("How quickly the hotdog turns toward its new direction. Higher = snappier.")] public float turnSpeed = 3f; [Header("Flock Settings")] [Tooltip("Prefab of the hotdog to spawn.")] public GameObject hotdogPrefab; [Tooltip("Minimum number of hotdogs in a flock.")] public int minFlockSize = 3; [Tooltip("Maximum number of hotdogs in a flock.")] public int maxFlockSize = 8; [Tooltip("Spawn radius for flock members.")] public float flockRadius = 2f; private Rigidbody rb; private Vector3 flyDirection; private Vector3 targetDirection; private float currentFlySpeed; private static bool flockSpawned = false; private void Start() { //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //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) if (!flockSpawned && (Object)(object)hotdogPrefab != (Object)null && ((Object)((Component)this).gameObject).name.Contains("Spawner")) { flockSpawned = true; int num = Random.Range(minFlockSize, maxFlockSize + 1); for (int i = 0; i < num; i++) { Vector3 val = Random.insideUnitSphere * flockRadius; Object.Instantiate<GameObject>(hotdogPrefab, ((Component)this).transform.position + val, Quaternion.identity); } Object.Destroy((Object)(object)((Component)this).gameObject); return; } rb = ((Component)this).GetComponent<Rigidbody>(); if ((Object)(object)rb == (Object)null) { rb = ((Component)this).gameObject.AddComponent<Rigidbody>(); rb.useGravity = false; } currentFlySpeed = Random.Range(minFlySpeed, maxFlySpeed); SetInitialDirection(); flyDirection = targetDirection; ((MonoBehaviour)this).StartCoroutine(FlyRoutine()); } private IEnumerator FlyRoutine() { yield return (object)new WaitForSeconds(waitTime); RaycastHit hit = default(RaycastHit); while (true) { SetTargetDirection(); currentFlySpeed = Random.Range(minFlySpeed, maxFlySpeed); float timer = 0f; while (timer < directionChangeInterval) { FlyingHotdog flyingHotdog = this; Vector3 val = Vector3.Slerp(flyDirection, targetDirection, Time.deltaTime * (turnSpeed * 0.5f)); flyingHotdog.flyDirection = ((Vector3)(ref val)).normalized; Vector3 move = flyDirection * currentFlySpeed * Time.deltaTime; if (Physics.Raycast(((Component)this).transform.position, flyDirection, ref hit, ((Vector3)(ref move)).magnitude + 0.5f)) { targetDirection = Vector3.Reflect(flyDirection, ((RaycastHit)(ref hit)).normal); } else { rb.MovePosition(((Component)this).transform.position + move); } timer += Time.deltaTime; yield return null; } } } private void SetInitialDirection() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * 0.5f; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 1f, val.y); targetDirection = ((Vector3)(ref val2)).normalized; } private void SetTargetDirection() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; float num = Mathf.Clamp(Random.Range(0.5f, verticalVariance), 0.5f, verticalVariance); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(normalized.x, num, normalized.y); targetDirection = ((Vector3)(ref val)).normalized; } } [ExecuteInEditMode] public class HolographicSight : MonoBehaviour { public Transform VirtualQuad; public float Scale = 1f; public bool SizeCompensation = true; private MaterialPropertyBlock m_block; private void OnEnable() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown m_block = new MaterialPropertyBlock(); ((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block); } private void OnWillRenderObject() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0029: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.InverseTransformPoint(((Component)VirtualQuad).transform.position); m_block.SetVector("_Offset", Vector4.op_Implicit(val)); m_block.SetFloat("_Scale", Scale); m_block.SetFloat("_SizeCompensation", (!SizeCompensation) ? 0f : 1f); ((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block); } } namespace VolksScripts { public class BicLighter : FVRPhysicalObject { private bool m_isLit; private bool isTouching; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; [Header("Lighting Chance")] [Range(0f, 1f)] public float LightChance = 0.5f; private float currentChance; public Transform Flame; private float m_flame_min = 0.1f; private float m_flame_max = 0.85f; private float m_flame_cur = 0.1f; public AudioSource Audio_Lighter; public AudioClip AudioClip_Strike; public Transform[] FlameJoints; public float[] FlameWeights; public ParticleSystem Sparks; public AlloyAreaLight AlloyLight; public LayerMask LM_FireDamage; private RaycastHit m_hit; public override void Awake() { ((FVRPhysicalObject)this).Awake(); currentChance = LightChance; } public override void UpdateInteraction(FVRViveHand hand) { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if (hand.Input.AXButtonDown) { TryLight(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 lastTouchPoint = LastTouchPoint; float y = (lastTouchPoint - initTouch).y; if (y < -0.5f) { TryLight(); } initTouch = Vector2.zero; lastTouchPoint = Vector2.zero; } LastTouchPoint = hand.Input.TouchpadAxes; } public override void FVRUpdate() { //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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: 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_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); if (m_isLit) { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_max, Time.deltaTime * 2f); AlloyLight.Intensity = m_flame_cur * (Mathf.PerlinNoise(Time.time * 10f, ((Component)AlloyLight).transform.position.y) * 0.05f + 0.5f); } else { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_min, Time.deltaTime * 7f); } Flame.localScale = new Vector3(m_flame_cur, m_flame_cur, m_flame_cur); Quaternion val = Quaternion.Inverse(((Component)this).transform.rotation); val = Quaternion.Slerp(val, Random.rotation, Mathf.PerlinNoise(Time.time * 5f, 0f) * 0.3f); for (int i = 0; i < FlameJoints.Length; i++) { Quaternion val2 = Quaternion.Slerp(Quaternion.identity, val, FlameWeights[i] + Random.Range(-0.05f, 0.05f)); FlameJoints[i].localScale = new Vector3(Random.Range(0.95f, 1.05f), Random.Range(0.98f, 1.02f), Random.Range(0.95f, 1.05f)); FlameJoints[i].localRotation = Quaternion.Slerp(FlameJoints[i].localRotation, val2, Time.deltaTime * 6f); } if (!m_isLit) { return; } Vector3 position = FlameJoints[0].position; Vector3 position2 = FlameJoints[FlameJoints.Length - 1].position; Vector3 val3 = position2 - position; if (Physics.Raycast(position, ((Vector3)(ref val3)).normalized, ref m_hit, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(LM_FireDamage), (QueryTriggerInteraction)2)) { IFVRDamageable component = ((Component)((RaycastHit)(ref m_hit)).collider).gameObject.GetComponent<IFVRDamageable>(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<IFVRDamageable>(); } if (component != null) { IFVRDamageable obj = component; Damage val4 = new Damage(); val4.Class = (DamageClass)2; val4.Dam_Thermal = 50f; val4.Dam_TotalEnergetic = 50f; val4.point = ((RaycastHit)(ref m_hit)).point; val4.hitNormal = ((RaycastHit)(ref m_hit)).normal; val4.strikeDir = ((Component)this).transform.forward; obj.Damage(val4); } FVRIgnitable component2 = ((Component)((Component)((RaycastHit)(ref m_hit)).collider).transform).gameObject.GetComponent<FVRIgnitable>(); if ((Object)(object)component2 == (Object)null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<FVRIgnitable>(); } if ((Object)(object)component2 != (Object)null) { FXM.Ignite(component2, 0.1f); } } } private void TryLight() { Sparks.Emit(Random.Range(2, 3)); if (!m_isLit) { if (Random.value < currentChance) { m_isLit = true; Audio_Lighter.PlayOneShot(AudioClip_Strike, 0.3f); ((Component)Flame).gameObject.SetActive(true); currentChance = LightChance; } else { Audio_Lighter.PlayOneShot(AudioClip_Strike, 0.3f); currentChance += 0.1f; currentChance = Mathf.Clamp01(currentChance); } } else { m_isLit = false; ((Component)Flame).gameObject.SetActive(false); currentChance = LightChance; } } } public class Lighter : FVRPhysicalObject { private bool m_isLit; private bool isTouching; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; public Transform Flame; private float m_flame_min = 0.1f; private float m_flame_max = 0.85f; private float m_flame_cur = 0.1f; public AudioSource Audio_Lighter; public AudioClip AudioClip_Strike; public AudioClip AudioClip_Extinguish; public Transform[] FlameJoints; public float[] FlameWeights; public ParticleSystem Sparks; public AlloyAreaLight AlloyLight; public LayerMask LM_FireDamage; private RaycastHit m_hit; public override void UpdateInteraction(FVRViveHand hand) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_00b6: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if (hand.Input.BYButtonDown || hand.Input.AXButtonDown) { Light(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 lastTouchPoint = LastTouchPoint; float y = (lastTouchPoint - initTouch).y; if (y > 0.5f || y < -0.5f) { Light(); } initTouch = Vector2.zero; lastTouchPoint = Vector2.zero; } LastTouchPoint = hand.Input.TouchpadAxes; } public override void FVRUpdate() { //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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: 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_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); if (m_isLit) { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_max, Time.deltaTime * 2f); AlloyLight.Intensity = m_flame_cur * (Mathf.PerlinNoise(Time.time * 10f, ((Component)AlloyLight).transform.position.y) * 0.05f + 0.5f); } else { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_min, Time.deltaTime * 7f); } Flame.localScale = new Vector3(m_flame_cur, m_flame_cur, m_flame_cur); Quaternion val = Quaternion.Inverse(((Component)this).transform.rotation); val = Quaternion.Slerp(val, Random.rotation, Mathf.PerlinNoise(Time.time * 5f, 0f) * 0.3f); for (int i = 0; i < FlameJoints.Length; i++) { Quaternion val2 = Quaternion.Slerp(Quaternion.identity, val, FlameWeights[i] + Random.Range(-0.05f, 0.05f)); FlameJoints[i].localScale = new Vector3(Random.Range(0.95f, 1.05f), Random.Range(0.98f, 1.02f), Random.Range(0.95f, 1.05f)); FlameJoints[i].localRotation = Quaternion.Slerp(FlameJoints[i].localRotation, val2, Time.deltaTime * 6f); } if (!m_isLit) { return; } Vector3 position = FlameJoints[0].position; Vector3 position2 = FlameJoints[FlameJoints.Length - 1].position; Vector3 val3 = position2 - position; if (Physics.Raycast(position, ((Vector3)(ref val3)).normalized, ref m_hit, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(LM_FireDamage), (QueryTriggerInteraction)2)) { IFVRDamageable component = ((Component)((RaycastHit)(ref m_hit)).collider).gameObject.GetComponent<IFVRDamageable>(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<IFVRDamageable>(); } if (component != null) { IFVRDamageable obj = component; Damage val4 = new Damage(); val4.Class = (DamageClass)2; val4.Dam_Thermal = 50f; val4.Dam_TotalEnergetic = 50f; val4.point = ((RaycastHit)(ref m_hit)).point; val4.hitNormal = ((RaycastHit)(ref m_hit)).normal; val4.strikeDir = ((Component)this).transform.forward; obj.Damage(val4); } FVRIgnitable component2 = ((Component)((Component)((RaycastHit)(ref m_hit)).collider).transform).gameObject.GetComponent<FVRIgnitable>(); if ((Object)(object)component2 == (Object)null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<FVRIgnitable>(); } if ((Object)(object)component2 != (Object)null) { FXM.Ignite(component2, 0.1f); } } } private void Light() { if (!m_isLit) { Sparks.Emit(Random.Range(2, 3)); m_isLit = true; Audio_Lighter.PlayOneShot(AudioClip_Strike, 0.3f); ((Component)Flame).gameObject.SetActive(true); } else { m_isLit = false; Audio_Lighter.PlayOneShot(AudioClip_Extinguish, 0.3f); ((Component)Flame).gameObject.SetActive(false); } } } } namespace MeatKit { public class HideInNormalInspectorAttribute : PropertyAttribute { } } namespace Volks.BoringFlamethrower { [BepInPlugin("Volks.BoringFlamethrower", "BoringFlamethrower", "1.0.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class BoringFlamethrowerPlugin : BaseUnityPlugin { private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static ManualLogSource Logger; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; LoadAssets(); } private void LoadAssets() { Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Volks.BoringFlamethrower"); OtherLoader.RegisterDirectLoad(BasePath, "Volks.BoringFlamethrower", "", "", "boringflamethrower", ""); } } } namespace SimpleLightProbePlacer { [RequireComponent(typeof(LightProbeGroup))] [AddComponentMenu("Rendering/Light Probe Group Control")] public class LightProbeGroupControl : MonoBehaviour { [SerializeField] private float m_mergeDistance = 0.5f; [SerializeField] private bool m_usePointLights = true; [SerializeField] private float m_pointLightRange = 1f; private int m_mergedProbes; private LightProbeGroup m_lightProbeGroup; public float MergeDistance { get { return m_mergeDistance; } set { m_mergeDistance = value; } } public int MergedProbes => m_mergedProbes; public bool UsePointLights { get { return m_usePointLights; } set { m_usePointLights = value; } } public float PointLightRange { get { return m_pointLightRange; } set { m_pointLightRange = value; } } public LightProbeGroup LightProbeGroup { get { if ((Object)(object)m_lightProbeGroup != (Object)null) { return m_lightProbeGroup; } return m_lightProbeGroup = ((Component)this).GetComponent<LightProbeGroup>(); } } public void DeleteAll() { LightProbeGroup.probePositions = null; m_mergedProbes = 0; } public void Create() { DeleteAll(); List<Vector3> list = CreatePositions(); list.AddRange(CreateAroundPointLights(m_pointLightRange)); list = MergeClosestPositions(list, m_mergeDistance, out m_mergedProbes); ApplyPositions(list); } public void Merge() { if (LightProbeGroup.probePositions != null) { List<Vector3> source = MergeClosestPositions(LightProbeGroup.probePositions.ToList(), m_mergeDistance, out m_mergedProbes); source = source.Select((Vector3 x) => ((Component)this).transform.TransformPoint(x)).ToList(); ApplyPositions(source); } } private void ApplyPositions(List<Vector3> positions) { LightProbeGroup.probePositions = positions.Select((Vector3 x) => ((Component)this).transform.InverseTransformPoint(x)).ToArray(); } private static List<Vector3> CreatePositions() { LightProbeVolume[] array = Object.FindObjectsOfType<LightProbeVolume>(); if (array.Length == 0) { return new List<Vector3>(); } List<Vector3> list = new List<Vector3>(); for (int i = 0; i < array.Length; i++) { list.AddRange(array[i].CreatePositions()); } return list; } private static List<Vector3> CreateAroundPointLights(float range) { List<Light> list = (from x in Object.FindObjectsOfType<Light>() where (int)x.type == 2 select x).ToList(); if (list.Count == 0) { return new List<Vector3>(); } List<Vector3> list2 = new List<Vector3>(); for (int i = 0; i < list.Count; i++) { list2.AddRange(CreatePositionsAround(((Component)list[i]).transform, range)); } return list2; } private static List<Vector3> MergeClosestPositions(List<Vector3> positions, float distance, out int mergedCount) { //IL_00a2: 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_0127: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) if (positions == null) { mergedCount = 0; return new List<Vector3>(); } int count = positions.Count; bool flag = false; while (!flag) { Dictionary<Vector3, List<Vector3>> dictionary = new Dictionary<Vector3, List<Vector3>>(); for (int i = 0; i < positions.Count; i++) { List<Vector3> list = positions.Where(delegate(Vector3 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = x - positions[i]; return ((Vector3)(ref val2)).magnitude < distance; }).ToList(); if (list.Count > 0 && !dictionary.ContainsKey(positions[i])) { dictionary.Add(positions[i], list); } } positions.Clear(); List<Vector3> list2 = dictionary.Keys.ToList(); for (int j = 0; j < list2.Count; j++) { Vector3 center = dictionary[list2[j]].Aggregate(Vector3.zero, (Vector3 result, Vector3 target) => result + target) / (float)dictionary[list2[j]].Count; if (!positions.Exists((Vector3 x) => x == center)) { positions.Add(center); } } flag = positions.Select((Vector3 x) => positions.Where(delegate(Vector3 y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) int result2; if (y != x) { Vector3 val = y - x; result2 = ((((Vector3)(ref val)).magnitude < distance) ? 1 : 0); } else { result2 = 0; } return (byte)result2 != 0; })).All((IEnumerable<Vector3> x) => !x.Any()); } mergedCount = count - positions.Count; return positions; } public static List<Vector3> CreatePositionsAround(Transform transform, float range) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) Vector3[] source = (Vector3[])(object)new Vector3[8] { new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, -0.5f) }; return source.Select((Vector3 x) => transform.TransformPoint(x * range)).ToList(); } } public enum LightProbeVolumeType { Fixed, Float } [AddComponentMenu("Rendering/Light Probe Volume")] public class LightProbeVolume : TransformVolume { [SerializeField] private LightProbeVolumeType m_type = LightProbeVolumeType.Fixed; [SerializeField] private Vector3 m_densityFixed = Vector3.one; [SerializeField] private Vector3 m_densityFloat = Vector3.one; public LightProbeVolumeType Type { get { return m_type; } set { m_type = value; } } public Vector3 Density { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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) return (m_type != 0) ? m_densityFloat : m_densityFixed; } set { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (m_type == LightProbeVolumeType.Fixed) { m_densityFixed = value; } else { m_densityFloat = value; } } } public static Color EditorColor => new Color(1f, 0.9f, 0.25f); public List<Vector3> CreatePositions() { return CreatePositions(m_type); } public List<Vector3> CreatePositions(LightProbeVolumeType type) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_001a: Unknown result type (might be due to invalid IL or missing references) return (type != 0) ? CreatePositionsFloat(((Component)this).transform, base.Origin, base.Size, Density) : CreatePositionsFixed(((Component)this).transform, base.Origin, base.Size, Density); } public static List<Vector3> CreatePositionsFixed(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density) { //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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) List<Vector3> list = new List<Vector3>(); Vector3 val = origin; float num = size.x / (float)Mathf.FloorToInt(density.x); float num2 = size.y / (float)Mathf.FloorToInt(density.y); float num3 = size.z / (float)Mathf.FloorToInt(density.z); val -= size * 0.5f; for (int i = 0; (float)i <= density.x; i++) { for (int j = 0; (float)j <= density.y; j++) { for (int k = 0; (float)k <= density.z; k++) { Vector3 val2 = val + new Vector3((float)i * num, (float)j * num2, (float)k * num3); val2 = volumeTransform.TransformPoint(val2); list.Add(val2); } } } return list; } public static List<Vector3> CreatePositionsFloat(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density) { //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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_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_005a: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) List<Vector3> list = new List<Vector3>(); Vector3 val = origin; int num = Mathf.FloorToInt(size.x / density.x); int num2 = Mathf.FloorToInt(size.y / density.y); int num3 = Mathf.FloorToInt(size.z / density.z); val -= size * 0.5f; val.x += (size.x - (float)num * density.x) * 0.5f; val.y += (size.y - (float)num2 * density.y) * 0.5f; val.z += (size.z - (float)num3 * density.z) * 0.5f; for (int i = 0; i <= num; i++) { for (int j = 0; j <= num2; j++) { for (int k = 0; k <= num3; k++) { Vector3 val2 = val + new Vector3((float)i * density.x, (float)j * density.y, (float)k * density.z); val2 = volumeTransform.TransformPoint(val2); list.Add(val2); } } } return list; } } [AddComponentMenu("")] public class TransformVolume : MonoBehaviour { [SerializeField] private Volume m_volume = new Volume(Vector3.zero, Vector3.one); public Volume Volume { get { return m_volume; } set { m_volume = value; } } public Vector3 Origin => m_volume.Origin; public Vector3 Size => m_volume.Size; public bool IsInBounds(Vector3[] points) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = GetBounds(); return ((Bounds)(ref bounds)).Intersects(GetBounds(points)); } public bool IsOnBorder(Vector3[] points) { if (points.All((Vector3 x) => !IsInVolume(x))) { return false; } return !points.All(IsInVolume); } public bool IsInVolume(Vector3[] points) { return points.All(IsInVolume); } public bool IsInVolume(Vector3 position) { //IL_000d: 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_0020: Unknown result type (might be due to invalid IL or missing references) Plane val = default(Plane); for (int i = 0; i < 6; i++) { ((Plane)(ref val))..ctor(GetSideDirection(i), GetSidePosition(i)); if (((Plane)(ref val)).GetSide(position)) { return false; } } return true; } public Vector3[] GetCorners() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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) Vector3[] array = (Vector3[])(object)new Vector3[8] { new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, -0.5f) }; for (int i = 0; i < array.Length; i++) { ref Vector3 reference = ref array[i]; reference.x *= m_volume.Size.x; ref Vector3 reference2 = ref array[i]; reference2.y *= m_volume.Size.y; ref Vector3 reference3 = ref array[i]; reference3.z *= m_volume.Size.z; ref Vector3 reference4 = ref array[i]; reference4 = ((Component)this).transform.TransformPoint(m_volume.Origin + array[i]); } return array; } public Bounds GetBounds() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return GetBounds(GetCorners()); } public Bounds GetBounds(Vector3[] points) { //IL_0002: 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_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_0035: 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_0051: 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_006a: 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) Vector3 val = points.Aggregate(Vector3.zero, (Vector3 result, Vector3 point) => result + point) / (float)points.Length; Bounds result2 = default(Bounds); ((Bounds)(ref result2))..ctor(val, Vector3.zero); for (int i = 0; i < points.Length; i++) { ((Bounds)(ref result2)).Encapsulate(points[i]); } return result2; } public GameObject[] GetGameObjectsInBounds(LayerMask layerMask) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] array = Object.FindObjectsOfType<MeshRenderer>(); List<GameObject> list = new List<GameObject>(); Bounds bounds = GetBounds(); for (int i = 0; i < array.Length; i++) { if (!((Object)(object)((Component)array[i]).gameObject == (Object)(object)((Component)((Component)this).transform).gameObject) && !((Object)(object)((Component)array[i]).GetComponent<TransformVolume>() != (Object)null) && ((1 << ((Component)array[i]).gameObject.layer) & ((LayerMask)(ref layerMask)).value) != 0 && ((Bounds)(ref bounds)).Intersects(((Renderer)array[i]).bounds)) { list.Add(((Component)array[i]).gameObject); } } return list.ToArray(); } public Vector3 GetSideDirection(int side) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_002e: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: 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) Vector3[] array = (Vector3[])(object)new Vector3[6]; Vector3 right = Vector3.right; Vector3 up = Vector3.up; Vector3 forward = Vector3.forward; array[0] = right; ref Vector3 reference = ref array[1]; reference = -right; array[2] = up; ref Vector3 reference2 = ref array[3]; reference2 = -up; array[4] = forward; ref Vector3 reference3 = ref array[5]; reference3 = -forward; return ((Component)this).transform.TransformDirection(array[side]); } public Vector3 GetSidePosition(int side) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_002e: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[6]; Vector3 right = Vector3.right; Vector3 up = Vector3.up; Vector3 forward = Vector3.forward; array[0] = right; ref Vector3 reference = ref array[1]; reference = -right; array[2] = up; ref Vector3 reference2 = ref array[3]; reference2 = -up; array[4] = forward; ref Vector3 reference3 = ref array[5]; reference3 = -forward; return ((Component)this).transform.TransformPoint(array[side] * GetSizeAxis(side) + m_volume.Origin); } public float GetSizeAxis(int side) { //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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) switch (side) { case 0: case 1: return m_volume.Size.x * 0.5f; case 2: case 3: return m_volume.Size.y * 0.5f; default: return m_volume.Size.z * 0.5f; } } public static Volume EditorVolumeControl(TransformVolume transformVolume, float handleSize, Color color) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0287: 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_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0340: 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_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown Vector3[] array = (Vector3[])(object)new Vector3[6]; Transform transform = ((Component)transformVolume).transform; Handles.color = color; for (int i = 0; i < array.Length; i++) { ref Vector3 reference = ref array[i]; reference = transformVolume.GetSidePosition(i); } ref Vector3 reference2 = ref array[0]; reference2 = Handles.Slider(array[0], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference3 = ref array[1]; reference3 = Handles.Slider(array[1], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference4 = ref array[2]; reference4 = Handles.Slider(array[2], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference5 = ref array[3]; reference5 = Handles.Slider(array[3], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference6 = ref array[4]; reference6 = Handles.Slider(array[4], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference7 = ref array[5]; reference7 = Handles.Slider(array[5], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f); Vector3 origin = default(Vector3); origin.x = transform.InverseTransformPoint((array[0] + array[1]) * 0.5f).x; origin.y = transform.InverseTransformPoint((array[2] + array[3]) * 0.5f).y; origin.z = transform.InverseTransformPoint((array[4] + array[5]) * 0.5f).z; Vector3 size = default(Vector3); size.x = transform.InverseTransformPoint(array[0]).x - transform.InverseTransformPoint(array[1]).x; size.y = transform.InverseTransformPoint(array[2]).y - transform.InverseTransformPoint(array[3]).y; size.z = transform.InverseTransformPoint(array[4]).z - transform.InverseTransformPoint(array[5]).z; return new Volume(origin, size); } } [Serializable] public struct Volume { [SerializeField] private Vector3 m_origin; [SerializeField] private Vector3 m_size; public Vector3 Origin => m_origin; public Vector3 Size => m_size; public Volume(Vector3 origin, Vector3 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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) m_origin = origin; m_size = size; } public static bool operator ==(Volume left, Volume right) { return left.Equals(right); } public static bool operator !=(Volume left, Volume right) { return !left.Equals(right); } public bool Equals(Volume other) { //IL_0002: 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) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) return Origin == other.Origin && Size == other.Size; } public override bool Equals(object obj) { if (object.ReferenceEquals(null, obj)) { return false; } return obj is Volume && Equals((Volume)obj); } public override int GetHashCode() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 origin = Origin; int num = ((object)(Vector3)(ref origin)).GetHashCode() * 397; Vector3 size = Size; return num ^ ((object)(Vector3)(ref size)).GetHashCode(); } public override string ToString() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return $"Origin: {Origin}, Size: {Size}"; } } } namespace nrgill28.AtlasSampleScene { public class CTF_CaptureZone : MonoBehaviour { public CTF_Manager Manager; public CTF_Team Team; public void OnTriggerEnter(Collider other) { CTF_Flag component = ((Component)other).GetComponent<CTF_Flag>(); if (Object.op_Implicit((Object)(object)component) && component.Team != Team) { Manager.FlagCaptured(component); } } } public class CTF_Flag : FVRPhysicalObject { [Header("Flag stuffs")] public CTF_Team Team; public float RespawnDelay = 10f; public Vector3 FloorOffset = new Vector3(0f, 0.25f, 0f); private Vector3 _resetPosition; private Quaternion _resetRotation; private Transform _followTransform; private bool _isHeld; private bool _isTaken; private float _timer; private CTF_Sosig _heldBy; public override void Awake() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((FVRPhysicalObject)this).Awake(); _resetPosition = ((Component)this).transform.position; _resetRotation = ((Component)this).transform.rotation; } private void Update() { if (_isTaken && !_isHeld) { _timer -= Time.deltaTime; if (_timer < 0f) { ReturnFlag(); } } } public void Take() { _isHeld = true; _isTaken = true; } public void Drop() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).IsHeld = false; _timer = RespawnDelay; NavMeshHit val = default(NavMeshHit); NavMesh.SamplePosition(((Component)thi