using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using H3VRUtils; using HarmonyLib; using OpenScripts2; using OtherLoader; using Steamworks; using UnityEngine; using UnityEngine.Serialization; using UnityEngine.UI; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [ExecuteInEditMode] public class HolographicSightCustom : 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().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().SetPropertyBlock(m_block); } } namespace ColorChangerSystem { public class CCSMaterialDefinition : MonoBehaviour { [Serializable] public class MaterialSet { public Material[] Materials; } public GameObject Parent; public MaterialSet[] MaterialSets; [HideInInspector] public CCSMaterialDefinitionManager temp; public void Awake() { if ((Object)(object)Parent.gameObject.GetComponent() == (Object)null) { temp = Parent.gameObject.AddComponent(); temp.MaterialSetss = MaterialSets; Debug.Log((object)("Added Material Definition to " + ((Object)Parent.gameObject).name)); } } } public class CCSMaterialDefinitionManager : MonoBehaviour { [Tooltip("Use CCSMaterialDefinition instead!")] public CCSMaterialDefinition.MaterialSet[] MaterialSetss; } public class ColorChangerBase : FVRPhysicalObject { public FVRPhysicalObject Base; public ColorChangerSlider SliderRed; public ColorChangerSlider SliderGreen; public ColorChangerSlider SliderBlue; public ColorChangerSlider SliderAlpha; public GameObject RaycastLineRed; public GameObject RaycastLineCyan; public Transform LaserPoint; public float RaycastDistance = 10f; public LayerMask RaycastLayerMask; [HideInInspector] public CCSMaterialDefinitionManager MaterialDefinition; [HideInInspector] public CCSMaterialDefinition.MaterialSet CurrentMaterialSetData; [HideInInspector] public FVRPhysicalObject CurrentObject; [HideInInspector] public int CurrentMaterialSetIndex = 0; public FVRPointableButton DecreaseButton; public FVRPointableButton IncreaseButton; public Text CurrentMaterialSet; public Text CurrentColor; public Text CurrentObjectName; public MeshRenderer ColorDisplay; private CCSMaterialDefinitionManager mat; private CCSMaterialDefinition mat2; public void FixedUpdate() { //IL_00c7: 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_00e0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRInteractiveObject)Base).m_hand != (Object)null) { RaycastLineRed.SetActive(true); RaycastLineCyan.SetActive(false); if ((!((FVRInteractiveObject)Base).m_hand.IsInStreamlinedMode || (!((FVRInteractiveObject)Base).m_hand.Input.AXButtonPressed && !((FVRInteractiveObject)Base).m_hand.Input.BYButtonPressed)) && (((FVRInteractiveObject)Base).m_hand.IsInStreamlinedMode || !((FVRInteractiveObject)Base).m_hand.Input.TouchpadPressed)) { return; } RaycastLineRed.SetActive(false); RaycastLineCyan.SetActive(true); RaycastHit val = default(RaycastHit); if (!Physics.Raycast(LaserPoint.position, LaserPoint.forward, ref val, RaycastDistance, LayerMask.op_Implicit(RaycastLayerMask))) { return; } FVRPhysicalObject componentInParent = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent(); if (!((Object)(object)componentInParent != (Object)null) || !((Object)(object)componentInParent != (Object)(object)CurrentObject)) { return; } CurrentObject = componentInParent; if ((Object)(object)CurrentObject.ObjectWrapper != (Object)null && CurrentObject.ObjectWrapper.ItemID != null) { CurrentObjectName.text = "Object ID: " + CurrentObject.ObjectWrapper.ItemID; } CurrentMaterialSetIndex = 0; mat = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent(); mat2 = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent(); Debug.Log((object)$"Checking for components on {((Object)CurrentObject).name}"); Debug.Log((object)$"CCSMaterialDefinitionManager exists: {(Object)(object)mat != (Object)null}"); Debug.Log((object)$"CCSMaterialDefinition exists: {(Object)(object)mat2 != (Object)null}"); if ((Object)(object)mat != (Object)null) { MaterialDefinition = mat; Debug.Log((object)$"Got CCSMaterialDefinition for {((Object)CurrentObject).name}"); return; } if ((Object)(object)mat2 != (Object)null) { CCSMaterialDefinitionManager cCSMaterialDefinitionManager = ((Component)CurrentObject).gameObject.AddComponent(); cCSMaterialDefinitionManager.MaterialSetss = mat2.MaterialSets; MaterialDefinition = cCSMaterialDefinitionManager; Debug.Log((object)$"Got CCSMaterialDefinition for {((Object)CurrentObject).name}"); return; } CCSMaterialDefinitionManager cCSMaterialDefinitionManager2 = ((Component)CurrentObject).gameObject.AddComponent(); cCSMaterialDefinitionManager2.MaterialSetss = new CCSMaterialDefinition.MaterialSet[1]; cCSMaterialDefinitionManager2.MaterialSetss[0] = new CCSMaterialDefinition.MaterialSet(); cCSMaterialDefinitionManager2.MaterialSetss[0].Materials = ((Component)CurrentObject).GetComponentsInChildren().SelectMany((Renderer m) => m.materials).ToArray(); MaterialDefinition = cCSMaterialDefinitionManager2; Debug.Log((object)$"Created new CCSMaterialDefinition for {((Object)CurrentObject).name}"); } else { RaycastLineRed.SetActive(false); RaycastLineCyan.SetActive(false); } } public void NextMaterialSet() { //IL_012b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)MaterialDefinition == (Object)null || MaterialDefinition.MaterialSetss == null || MaterialDefinition.MaterialSetss.Length == 0) { Debug.LogWarning((object)$"[{((Object)CurrentObject).name}] Cannot change material set. MaterialDefinition is null: {(Object)(object)MaterialDefinition == (Object)null}, MaterialSets is null: {(Object)(object)MaterialDefinition != (Object)null && MaterialDefinition.MaterialSetss == null}, MaterialSets length: {(((Object)(object)MaterialDefinition != (Object)null && MaterialDefinition.MaterialSetss != null) ? MaterialDefinition.MaterialSetss.Length : 0)}"); return; } CurrentMaterialSetIndex++; if (CurrentMaterialSetIndex >= MaterialDefinition.MaterialSetss.Length) { CurrentMaterialSetIndex = 0; } CurrentMaterialSet.text = "Material Set: " + CurrentMaterialSetIndex; SM.PlayGlobalUISound((GlobalUISound)1, ((Component)this).transform.position); } public void PreviousMaterialSet() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)MaterialDefinition == (Object)null || MaterialDefinition.MaterialSetss == null || MaterialDefinition.MaterialSetss.Length == 0) { Debug.LogWarning((object)$"[{((Object)CurrentObject).name}] Cannot change material set. MaterialDefinition is null: {(Object)(object)MaterialDefinition == (Object)null}, MaterialSets is null: {(Object)(object)MaterialDefinition != (Object)null && MaterialDefinition.MaterialSetss == null}, MaterialSets length: {(((Object)(object)MaterialDefinition != (Object)null && MaterialDefinition.MaterialSetss != null) ? MaterialDefinition.MaterialSetss.Length : 0)}"); return; } CurrentMaterialSetIndex--; if (CurrentMaterialSetIndex < 0) { CurrentMaterialSetIndex = MaterialDefinition.MaterialSetss.Length - 1; } CurrentMaterialSet.text = "Material Set: " + CurrentMaterialSetIndex; SM.PlayGlobalUISound((GlobalUISound)1, ((Component)this).transform.position); } public void SetMaterialColor(ColorChangerSlider.ColorChangerType color, byte value) { //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)MaterialDefinition == (Object)null || CurrentMaterialSetIndex >= MaterialDefinition.MaterialSetss.Length) { Debug.LogWarning((object)$"[{((Object)CurrentObject).name}] Cannot set material color. MaterialDefinition is null: {(Object)(object)MaterialDefinition == (Object)null}, CurrentMaterialSetIndex: {CurrentMaterialSetIndex}, MaterialSets length: {(((Object)(object)MaterialDefinition != (Object)null && MaterialDefinition.MaterialSetss != null) ? MaterialDefinition.MaterialSetss.Length : 0)}"); return; } Color32 val = default(Color32); ((Color32)(ref val))..ctor((byte)0, (byte)0, (byte)0, (byte)0); bool flag = false; Material[] materials = MaterialDefinition.MaterialSetss[CurrentMaterialSetIndex].Materials; Color color2 = default(Color); foreach (Material val2 in materials) { if ((Object)(object)val2 != (Object)null) { ((Color)(ref color2))..ctor((float)(int)SliderRed.CurrentValue / 255f, (float)(int)SliderGreen.CurrentValue / 255f, (float)(int)SliderBlue.CurrentValue / 255f, (float)(int)SliderAlpha.CurrentValue / 255f); switch (color) { case ColorChangerSlider.ColorChangerType.Red: color2.r = (float)(int)value / 255f; break; case ColorChangerSlider.ColorChangerType.Green: color2.g = (float)(int)value / 255f; break; case ColorChangerSlider.ColorChangerType.Blue: color2.b = (float)(int)value / 255f; break; case ColorChangerSlider.ColorChangerType.Alpha: color2.a = (float)(int)value / 255f; break; } val2.color = color2; ((Renderer)ColorDisplay).material.color = color2; if (!flag) { ((Color32)(ref val))..ctor((byte)(color2.r * 255f), (byte)(color2.g * 255f), (byte)(color2.b * 255f), (byte)(color2.a * 255f)); flag = true; } } } if (flag) { CurrentColor.text = "Color: " + ColorUtility.ToHtmlStringRGBA(Color32.op_Implicit(val)); } } } public class ColorChangerSlider : MonoBehaviour { public enum ColorChangerType { Red, Green, Blue, Alpha } public ColorChangerBase colorChanger; public ColorChangerType colorChangerType; public Text CurrentColorValue; public byte CurrentValue = byte.MaxValue; public void ColorValuePlusOne() { CurrentValue = (byte)Mathf.Clamp(CurrentValue + 1, 0, 255); UpdateColorValue(CurrentValue); } public void ColorValueMinusOne() { CurrentValue = (byte)Mathf.Clamp(CurrentValue - 1, 0, 255); UpdateColorValue(CurrentValue); } public void ColorValuePlusTen() { CurrentValue = (byte)Mathf.Clamp(CurrentValue + 10, 0, 255); UpdateColorValue(CurrentValue); } public void ColorValueMinusTen() { CurrentValue = (byte)Mathf.Clamp(CurrentValue - 10, 0, 255); UpdateColorValue(CurrentValue); } private void UpdateColorValue(byte CurrentValue) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)colorChanger == (Object)null)) { switch (colorChangerType) { case ColorChangerType.Red: colorChanger.SetMaterialColor(ColorChangerType.Red, CurrentValue); break; case ColorChangerType.Green: colorChanger.SetMaterialColor(ColorChangerType.Green, CurrentValue); break; case ColorChangerType.Blue: colorChanger.SetMaterialColor(ColorChangerType.Blue, CurrentValue); break; case ColorChangerType.Alpha: colorChanger.SetMaterialColor(ColorChangerType.Alpha, CurrentValue); break; } CurrentColorValue.text = CurrentValue.ToString(); SM.PlayGlobalUISound((GlobalUISound)1, ((Component)this).transform.position); } } } } namespace Niko666.DeltaForce_M7_Spectrum_Blitz { [BepInPlugin("Niko666.DeltaForce_M7_Spectrum_Blitz", "DeltaForce_M7_Spectrum_Blitz", "1.1.1")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class DeltaForce_M7_Spectrum_BlitzPlugin : 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(), "Niko666.DeltaForce_M7_Spectrum_Blitz"); OtherLoader.RegisterDirectLoad(BasePath, "Niko666.DeltaForce_M7_Spectrum_Blitz", "", "", "m7spectrumblitz", ""); } } } public class DynamicBoneDemo1 : MonoBehaviour { public GameObject m_Player; private float m_weight = 1f; private void Update() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_006a: Unknown result type (might be due to invalid IL or missing references) m_Player.transform.Rotate(new Vector3(0f, Input.GetAxis("Horizontal") * Time.deltaTime * 200f, 0f)); m_Player.transform.Translate(((Component)this).transform.forward * Input.GetAxis("Vertical") * Time.deltaTime * 4f); } private void OnGUI() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(50f, 50f, 200f, 24f), "Press arrow key to move"); Animation componentInChildren = m_Player.GetComponentInChildren(); ((Behaviour)componentInChildren).enabled = GUI.Toggle(new Rect(50f, 70f, 200f, 24f), ((Behaviour)componentInChildren).enabled, "Play Animation"); DynamicBone[] components = m_Player.GetComponents(); GUI.Label(new Rect(50f, 100f, 200f, 24f), "Choose dynamic bone:"); DynamicBone obj = components[0]; bool enabled = GUI.Toggle(new Rect(50f, 120f, 100f, 24f), ((Behaviour)components[0]).enabled, "Breasts"); ((Behaviour)components[1]).enabled = enabled; ((Behaviour)obj).enabled = enabled; ((Behaviour)components[2]).enabled = GUI.Toggle(new Rect(50f, 140f, 100f, 24f), ((Behaviour)components[2]).enabled, "Tail"); GUI.Label(new Rect(50f, 160f, 200f, 24f), "Weight"); m_weight = GUI.HorizontalSlider(new Rect(100f, 160f, 100f, 24f), m_weight, 0f, 1f); DynamicBone[] array = components; foreach (DynamicBone dynamicBone in array) { dynamicBone.SetWeight(m_weight); } } } [AddComponentMenu("Dynamic Bone/Dynamic Bone")] public class DynamicBone : MonoBehaviour { public enum UpdateMode { Normal, AnimatePhysics, UnscaledTime } public enum FreezeAxis { None, X, Y, Z } private class Particle { public Transform m_Transform = null; public int m_ParentIndex = -1; public float m_Damping = 0f; public float m_Elasticity = 0f; public float m_Stiffness = 0f; public float m_Inert = 0f; public float m_Friction = 0f; public float m_Radius = 0f; public float m_BoneLength = 0f; public bool m_isCollide = false; public Vector3 m_Position = Vector3.zero; public Vector3 m_PrevPosition = Vector3.zero; public Vector3 m_EndOffset = Vector3.zero; public Vector3 m_InitLocalPosition = Vector3.zero; public Quaternion m_InitLocalRotation = Quaternion.identity; } [Tooltip("The root of the transform hierarchy to apply physics.")] public Transform m_Root = null; [Tooltip("Internal physics simulation rate.")] public float m_UpdateRate = 60f; public UpdateMode m_UpdateMode = UpdateMode.Normal; [Tooltip("How much the bones slowed down.")] [Range(0f, 1f)] public float m_Damping = 0.1f; public AnimationCurve m_DampingDistrib = null; [Tooltip("How much the force applied to return each bone to original orientation.")] [Range(0f, 1f)] public float m_Elasticity = 0.1f; public AnimationCurve m_ElasticityDistrib = null; [Tooltip("How much bone's original orientation are preserved.")] [Range(0f, 1f)] public float m_Stiffness = 0.1f; public AnimationCurve m_StiffnessDistrib = null; [Tooltip("How much character's position change is ignored in physics simulation.")] [Range(0f, 1f)] public float m_Inert = 0f; public AnimationCurve m_InertDistrib = null; [Tooltip("How much the bones slowed down when collide.")] public float m_Friction = 0f; public AnimationCurve m_FrictionDistrib = null; [Tooltip("Each bone can be a sphere to collide with colliders. Radius describe sphere's size.")] public float m_Radius = 0f; public AnimationCurve m_RadiusDistrib = null; [Tooltip("If End Length is not zero, an extra bone is generated at the end of transform hierarchy.")] public float m_EndLength = 0f; [Tooltip("If End Offset is not zero, an extra bone is generated at the end of transform hierarchy.")] public Vector3 m_EndOffset = Vector3.zero; [Tooltip("The force apply to bones. Partial force apply to character's initial pose is cancelled out.")] public Vector3 m_Gravity = Vector3.zero; [Tooltip("The force apply to bones.")] public Vector3 m_Force = Vector3.zero; [Tooltip("Collider objects interact with the bones.")] public List m_Colliders = null; [Tooltip("Bones exclude from physics simulation.")] public List m_Exclusions = null; [Tooltip("Constrain bones to move on specified plane.")] public FreezeAxis m_FreezeAxis = FreezeAxis.None; [Tooltip("Disable physics simulation automatically if character is far from camera or player.")] public bool m_DistantDisable = false; public Transform m_ReferenceObject = null; public float m_DistanceToObject = 20f; private Vector3 m_LocalGravity = Vector3.zero; private Vector3 m_ObjectMove = Vector3.zero; private Vector3 m_ObjectPrevPosition = Vector3.zero; private float m_BoneTotalLength = 0f; private float m_ObjectScale = 1f; private float m_Time = 0f; private float m_Weight = 1f; private bool m_DistantDisabled = false; private List m_Particles = new List(); private void Start() { SetupParticles(); } private void FixedUpdate() { if (m_UpdateMode == UpdateMode.AnimatePhysics) { PreUpdate(); } } private void Update() { if (m_UpdateMode != UpdateMode.AnimatePhysics) { PreUpdate(); } } private void LateUpdate() { if (m_DistantDisable) { CheckDistance(); } if (m_Weight > 0f && (!m_DistantDisable || !m_DistantDisabled)) { float t = ((m_UpdateMode != UpdateMode.UnscaledTime) ? Time.deltaTime : Time.unscaledDeltaTime); UpdateDynamicBones(t); } } private void PreUpdate() { if (m_Weight > 0f && (!m_DistantDisable || !m_DistantDisabled)) { InitTransforms(); } } private void CheckDistance() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Transform val = m_ReferenceObject; if ((Object)(object)val == (Object)null && (Object)(object)Camera.main != (Object)null) { val = ((Component)Camera.main).transform; } if (!((Object)(object)val != (Object)null)) { return; } Vector3 val2 = val.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; bool flag = sqrMagnitude > m_DistanceToObject * m_DistanceToObject; if (flag != m_DistantDisabled) { if (!flag) { ResetParticlesPosition(); } m_DistantDisabled = flag; } } private void OnEnable() { ResetParticlesPosition(); } private void OnDisable() { InitTransforms(); } private void OnValidate() { m_UpdateRate = Mathf.Max(m_UpdateRate, 0f); m_Damping = Mathf.Clamp01(m_Damping); m_Elasticity = Mathf.Clamp01(m_Elasticity); m_Stiffness = Mathf.Clamp01(m_Stiffness); m_Inert = Mathf.Clamp01(m_Inert); m_Friction = Mathf.Clamp01(m_Friction); m_Radius = Mathf.Max(m_Radius, 0f); if (Application.isEditor && Application.isPlaying) { InitTransforms(); SetupParticles(); } } private void OnDrawGizmosSelected() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled || (Object)(object)m_Root == (Object)null) { return; } if (Application.isEditor && !Application.isPlaying && ((Component)this).transform.hasChanged) { InitTransforms(); SetupParticles(); } Gizmos.color = Color.white; for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if (particle.m_ParentIndex >= 0) { Particle particle2 = m_Particles[particle.m_ParentIndex]; Gizmos.DrawLine(particle.m_Position, particle2.m_Position); } if (particle.m_Radius > 0f) { Gizmos.DrawWireSphere(particle.m_Position, particle.m_Radius * m_ObjectScale); } } } public void SetWeight(float w) { if (m_Weight != w) { if (w == 0f) { InitTransforms(); } else if (m_Weight == 0f) { ResetParticlesPosition(); } m_Weight = w; } } public float GetWeight() { return m_Weight; } private void UpdateDynamicBones(float t) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_Root == (Object)null) { return; } m_ObjectScale = Mathf.Abs(((Component)this).transform.lossyScale.x); m_ObjectMove = ((Component)this).transform.position - m_ObjectPrevPosition; m_ObjectPrevPosition = ((Component)this).transform.position; int num = 1; if (m_UpdateRate > 0f) { float num2 = 1f / m_UpdateRate; m_Time += t; num = 0; while (m_Time >= num2) { m_Time -= num2; if (++num >= 3) { m_Time = 0f; break; } } } if (num > 0) { for (int i = 0; i < num; i++) { UpdateParticles1(); UpdateParticles2(); m_ObjectMove = Vector3.zero; } } else { SkipUpdateParticles(); } ApplyParticlesToTransforms(); } private void SetupParticles() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) m_Particles.Clear(); if (!((Object)(object)m_Root == (Object)null)) { m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); m_ObjectScale = Mathf.Abs(((Component)this).transform.lossyScale.x); m_ObjectPrevPosition = ((Component)this).transform.position; m_ObjectMove = Vector3.zero; m_BoneTotalLength = 0f; AppendParticles(m_Root, -1, 0f); UpdateParameters(); } } private void AppendParticles(Transform b, int parentIndex, float boneLength) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b4: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0282: 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_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) Particle particle = new Particle(); particle.m_Transform = b; particle.m_ParentIndex = parentIndex; Vector3 val; if ((Object)(object)b != (Object)null) { val = (particle.m_Position = (particle.m_PrevPosition = b.position)); particle.m_InitLocalPosition = b.localPosition; particle.m_InitLocalRotation = b.localRotation; } else { Transform transform = m_Particles[parentIndex].m_Transform; if (m_EndLength > 0f) { Transform parent = transform.parent; if ((Object)(object)parent != (Object)null) { particle.m_EndOffset = transform.InverseTransformPoint(transform.position * 2f - parent.position) * m_EndLength; } else { particle.m_EndOffset = new Vector3(m_EndLength, 0f, 0f); } } else { particle.m_EndOffset = transform.InverseTransformPoint(((Component)this).transform.TransformDirection(m_EndOffset) + transform.position); } val = (particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset))); } if (parentIndex >= 0) { float num = boneLength; val = m_Particles[parentIndex].m_Transform.position - particle.m_Position; boneLength = num + ((Vector3)(ref val)).magnitude; particle.m_BoneLength = boneLength; m_BoneTotalLength = Mathf.Max(m_BoneTotalLength, boneLength); } int count = m_Particles.Count; m_Particles.Add(particle); if (!((Object)(object)b != (Object)null)) { return; } for (int i = 0; i < b.childCount; i++) { bool flag = false; if (m_Exclusions != null) { for (int j = 0; j < m_Exclusions.Count; j++) { Transform val2 = m_Exclusions[j]; if ((Object)(object)val2 == (Object)(object)b.GetChild(i)) { flag = true; break; } } } if (!flag) { AppendParticles(b.GetChild(i), count, boneLength); } else if (m_EndLength > 0f || m_EndOffset != Vector3.zero) { AppendParticles(null, count, boneLength); } } if (b.childCount == 0 && (m_EndLength > 0f || m_EndOffset != Vector3.zero)) { AppendParticles(null, count, boneLength); } } public void UpdateParameters() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_Root == (Object)null) { return; } m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; particle.m_Damping = m_Damping; particle.m_Elasticity = m_Elasticity; particle.m_Stiffness = m_Stiffness; particle.m_Inert = m_Inert; particle.m_Friction = m_Friction; particle.m_Radius = m_Radius; if (m_BoneTotalLength > 0f) { float num = particle.m_BoneLength / m_BoneTotalLength; if (m_DampingDistrib != null && m_DampingDistrib.keys.Length > 0) { particle.m_Damping *= m_DampingDistrib.Evaluate(num); } if (m_ElasticityDistrib != null && m_ElasticityDistrib.keys.Length > 0) { particle.m_Elasticity *= m_ElasticityDistrib.Evaluate(num); } if (m_StiffnessDistrib != null && m_StiffnessDistrib.keys.Length > 0) { particle.m_Stiffness *= m_StiffnessDistrib.Evaluate(num); } if (m_InertDistrib != null && m_InertDistrib.keys.Length > 0) { particle.m_Inert *= m_InertDistrib.Evaluate(num); } if (m_FrictionDistrib != null && m_FrictionDistrib.keys.Length > 0) { particle.m_Friction *= m_FrictionDistrib.Evaluate(num); } if (m_RadiusDistrib != null && m_RadiusDistrib.keys.Length > 0) { particle.m_Radius *= m_RadiusDistrib.Evaluate(num); } } particle.m_Damping = Mathf.Clamp01(particle.m_Damping); particle.m_Elasticity = Mathf.Clamp01(particle.m_Elasticity); particle.m_Stiffness = Mathf.Clamp01(particle.m_Stiffness); particle.m_Inert = Mathf.Clamp01(particle.m_Inert); particle.m_Friction = Mathf.Clamp01(particle.m_Friction); particle.m_Radius = Mathf.Max(particle.m_Radius, 0f); } } private void InitTransforms() { //IL_002f: 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) for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if ((Object)(object)particle.m_Transform != (Object)null) { particle.m_Transform.localPosition = particle.m_InitLocalPosition; particle.m_Transform.localRotation = particle.m_InitLocalRotation; } } } private void ResetParticlesPosition() { //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_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if ((Object)(object)particle.m_Transform != (Object)null) { particle.m_Position = (particle.m_PrevPosition = particle.m_Transform.position); } else { Transform transform = m_Particles[particle.m_ParentIndex].m_Transform; particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset)); } particle.m_isCollide = false; } m_ObjectPrevPosition = ((Component)this).transform.position; } private void UpdateParticles1() { //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_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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0139: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) Vector3 gravity = m_Gravity; Vector3 normalized = ((Vector3)(ref m_Gravity)).normalized; Vector3 val = m_Root.TransformDirection(m_LocalGravity); Vector3 val2 = normalized * Mathf.Max(Vector3.Dot(val, normalized), 0f); gravity -= val2; gravity = (gravity + m_Force) * m_ObjectScale; for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if (particle.m_ParentIndex >= 0) { Vector3 val3 = particle.m_Position - particle.m_PrevPosition; Vector3 val4 = m_ObjectMove * particle.m_Inert; particle.m_PrevPosition = particle.m_Position + val4; float num = particle.m_Damping; if (particle.m_isCollide) { num += particle.m_Friction; if (num > 1f) { num = 1f; } particle.m_isCollide = false; } particle.m_Position += val3 * (1f - num) + gravity + val4; } else { particle.m_PrevPosition = particle.m_Position; particle.m_Position = particle.m_Transform.position; } } } private void UpdateParticles2() { //IL_0003: 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_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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: 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_0270: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) Plane val = default(Plane); for (int i = 1; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; Particle particle2 = m_Particles[particle.m_ParentIndex]; float magnitude; if ((Object)(object)particle.m_Transform != (Object)null) { Vector3 val2 = particle2.m_Transform.position - particle.m_Transform.position; magnitude = ((Vector3)(ref val2)).magnitude; } else { Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix; Vector3 val3 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyVector(particle.m_EndOffset); magnitude = ((Vector3)(ref val3)).magnitude; } float num = Mathf.Lerp(1f, particle.m_Stiffness, m_Weight); if (num > 0f || particle.m_Elasticity > 0f) { Matrix4x4 localToWorldMatrix2 = particle2.m_Transform.localToWorldMatrix; ((Matrix4x4)(ref localToWorldMatrix2)).SetColumn(3, Vector4.op_Implicit(particle2.m_Position)); Vector3 val4 = ((!((Object)(object)particle.m_Transform != (Object)null)) ? ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_EndOffset) : ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_Transform.localPosition)); Vector3 val5 = val4 - particle.m_Position; particle.m_Position += val5 * particle.m_Elasticity; if (num > 0f) { val5 = val4 - particle.m_Position; float magnitude2 = ((Vector3)(ref val5)).magnitude; float num2 = magnitude * (1f - num) * 2f; if (magnitude2 > num2) { particle.m_Position += val5 * ((magnitude2 - num2) / magnitude2); } } } if (m_Colliders != null) { float particleRadius = particle.m_Radius * m_ObjectScale; for (int j = 0; j < m_Colliders.Count; j++) { DynamicBoneColliderBase dynamicBoneColliderBase = m_Colliders[j]; if ((Object)(object)dynamicBoneColliderBase != (Object)null && ((Behaviour)dynamicBoneColliderBase).enabled) { particle.m_isCollide |= dynamicBoneColliderBase.Collide(ref particle.m_Position, particleRadius); } } } if (m_FreezeAxis != 0) { switch (m_FreezeAxis) { case FreezeAxis.X: ((Plane)(ref val)).SetNormalAndPosition(particle2.m_Transform.right, particle2.m_Position); break; case FreezeAxis.Y: ((Plane)(ref val)).SetNormalAndPosition(particle2.m_Transform.up, particle2.m_Position); break; case FreezeAxis.Z: ((Plane)(ref val)).SetNormalAndPosition(particle2.m_Transform.forward, particle2.m_Position); break; } particle.m_Position -= ((Plane)(ref val)).normal * ((Plane)(ref val)).GetDistanceToPoint(particle.m_Position); } Vector3 val6 = particle2.m_Position - particle.m_Position; float magnitude3 = ((Vector3)(ref val6)).magnitude; if (magnitude3 > 0f) { particle.m_Position += val6 * ((magnitude3 - magnitude) / magnitude3); } } } private void SkipUpdateParticles() { //IL_01e4: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if (particle.m_ParentIndex >= 0) { particle.m_PrevPosition += m_ObjectMove; particle.m_Position += m_ObjectMove; Particle particle2 = m_Particles[particle.m_ParentIndex]; float magnitude; if ((Object)(object)particle.m_Transform != (Object)null) { Vector3 val = particle2.m_Transform.position - particle.m_Transform.position; magnitude = ((Vector3)(ref val)).magnitude; } else { Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix; Vector3 val2 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyVector(particle.m_EndOffset); magnitude = ((Vector3)(ref val2)).magnitude; } float num = Mathf.Lerp(1f, particle.m_Stiffness, m_Weight); if (num > 0f) { Matrix4x4 localToWorldMatrix2 = particle2.m_Transform.localToWorldMatrix; ((Matrix4x4)(ref localToWorldMatrix2)).SetColumn(3, Vector4.op_Implicit(particle2.m_Position)); Vector3 val3 = ((!((Object)(object)particle.m_Transform != (Object)null)) ? ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_EndOffset) : ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_Transform.localPosition)); Vector3 val4 = val3 - particle.m_Position; float magnitude2 = ((Vector3)(ref val4)).magnitude; float num2 = magnitude * (1f - num) * 2f; if (magnitude2 > num2) { particle.m_Position += val4 * ((magnitude2 - num2) / magnitude2); } } Vector3 val5 = particle2.m_Position - particle.m_Position; float magnitude3 = ((Vector3)(ref val5)).magnitude; if (magnitude3 > 0f) { particle.m_Position += val5 * ((magnitude3 - magnitude) / magnitude3); } } else { particle.m_PrevPosition = particle.m_Position; particle.m_Position = particle.m_Transform.position; } } } private static Vector3 MirrorVector(Vector3 v, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0020: Unknown result type (might be due to invalid IL or missing references) return v - axis * (Vector3.Dot(v, axis) * 2f); } private void ApplyParticlesToTransforms() { //IL_00c1: 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_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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_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_0091: 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) for (int i = 1; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; Particle particle2 = m_Particles[particle.m_ParentIndex]; if (particle2.m_Transform.childCount <= 1) { Vector3 val = ((!((Object)(object)particle.m_Transform != (Object)null)) ? particle.m_EndOffset : particle.m_Transform.localPosition); Vector3 val2 = particle.m_Position - particle2.m_Position; Quaternion val3 = Quaternion.FromToRotation(particle2.m_Transform.TransformDirection(val), val2); particle2.m_Transform.rotation = val3 * particle2.m_Transform.rotation; } if ((Object)(object)particle.m_Transform != (Object)null) { particle.m_Transform.position = particle.m_Position; } } } } [AddComponentMenu("Dynamic Bone/Dynamic Bone Collider")] public class DynamicBoneCollider : DynamicBoneColliderBase { [Tooltip("The radius of the sphere or capsule.")] public float m_Radius = 0.5f; [Tooltip("The height of the capsule.")] public float m_Height = 0f; private void OnValidate() { m_Radius = Mathf.Max(m_Radius, 0f); m_Height = Mathf.Max(m_Height, 0f); } public override bool Collide(ref Vector3 particlePosition, float particleRadius) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) float num = m_Radius * Mathf.Abs(((Component)this).transform.lossyScale.x); float num2 = m_Height * 0.5f - m_Radius; if (num2 <= 0f) { if (m_Bound == Bound.Outside) { return OutsideSphere(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(m_Center), num); } return InsideSphere(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(m_Center), num); } Vector3 center = m_Center; Vector3 center2 = m_Center; switch (m_Direction) { case Direction.X: center.x -= num2; center2.x += num2; break; case Direction.Y: center.y -= num2; center2.y += num2; break; case Direction.Z: center.z -= num2; center2.z += num2; break; } if (m_Bound == Bound.Outside) { return OutsideCapsule(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(center), ((Component)this).transform.TransformPoint(center2), num); } return InsideCapsule(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(center), ((Component)this).transform.TransformPoint(center2), num); } private static bool OutsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_003a: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) float num = sphereRadius + particleRadius; float num2 = num * num; Vector3 val = particlePosition - sphereCenter; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > 0f && sqrMagnitude < num2) { float num3 = Mathf.Sqrt(sqrMagnitude); particlePosition = sphereCenter + val * (num / num3); return true; } return false; } private static bool InsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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_003f: Unknown result type (might be due to invalid IL or missing references) float num = sphereRadius - particleRadius; float num2 = num * num; Vector3 val = particlePosition - sphereCenter; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > num2) { float num3 = Mathf.Sqrt(sqrMagnitude); particlePosition = sphereCenter + val * (num / num3); return true; } return false; } private static bool OutsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) float num = capsuleRadius + particleRadius; float num2 = num * num; Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num3 = Vector3.Dot(val2, val); if (num3 <= 0f) { float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > 0f && sqrMagnitude < num2) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num / num4); return true; } } else { float sqrMagnitude2 = ((Vector3)(ref val)).sqrMagnitude; if (num3 >= sqrMagnitude2) { val2 = particlePosition - capsuleP1; float sqrMagnitude3 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude3 > 0f && sqrMagnitude3 < num2) { float num5 = Mathf.Sqrt(sqrMagnitude3); particlePosition = capsuleP1 + val2 * (num / num5); return true; } } else if (sqrMagnitude2 > 0f) { num3 /= sqrMagnitude2; val2 -= val * num3; float sqrMagnitude4 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude4 > 0f && sqrMagnitude4 < num2) { float num6 = Mathf.Sqrt(sqrMagnitude4); particlePosition += val2 * ((num - num6) / num6); return true; } } } return false; } private static bool InsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) float num = capsuleRadius - particleRadius; float num2 = num * num; Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num3 = Vector3.Dot(val2, val); if (num3 <= 0f) { float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > num2) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num / num4); return true; } } else { float sqrMagnitude2 = ((Vector3)(ref val)).sqrMagnitude; if (num3 >= sqrMagnitude2) { val2 = particlePosition - capsuleP1; float sqrMagnitude3 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude3 > num2) { float num5 = Mathf.Sqrt(sqrMagnitude3); particlePosition = capsuleP1 + val2 * (num / num5); return true; } } else if (sqrMagnitude2 > 0f) { num3 /= sqrMagnitude2; val2 -= val * num3; float sqrMagnitude4 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude4 > num2) { float num6 = Mathf.Sqrt(sqrMagnitude4); particlePosition += val2 * ((num - num6) / num6); return true; } } } return false; } private void OnDrawGizmosSelected() { //IL_002b: 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_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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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) if (!((Behaviour)this).enabled) { return; } if (m_Bound == Bound.Outside) { Gizmos.color = Color.yellow; } else { Gizmos.color = Color.magenta; } float num = m_Radius * Mathf.Abs(((Component)this).transform.lossyScale.x); float num2 = m_Height * 0.5f - m_Radius; if (num2 <= 0f) { Gizmos.DrawWireSphere(((Component)this).transform.TransformPoint(m_Center), num); return; } Vector3 center = m_Center; Vector3 center2 = m_Center; switch (m_Direction) { case Direction.X: center.x -= num2; center2.x += num2; break; case Direction.Y: center.y -= num2; center2.y += num2; break; case Direction.Z: center.z -= num2; center2.z += num2; break; } Gizmos.DrawWireSphere(((Component)this).transform.TransformPoint(center), num); Gizmos.DrawWireSphere(((Component)this).transform.TransformPoint(center2), num); } } public class DynamicBoneColliderBase : MonoBehaviour { public enum Direction { X, Y, Z } public enum Bound { Outside, Inside } [Tooltip("The axis of the capsule's height.")] public Direction m_Direction = Direction.Y; [Tooltip("The center of the sphere or capsule, in the object's local space.")] public Vector3 m_Center = Vector3.zero; [Tooltip("Constrain bones to outside bound or inside bound.")] public Bound m_Bound = Bound.Outside; public virtual bool Collide(ref Vector3 particlePosition, float particleRadius) { return false; } } [AddComponentMenu("Dynamic Bone/Dynamic Bone Plane Collider")] public class DynamicBonePlaneCollider : DynamicBoneColliderBase { private void OnValidate() { } public override bool Collide(ref Vector3 particlePosition, float particleRadius) { //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_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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.up; switch (m_Direction) { case Direction.X: val = ((Component)this).transform.right; break; case Direction.Y: val = ((Component)this).transform.up; break; case Direction.Z: val = ((Component)this).transform.forward; break; } Vector3 val2 = ((Component)this).transform.TransformPoint(m_Center); Plane val3 = default(Plane); ((Plane)(ref val3))..ctor(val, val2); float distanceToPoint = ((Plane)(ref val3)).GetDistanceToPoint(particlePosition); if (m_Bound == Bound.Outside) { if (distanceToPoint < 0f) { particlePosition -= val * distanceToPoint; return true; } } else if (distanceToPoint > 0f) { particlePosition -= val * distanceToPoint; return true; } return false; } private void OnDrawGizmosSelected() { //IL_002b: 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_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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00a1: 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_00a3: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled) { if (m_Bound == Bound.Outside) { Gizmos.color = Color.yellow; } else { Gizmos.color = Color.magenta; } Vector3 val = Vector3.up; switch (m_Direction) { case Direction.X: val = ((Component)this).transform.right; break; case Direction.Y: val = ((Component)this).transform.up; break; case Direction.Z: val = ((Component)this).transform.forward; break; } Vector3 val2 = ((Component)this).transform.TransformPoint(m_Center); Gizmos.DrawLine(val2, val2 + val); } } } namespace Niko666 { public class AK117LavaAnimController : MonoBehaviour { public ClosedBoltWeapon Weapon; public Animator Animator; public AudioSource AudioSource; public GameObject Magazine; public string Fire_Node = "Fire"; public string Reload_P1_Node = "Reload_P1"; public string Reload_P2_Node = "Reload_P2"; public string Reload_Close_Node = "Reload_Close"; public string Reload_Empty_P1_Node = "Reload_Empty_P1"; public string Reload_Empty_P2_Node = "Reload_Empty_P2"; public AudioClip Reload_P1_Clip; public AudioClip Reload_P2_Clip; public AudioClip Reload_Close_Clip; public AudioClip Reload_Empty_P1_Clip; public AudioClip Reload_Empty_P2_Clip; private Vector2 dir2 = Vector2.down; private bool _hasPlayedFire = true; private bool _hasPlayedReloadP1 = false; private bool _hasPlayedReloadP2 = true; private bool _hasPlayedReloadEmptyP1 = false; private bool _hasPlayedReloadEmptyP2 = false; public void Awake() { Animator.cullingMode = (AnimatorCullingMode)0; } public void Update() { //IL_0205: 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) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if (Weapon.m_fireSelectorMode == 0) { ((FVRFireArm)Weapon).UsesClips = false; return; } if (!Weapon.Chamber.IsFull && !_hasPlayedFire && ((FVRFireArm)Weapon).Magazine.HasARound()) { Animator.Play(Fire_Node); _hasPlayedFire = true; } else if (Weapon.Chamber.IsFull) { _hasPlayedFire = false; } if (!((FVRFireArm)Weapon).Magazine.HasARound() && !Weapon.Chamber.IsFull && !_hasPlayedReloadEmptyP1) { ((FVRFireArm)Weapon).UsesClips = true; Magazine.SetActive(false); _hasPlayedReloadEmptyP2 = false; Animator.Play(Reload_Empty_P1_Node); AudioSource.PlayOneShot(Reload_Empty_P1_Clip, 0.15f); _hasPlayedReloadEmptyP1 = true; } else if (((FVRFireArm)Weapon).Magazine.HasARound() && !_hasPlayedReloadEmptyP2) { ((FVRFireArm)Weapon).UsesClips = false; Magazine.SetActive(true); _hasPlayedReloadEmptyP1 = false; Animator.Play(Reload_Empty_P2_Node); AudioSource.PlayOneShot(Reload_Empty_P2_Clip, 0.15f); Weapon.Bolt.ImpartFiringImpulse(); _hasPlayedReloadEmptyP2 = true; } if (((FVRFireArm)Weapon).Magazine.HasARound() && Weapon.Chamber.IsFull && ((!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir2) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) || (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)Weapon).m_hand.Input.AXButtonDown))) { if (!_hasPlayedReloadP1 && _hasPlayedReloadP2 && !AudioSource.isPlaying && !((FVRFireArm)Weapon).Magazine.IsFull()) { ((FVRFireArm)Weapon).UsesClips = true; Magazine.SetActive(false); _hasPlayedReloadP2 = false; Animator.Play(Reload_P1_Node); AudioSource.PlayOneShot(Reload_P1_Clip, 0.15f); _hasPlayedReloadP1 = true; } else if (_hasPlayedReloadP1 && !_hasPlayedReloadP2 && !AudioSource.isPlaying) { ((FVRFireArm)Weapon).UsesClips = false; Magazine.SetActive(false); Animator.Play(Reload_Close_Node); AudioSource.PlayOneShot(Reload_Close_Clip, 0.15f); _hasPlayedReloadP1 = false; _hasPlayedReloadP2 = true; } } else if (!_hasPlayedReloadP2 && _hasPlayedReloadP1 && ((FVRFireArm)Weapon).Magazine.IsFull()) { ((FVRFireArm)Weapon).UsesClips = false; Magazine.SetActive(true); _hasPlayedReloadP1 = false; Animator.Play(Reload_P2_Node); AudioSource.PlayOneShot(Reload_P2_Clip, 0.15f); _hasPlayedReloadP2 = true; } } } public class AN94BurstSystem : MonoBehaviour { public ClosedBoltWeapon Weapon; public int BurstAmount = 4; private int _shotsSoFar = 0; private bool wasLoaded; public float DefForwardSpeed; public float DefRearwardSpeed; public float DefStiffness; public float FastForwardSpeed; public float FastRearwardSpeed; public float FastStiffness; public void FixedUpdate() { if (!((Object)(object)Weapon != (Object)null) || !((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if (wasLoaded && !Weapon.Chamber.IsFull) { _shotsSoFar++; } wasLoaded = Weapon.Chamber.IsFull; if (Weapon.m_triggerFloat <= Weapon.TriggerResetThreshold) { _shotsSoFar = 0; Weapon.Bolt.Speed_Forward = FastForwardSpeed; Weapon.Bolt.Speed_Rearward = FastRearwardSpeed; Weapon.Bolt.SpringStiffness = FastStiffness; return; } if (_shotsSoFar >= BurstAmount) { Weapon.Bolt.Speed_Forward = DefForwardSpeed; Weapon.Bolt.Speed_Rearward = DefRearwardSpeed; Weapon.Bolt.SpringStiffness = DefStiffness; } if (Weapon.m_triggerFloat <= Weapon.TriggerResetThreshold) { _shotsSoFar = 0; } } } public class ARX51BarrelSystem : MonoBehaviour { public ClosedBoltWeapon Weapon; public GameObject SpinningBarrels; public AudioSource SpinnySounds; public float SpinRate; public cullOnZLoc.dirType DirectionOfSpin; public float DecelerationRate = 0.5f; private float currentSpinSpeed = 0f; private bool TriggerPulled = false; public int BurstAmount = 4; private int _shotsSoFar = 0; private bool wasLoaded; public float DefForwardSpeed; public float DefRearwardSpeed; public float DefStiffness; public float FastForwardSpeed; public float FastRearwardSpeed; public float FastStiffness; public void FixedUpdate() { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Weapon != (Object)null) || !((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } float triggerFloat = Weapon.m_triggerFloat; if (triggerFloat >= Weapon.TriggerResetThreshold && Weapon.Chamber.IsFull) { if (!TriggerPulled) { TriggerPulled = true; } currentSpinSpeed = SpinRate; SpinnySounds.Play(); } else if (TriggerPulled) { TriggerPulled = false; } if (!TriggerPulled && currentSpinSpeed > 0f) { currentSpinSpeed -= DecelerationRate * Time.deltaTime; if (currentSpinSpeed < 0f) { currentSpinSpeed = 0f; } } if (currentSpinSpeed > 0f && (Object)(object)SpinningBarrels != (Object)null) { Vector3 zero = Vector3.zero; int directionOfSpin = (int)DirectionOfSpin; if (directionOfSpin >= 0 && directionOfSpin <= 2) { ((Vector3)(ref zero))[directionOfSpin] = currentSpinSpeed * Time.deltaTime; SpinningBarrels.transform.Rotate(zero); } else { Debug.LogWarning((object)"Invalid DirectionOfSpin value!"); } } if (wasLoaded && !Weapon.Chamber.IsFull) { _shotsSoFar++; } wasLoaded = Weapon.Chamber.IsFull; if (Weapon.m_triggerFloat <= Weapon.TriggerResetThreshold) { _shotsSoFar = 0; if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound()) { Weapon.Bolt.Speed_Forward = 0f; Weapon.Bolt.Speed_Rearward = 0f; Weapon.Bolt.SpringStiffness = 0f; } if (Weapon.Chamber.IsFull) { Weapon.Bolt.Speed_Forward = FastForwardSpeed; Weapon.Bolt.Speed_Rearward = FastRearwardSpeed; Weapon.Bolt.SpringStiffness = FastStiffness; } } else { Weapon.Bolt.Speed_Forward = FastForwardSpeed; Weapon.Bolt.Speed_Rearward = FastRearwardSpeed; Weapon.Bolt.SpringStiffness = FastStiffness; if (_shotsSoFar >= BurstAmount) { Weapon.Bolt.Speed_Forward = DefForwardSpeed; Weapon.Bolt.Speed_Rearward = DefRearwardSpeed; Weapon.Bolt.SpringStiffness = DefStiffness; } if (Weapon.m_triggerFloat <= Weapon.TriggerResetThreshold) { _shotsSoFar = 0; } } } } public class AdvancedSwitch : FVRInteractiveObject { public int CurObjectIndex = 0; public GameObject[] ObjectsIndexes; public AudioEvent AudEvent_Toggle; 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)0, AudEvent_Toggle, base.GameObject.transform.position); for (int i = 0; i < ObjectsIndexes.Length; i++) { ObjectsIndexes[i].SetActive(false); } CurObjectIndex++; if (CurObjectIndex >= ObjectsIndexes.Length) { CurObjectIndex = 0; } ObjectsIndexes[CurObjectIndex].SetActive(true); } } public class AnimationSwitch : FVRInteractiveObject { public string Insp_P1_Node = "Insp_P1"; public string Insp_P2_Node = "Insp_P2"; public ClosedBoltWeapon Weapon; public Animator Animator; public AudioEvent Insp_P1_Clip; public AudioEvent Insp_P2_Clip; private bool _hasPlayedInsp = false; private int CurrentSelector; public void Start() { ((FVRInteractiveObject)this).Start(); } public override void SimpleInteraction(FVRViveHand hand) { //IL_0099: 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).SimpleInteraction(hand); if (!_hasPlayedInsp) { CurrentSelector = Weapon.m_fireSelectorMode; Weapon.m_fireSelectorMode = 0; Animator.Play(Insp_P1_Node); SM.PlayCoreSound((FVRPooledAudioType)10, Insp_P1_Clip, ((Component)this).transform.position); _hasPlayedInsp = true; } else { Weapon.m_fireSelectorMode = CurrentSelector; Animator.Play(Insp_P2_Node); SM.PlayCoreSound((FVRPooledAudioType)10, Insp_P2_Clip, ((Component)this).transform.position); _hasPlayedInsp = false; } } } public class AudioPlayOnGrab : MonoBehaviour { public AudioEvent Audio; public FVRPhysicalObject Object; private bool isGrabbed; public void Update() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRInteractiveObject)Object).m_hand != (Object)null) { if (!isGrabbed) { SM.PlayCoreSound((FVRPooledAudioType)0, Audio, ((Component)Object).transform.position); isGrabbed = true; } } else if (isGrabbed) { isGrabbed = false; } } } public class AudioRecoilForDiffModes : MonoBehaviour { public ClosedBoltWeapon Weapon; public int FireSelectorPosition1; public int FireSelectorPosition2; public FVRFireArmRecoilProfile Recoil1; public FVRFireArmRecoilProfile Recoil2; public FVRFirearmAudioSet AudioSet1; public FVRFirearmAudioSet AudioSet2; public bool _hasSetStartAudio = false; public bool _hasSetStopAudio = false; public void Update() { if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if (Weapon.m_fireSelectorMode == FireSelectorPosition1) { _hasSetStartAudio = false; if (!_hasSetStopAudio) { ((FVRFireArm)Weapon).RecoilProfile = Recoil1; ((FVRFireArm)Weapon).AudioClipSet = AudioSet1; } _hasSetStopAudio = true; } else if (Weapon.m_fireSelectorMode == FireSelectorPosition2) { _hasSetStopAudio = false; if (!_hasSetStartAudio) { ((FVRFireArm)Weapon).RecoilProfile = Recoil2; ((FVRFireArm)Weapon).AudioClipSet = AudioSet2; } _hasSetStartAudio = true; } } } } namespace OpenScripts2 { public class AutomaticDeleteStripperClip : OpenScripts2_BasePlugin { public FVRFireArmClip Clip; public GameObject ClipGeo; [Tooltip("Delay in Seconds. If equal to 0, all rounds will be loaded at the same time.")] public float DelayBetweenRounds = 0f; public bool DoesAutoEject = false; private bool _loadingRounds = false; public void Update() { if (!_loadingRounds && (Object)(object)Clip.FireArm != (Object)null) { ClipGeo.SetActive(false); if (DelayBetweenRounds != 0f) { ((MonoBehaviour)this).StartCoroutine(LoadRoundsOneByOne()); } else { LoadAllRounds(); } } } private IEnumerator LoadRoundsOneByOne() { _loadingRounds = true; while (Clip.HasARound() && (Object)(object)Clip.FireArm != (Object)null && (Object)(object)Clip.FireArm.Magazine != (Object)null && !Clip.FireArm.Magazine.IsFull()) { Clip.LoadOneRoundFromClipToMag(); yield return (object)new WaitForSeconds(DelayBetweenRounds); } _loadingRounds = false; if (DoesAutoEject) { Clip.FireArm.EjectClip(); } } private void LoadAllRounds() { //IL_009e: 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_00b4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Clip.FireArm == (Object)null || (Object)(object)Clip.FireArm.Magazine == (Object)null || Clip.FireArm.Magazine.IsFull() || !Clip.HasARound()) { return; } for (int i = 0; i < Clip.m_numRounds; i++) { if (Clip.FireArm.Magazine.IsFull()) { break; } if (!Clip.HasARound()) { break; } FireArmRoundClass val = Clip.RemoveRoundReturnClass(); Clip.FireArm.Magazine.AddRound(val, false, true); } if (DoesAutoEject) { Clip.FireArm.EjectClip(); } Object.Destroy((Object)(object)Clip); } } } namespace Niko666 { public class BreakActionAlt : OpenScripts2_BasePlugin { public FVRPhysicalObject PhysicalObject; [Header("Break Parts")] public HingeJoint Hinge; public float HingeLimit = 45f; public float HingeEjectThreshhold = 30f; public Transform CenterOfMassOverride; public Axis HingeAxis; [Header("LatchGeo (leave at default if no visible latch)")] public bool HasLatchObject; public Transform Latch; public float MaxLatchRot = 45f; [Tooltip("If latch is below this angle the fore will latch. Latch rot dependend on how far up you press on touchpad (like break action shotgun)")] public float LatchLatchingRot = 5f; [Header("Objects that turn off or on dependend on break state")] public GameObject[] TurnOffObjectsOnOpen; public GameObject[] TurnOnObjectsOnOpen; [Header("Magazine Ejection")] public bool DoesEjectMag = false; public float MagEjectSpeed = 5f; [Header("Audio")] public AudioEvent BreakOpenAudio; public AudioEvent BreakCloseAudio; public float _latchRot; private Vector3 _foreStartPos; public bool _isLatched = true; public bool _latchHeldOpen; private bool _hasEjectedMag = false; private static readonly Dictionary _exisitingBreakOpenTriggers = new Dictionary(); public void Awake() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) _exisitingBreakOpenTriggers.Add(PhysicalObject, this); _foreStartPos = ((Component)Hinge).transform.localPosition; if ((Object)(object)CenterOfMassOverride != (Object)null) { Rigidbody component = ((Component)Hinge).GetComponent(); component.centerOfMass = CenterOfMassOverride.localPosition; } SetBreakObjectsState(active: false); } public void OnDestroy() { _exisitingBreakOpenTriggers.Remove(PhysicalObject); } public void FixedUpdate() { UpdateBreakFore(); } public void Update() { FVRViveHand hand = ((FVRInteractiveObject)PhysicalObject).m_hand; if ((Object)(object)hand != (Object)null) { UpdateInputAndAnimate(hand); } else { _latchHeldOpen = false; } } private void UpdateInputAndAnimate(FVRViveHand hand) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) _latchHeldOpen = false; if (hand.IsInStreamlinedMode) { if (hand.Input.AXButtonPressed) { _latchHeldOpen = true; _latchRot = 1f * MaxLatchRot; } else { _latchRot = Mathf.MoveTowards(_latchRot, 0f, Time.deltaTime * MaxLatchRot * 3f); } } else if (hand.Input.TouchpadPressed && Vector2.Angle(((FVRInteractiveObject)PhysicalObject).m_hand.Input.TouchpadAxes, Vector2.down) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)PhysicalObject).m_hand.Input.TouchpadAxes)).magnitude > 0.4f) { _latchHeldOpen = true; _latchRot = hand.Input.TouchpadAxes.x * MaxLatchRot; } else { _latchRot = Mathf.MoveTowards(_latchRot, 0f, Time.deltaTime * MaxLatchRot * 3f); } if (HasLatchObject) { Latch.localEulerAngles = new Vector3(0f, _latchRot, 0f); } } private void UpdateBreakFore() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) Axis hingeAxis = HingeAxis; float num = (int)hingeAxis switch { 0 => ((Component)Hinge).transform.localEulerAngles.x, 1 => ((Component)Hinge).transform.localEulerAngles.y, 2 => ((Component)Hinge).transform.localEulerAngles.z, _ => 0f, }; if (_isLatched && Mathf.Abs(_latchRot) > 5f) { _isLatched = false; SM.PlayGenericSound(BreakOpenAudio, ((Component)PhysicalObject).transform.position); JointLimits limits = Hinge.limits; ((JointLimits)(ref limits)).max = HingeLimit; Hinge.limits = limits; SetBreakObjectsState(active: true); } if (!_isLatched) { if (!_latchHeldOpen && num <= 1f && Mathf.Abs(_latchRot) < LatchLatchingRot) { _isLatched = true; SM.PlayGenericSound(BreakCloseAudio, ((Component)PhysicalObject).transform.position); JointLimits limits2 = Hinge.limits; ((JointLimits)(ref limits2)).max = 0f; Hinge.limits = limits2; SetBreakObjectsState(active: false); ((Component)Hinge).transform.localPosition = _foreStartPos; _hasEjectedMag = false; } if (DoesEjectMag && Mathf.Abs(num) >= HingeEjectThreshhold && Mathf.Abs(num) <= HingeLimit) { TryEjectMag(); } } } private void TryEjectMag() { if (!_hasEjectedMag) { EjectMag(); _hasEjectedMag = true; } } public void EjectMag(bool PhysicalRelease = false) { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) FVRPhysicalObject physicalObject = PhysicalObject; FVRFireArm val = (FVRFireArm)(object)((physicalObject is FVRFireArm) ? physicalObject : null); if ((Object)(object)val.Magazine != (Object)null) { if (val.Magazine.UsesOverrideInOut) { val.PlayAudioEventHandling(val.Magazine.ProfileOverride.MagazineOut); } else { val.PlayAudioEvent((FirearmAudioEventType)21, 1f); } val.m_lastEjectedMag = val.Magazine; val.m_ejectDelay = 0.4f; FVRViveHand hand = ((FVRInteractiveObject)val).m_hand; if ((Object)(object)hand != (Object)null) { hand.Buzz(((FVRInteractiveObject)val).m_hand.Buzzer.Buzz_BeginInteraction); } val.Magazine.Release(PhysicalRelease); ((FVRPhysicalObject)val.Magazine).RootRigidbody.velocity = -val.MagazineEjectPos.up * MagEjectSpeed; FVRViveHand hand2 = ((FVRInteractiveObject)val.Magazine).m_hand; if ((Object)(object)hand2 != (Object)null) { hand2.Buzz(((FVRInteractiveObject)val).m_hand.Buzzer.Buzz_BeginInteraction); } val.Magazine = null; } } private void SetBreakObjectsState(bool active) { GameObject[] turnOnObjectsOnOpen = TurnOnObjectsOnOpen; foreach (GameObject val in turnOnObjectsOnOpen) { if ((Object)(object)val != (Object)null) { val.SetActive(active); } } GameObject[] turnOffObjectsOnOpen = TurnOffObjectsOnOpen; foreach (GameObject val2 in turnOffObjectsOnOpen) { if ((Object)(object)val2 != (Object)null) { val2.SetActive(!active); } } } } public class ConsumeMultipleAmmoPerShot : MonoBehaviour { public ClosedBoltWeapon Weapon; public FVRFireArmChamber Chamber; public int FireSelectorPosition; public int AmountToConsume; [HideInInspector] public bool _hasConsumedAmmo = false; public void Update() { if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null && Weapon.m_fireSelectorMode == FireSelectorPosition && !Chamber.IsFull) { if (!_hasConsumedAmmo && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && ((FVRFireArm)Weapon).Magazine.HasARound()) { for (int i = 1; i < AmountToConsume; i++) { ((FVRFireArm)Weapon).Magazine.RemoveRound(); } } _hasConsumedAmmo = true; } if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null && Chamber.IsFull && !Chamber.IsSpent) { _hasConsumedAmmo = false; } } } public class DestinyWeaponSystem : MonoBehaviour { public ClosedBoltWeapon Weapon; public Animator Animator; public string AnimationNode1Name = "animation1"; public string AnimationNode2Name = "animation2"; public AudioEvent ModeChangeAudio1; public AudioEvent ModeChangeAudio2; public AudioEvent MaglidAudio1; public AudioEvent MaglidAudio2; public FVRFireArmRecoilProfile Recoil1; public FVRFireArmRecoilProfile Recoil2; public FireArmRoundClass RoundClass1; public FireArmRoundClass RoundClass2; public Transform MuzzlePoint1; public Transform MuzzlePoint2; public int FireSelectorPosition; public int AmountToConsume; public GameObject Maglid; public Transform slapdir; public Transform Point_MagEjection; public GameObject LeverRing; private bool _hasPlayed = true; private bool _hasConsumedAmmo = false; private Vector2 dir = Vector2.left; private Vector2 dir2 = Vector2.down; private Vector3 v3; private Vector3 velLinearWorld; private bool _hasOpenedLid = true; private bool _hasEjectedMag = true; public void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) Animator.cullingMode = (AnimatorCullingMode)0; SM.PlayCoreSound((FVRPooledAudioType)41, ModeChangeAudio1, ((Component)Weapon).transform.position); } public void FixedUpdate() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_024a: 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_0273: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } velLinearWorld = ((FVRInteractiveObject)Weapon).m_hand.OtherHand.Input.VelLinearWorld; if ((!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir2) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) || (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)Weapon).m_hand.Input.AXButtonDown)) { if (!_hasOpenedLid) { Maglid.transform.localPosition = new Vector3(0f, 0f, 1f); SM.PlayCoreSound((FVRPooledAudioType)41, MaglidAudio1, ((Component)Weapon).transform.position); _hasOpenedLid = true; _hasEjectedMag = false; } else if (_hasOpenedLid) { Maglid.transform.localPosition = new Vector3(0f, 0f, 0f); SM.PlayCoreSound((FVRPooledAudioType)41, MaglidAudio2, ((Component)Weapon).transform.position); _hasOpenedLid = false; _hasEjectedMag = true; } } if (_hasOpenedLid && Vector3.Distance(((FVRInteractiveObject)Weapon).m_hand.OtherHand.PalmTransform.position, slapdir.position) < 0.1f && ((Vector3)(ref velLinearWorld)).magnitude > 1.5f) { if (Vector3.Angle(velLinearWorld, slapdir.forward) < 50f) { Point_MagEjection.localPosition = new Vector3(-0.074f, 0.0486f, -0.2172f); } else if (Vector3.Angle(velLinearWorld, slapdir.forward) < -50f) { Point_MagEjection.localPosition = new Vector3(0.074f, 0.0486f, -0.2172f); } if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !_hasEjectedMag) { ((FVRFireArm)Weapon).EjectMag(false); _hasEjectedMag = true; } } if (_hasEjectedMag && _hasOpenedLid && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null) { Maglid.transform.localPosition = new Vector3(0f, 0f, 0f); SM.PlayCoreSound((FVRPooledAudioType)41, MaglidAudio2, ((Component)Weapon).transform.position); _hasOpenedLid = false; } } public void Update() { //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) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if (Weapon.m_fireSelectorMode == 0 && (Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != RoundClass1 && AM.DoesClassExistForType(RoundClass1, Weapon.Chamber.m_round.RoundType)) { GameObject gameObject = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, RoundClass1)).GetGameObject(); Weapon.Chamber.SetRound(gameObject.GetComponent(), false); } if (Weapon.m_fireSelectorMode == 1 && (Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != RoundClass2 && AM.DoesClassExistForType(RoundClass2, Weapon.Chamber.m_round.RoundType)) { GameObject gameObject2 = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, RoundClass2)).GetGameObject(); Weapon.Chamber.SetRound(gameObject2.GetComponent(), false); } if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null && Weapon.m_fireSelectorMode == FireSelectorPosition && !Weapon.Chamber.IsFull) { if (!_hasConsumedAmmo && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && ((FVRFireArm)Weapon).Magazine.HasARound()) { for (int i = 1; i < AmountToConsume; i++) { ((FVRFireArm)Weapon).Magazine.RemoveRound(); } } _hasConsumedAmmo = true; } if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null && Weapon.Chamber.IsFull && !Weapon.Chamber.IsSpent) { _hasConsumedAmmo = false; } if ((((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode || !(Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir) <= 45f) || !(((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f) || !((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) && (!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode || !((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonDown)) { _hasPlayed = false; } if ((!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) || (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonDown)) { if (Weapon.m_fireSelectorMode == 0 && !_hasPlayed) { Animator.Play(AnimationNode1Name); SM.PlayCoreSound((FVRPooledAudioType)41, ModeChangeAudio1, ((Component)Weapon).transform.position); LeverRing.transform.localPosition = new Vector3(0f, 0f, 0f); ((FVRFireArm)Weapon).RecoilProfile = Recoil1; ((FVRFireArm)Weapon).MuzzlePos = MuzzlePoint1; ((FVRFireArm)Weapon).CurrentMuzzle = MuzzlePoint1; _hasPlayed = true; } else if (Weapon.m_fireSelectorMode == 1 && !_hasPlayed) { Animator.Play(AnimationNode2Name); SM.PlayCoreSound((FVRPooledAudioType)41, ModeChangeAudio2, ((Component)Weapon).transform.position); LeverRing.transform.localPosition = new Vector3(0f, 0f, 1f); ((FVRFireArm)Weapon).RecoilProfile = Recoil2; ((FVRFireArm)Weapon).MuzzlePos = MuzzlePoint2; ((FVRFireArm)Weapon).CurrentMuzzle = MuzzlePoint2; _hasPlayed = true; } } } } public class DispAngle : MonoBehaviour { public Text DispText; public Transform Base; public bool UseXZAngle; private void FixedUpdate() { //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_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_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_0068: 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_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_008b: 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) if ((Object)(object)Base != (Object)null) { float num = ((!(Base.eulerAngles.z > 180f)) ? Base.eulerAngles.z : (360f - Base.eulerAngles.z)); float num2 = ((!(Base.eulerAngles.x > 180f)) ? Base.eulerAngles.x : (360f - Base.eulerAngles.x)); string text = ((!(num2 >= num) || !UseXZAngle) ? num.ToString("f0") : num2.ToString("f0")); DispText.text = text; } } } } public class FateWeaponSystem : MonoBehaviour { public ClosedBoltWeapon Weapon; public Animator Animator; public string AnimBase2AltName = "Base2Alt"; public string AnimAlt2BaseName = "Alt2Base"; public string AnimAltReloadP1Name = "Alt_Reload_P1"; public string AnimAltReloadP2Name = "Alt_Reload_P2"; public string AnimReloadP1Name = "Reload_P1"; public string AnimReloadP2Name = "Reload_P2"; public AudioEvent Base2AltAudio; public AudioEvent Alt2BaseAudio; public FVRFirearmAudioSet BaseAudioSet; public FVRFirearmAudioSet AltAudioSet; public FVRFireArmRecoilProfile BaseRecoil; public FVRFireArmRecoilProfile AltRecoil; public FireArmRoundClass BaseRoundClass; public FireArmRoundClass AltRoundClass; public Transform BaseMuzzlePoint; public Transform AltMuzzlePoint; public float BaseForwardSpeed; public float BaseRearwardSpeed; public float BaseStiffness; public float AltForwardSpeed; public float AltRearwardSpeed; public float AltStiffness; private bool _hasPlayed = true; private Vector2 dir = Vector2.left; private Vector2 dir2 = Vector2.down; private Vector3 v3; private Vector3 velLinearWorld; private bool _hasPlayedReloadEmptyP1 = false; private bool _hasPlayedReloadEmptyP2 = true; private int CurMode = 0; public void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) Animator.cullingMode = (AnimatorCullingMode)0; SM.PlayCoreSound((FVRPooledAudioType)0, Alt2BaseAudio, ((Component)Weapon).transform.position); } public void Update() { //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if (CurMode == 0) { if ((Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != BaseRoundClass && AM.DoesClassExistForType(BaseRoundClass, Weapon.Chamber.m_round.RoundType)) { GameObject gameObject = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, BaseRoundClass)).GetGameObject(); Weapon.Chamber.SetRound(gameObject.GetComponent(), false); } if (((Object)(object)((FVRFireArm)Weapon).Magazine == (Object)null || ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound() && (int)Weapon.Bolt.CurPos == 0)) && !Weapon.Chamber.IsFull && !_hasPlayedReloadEmptyP1) { Animator.Play(AnimReloadP1Name); _hasPlayedReloadEmptyP1 = true; _hasPlayedReloadEmptyP2 = false; } if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && ((FVRFireArm)Weapon).Magazine.HasARound() && _hasPlayedReloadEmptyP1) { Animator.Play(AnimReloadP2Name); _hasPlayedReloadEmptyP1 = false; if (!Weapon.Chamber.IsFull) { Weapon.Bolt.ImpartFiringImpulse(); } _hasPlayedReloadEmptyP2 = true; } } if (CurMode == 1) { if ((Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != AltRoundClass && AM.DoesClassExistForType(AltRoundClass, Weapon.Chamber.m_round.RoundType)) { GameObject gameObject2 = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, AltRoundClass)).GetGameObject(); Weapon.Chamber.SetRound(gameObject2.GetComponent(), false); } if (((Object)(object)((FVRFireArm)Weapon).Magazine == (Object)null || ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound() && (int)Weapon.Bolt.CurPos == 0)) && !Weapon.Chamber.IsFull && !_hasPlayedReloadEmptyP1) { _hasPlayedReloadEmptyP2 = false; Animator.Play(AnimAltReloadP1Name); _hasPlayedReloadEmptyP1 = true; } else if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && ((FVRFireArm)Weapon).Magazine.HasARound() && !_hasPlayedReloadEmptyP2) { _hasPlayedReloadEmptyP1 = false; Animator.Play(AnimAltReloadP2Name); if (!Weapon.Chamber.IsFull) { Weapon.Bolt.ImpartFiringImpulse(); } _hasPlayedReloadEmptyP2 = true; } } if ((((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode || !(Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, Vector2.left) <= 45f) || !(((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f) || !((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) && (!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode || !((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonDown)) { _hasPlayed = false; } if (((!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, Vector2.left) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) || (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonDown)) && Weapon.Chamber.IsFull && !Weapon.Chamber.IsSpent) { if (CurMode == 1 && !_hasPlayed) { CurMode = 0; Animator.Play(AnimAlt2BaseName); SM.PlayCoreSound((FVRPooledAudioType)0, Alt2BaseAudio, ((Component)Weapon).transform.position); ((FVRFireArm)Weapon).AudioClipSet = BaseAudioSet; ((FVRFireArm)Weapon).RecoilProfile = BaseRecoil; ((FVRFireArm)Weapon).MuzzlePos = BaseMuzzlePoint; ((FVRFireArm)Weapon).CurrentMuzzle = BaseMuzzlePoint; Weapon.Bolt.Speed_Forward = BaseForwardSpeed; Weapon.Bolt.Speed_Rearward = BaseRearwardSpeed; Weapon.Bolt.SpringStiffness = BaseStiffness; _hasPlayed = true; } else if (CurMode == 0 && !_hasPlayed) { CurMode = 1; Animator.Play(AnimBase2AltName); SM.PlayCoreSound((FVRPooledAudioType)0, Base2AltAudio, ((Component)Weapon).transform.position); ((FVRFireArm)Weapon).AudioClipSet = AltAudioSet; ((FVRFireArm)Weapon).RecoilProfile = AltRecoil; ((FVRFireArm)Weapon).MuzzlePos = AltMuzzlePoint; ((FVRFireArm)Weapon).CurrentMuzzle = AltMuzzlePoint; Weapon.Bolt.Speed_Forward = AltForwardSpeed; Weapon.Bolt.Speed_Rearward = AltRearwardSpeed; Weapon.Bolt.SpringStiffness = AltStiffness; _hasPlayed = true; } } } } public class FreedomWeaponSystem : MonoBehaviour { public TubeFedShotgun Weapon; public Animator Animator; public AnimationClip clip; public string AnimBase2AltName = "Base2Alt"; public string AnimAlt2BaseName = "Alt2Base"; public string AnimAltIdleName = "AltIdle"; public string AnimAltFireName = "AltFire"; public string AnimAltRechamberName = "AltRechamber"; public string AnimAltEmptyName = "AltEmpty"; public string AnimAltEmptyChamberName = "AltEmptyChamber"; public string AnimEmptyName = "Empty"; public string AnimEmptyChamberName = "EmptyChamber"; public string AnimChamber1Name = "Chamber1"; public string AnimChamber2Name = "Chamber2"; public AudioEvent Base2AltAudio; public AudioEvent Alt2BaseAudio; public FVRFirearmAudioSet BaseAudioSet; public FVRFirearmAudioSet AltAudioSet; public FVRFireArmRecoilProfile BaseRecoil; public FVRFireArmRecoilProfile AltRecoil; public FireArmRoundClass BaseRoundClass; public FireArmRoundClass AltRoundClass; public Transform BaseMuzzlePoint; public Transform AltMuzzlePoint; public GameObject SightSG; public GameObject SightSR; public GameObject ForeSG; public GameObject ForeSR; public GameObject AdditionalBarrel; public float BaseForwardSpeed; public float BaseRearwardSpeed; public float BaseStiffness; public float AltForwardSpeed; public float AltRearwardSpeed; public float AltStiffness; private bool _hasPlayed = true; private Vector2 dir = Vector2.left; private Vector2 dir2 = Vector2.down; private Vector3 v3; private Vector3 velLinearWorld; private bool _hasPlayedFire = true; private bool _hasPlayedReloadEmptyP1 = false; private bool _hasPlayedReloadEmptyP2 = true; public void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) Animator.cullingMode = (AnimatorCullingMode)0; SM.PlayCoreSound((FVRPooledAudioType)0, Alt2BaseAudio, ((Component)Weapon).transform.position); } public void DisableForeSR() { ForeSR.SetActive(false); ForeSG.SetActive(true); } public void Update() { //IL_001e: 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_02ab: Invalid comparison between Unknown and I4 //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Invalid comparison between Unknown and I4 //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_02f2: 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_007c: 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_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Invalid comparison between Unknown and I4 //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if ((int)Weapon.Mode == 0) { if ((Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != BaseRoundClass && AM.DoesClassExistForType(BaseRoundClass, Weapon.Chamber.m_round.RoundType)) { GameObject gameObject = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, BaseRoundClass)).GetGameObject(); Weapon.Chamber.SetRound(gameObject.GetComponent(), false); } if ((int)Weapon.Handle.CurPos == 4 && (!Weapon.Chamber.IsFull || Weapon.Chamber.IsSpent) && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !_hasPlayedReloadEmptyP1) { Animator.Play(AnimChamber1Name); } if ((int)Weapon.Handle.CurPos == 0 && Weapon.Chamber.IsFull && !Weapon.Chamber.IsSpent && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !_hasPlayedReloadEmptyP1 && ForeSG.activeInHierarchy) { Animator.Play(AnimChamber2Name); } if ((Object)(object)((FVRFireArm)Weapon).Magazine == (Object)null && (!Weapon.Chamber.IsFull || Weapon.Chamber.IsSpent) && !_hasPlayedReloadEmptyP1) { Animator.Play(AnimEmptyName); _hasPlayedReloadEmptyP1 = true; _hasPlayedReloadEmptyP2 = false; } if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && ((FVRFireArm)Weapon).Magazine.HasARound() && _hasPlayedReloadEmptyP1) { Animator.Play(AnimEmptyChamberName); _hasPlayedReloadEmptyP1 = false; _hasPlayedReloadEmptyP2 = true; } } if ((int)Weapon.Mode == 1) { if ((Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != AltRoundClass && AM.DoesClassExistForType(AltRoundClass, Weapon.Chamber.m_round.RoundType)) { GameObject gameObject2 = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, AltRoundClass)).GetGameObject(); Weapon.Chamber.SetRound(gameObject2.GetComponent(), false); } if (!Weapon.Chamber.IsFull && !_hasPlayedFire && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null) { Animator.Play(AnimAltFireName); _hasPlayedFire = true; } else if (Weapon.Chamber.IsFull && _hasPlayedFire) { _hasPlayedFire = false; } if (((Object)(object)((FVRFireArm)Weapon).Magazine == (Object)null || ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound())) && (int)Weapon.Bolt.CurPos == 0 && !Weapon.Chamber.IsFull && !_hasPlayedReloadEmptyP1) { _hasPlayedReloadEmptyP2 = false; Animator.Play(AnimAltEmptyName); SightSG.SetActive(false); _hasPlayedReloadEmptyP1 = true; } else if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && ((FVRFireArm)Weapon).Magazine.HasARound() && !_hasPlayedReloadEmptyP2) { _hasPlayedReloadEmptyP1 = false; Animator.Play(AnimAltEmptyChamberName); SightSG.SetActive(true); Weapon.Bolt.ImpartFiringImpulse(); _hasPlayedReloadEmptyP2 = true; } } if ((((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode || !(Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir) <= 45f) || !(((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f) || !((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) && (!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode || !((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonDown)) { _hasPlayed = false; } if (((!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) || (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonDown)) && (int)Weapon.Bolt.CurPos == 0 && (int)Weapon.Handle.CurPos == 0) { if ((int)Weapon.Mode == 1 && !_hasPlayed) { Weapon.Mode = (ShotgunMode)0; Weapon.UsesSlamFireTrigger = true; Animator.Play(AnimAlt2BaseName); SM.PlayCoreSound((FVRPooledAudioType)0, Alt2BaseAudio, ((Component)Weapon).transform.position); ((FVRFireArm)Weapon).AudioClipSet = BaseAudioSet; ((FVRFireArm)Weapon).RecoilProfile = BaseRecoil; ((FVRFireArm)Weapon).MuzzlePos = BaseMuzzlePoint; ((FVRFireArm)Weapon).CurrentMuzzle = BaseMuzzlePoint; AdditionalBarrel.SetActive(true); Weapon.Bolt.Speed_Forward = BaseForwardSpeed; Weapon.Bolt.Speed_Rearward = BaseRearwardSpeed; Weapon.Bolt.SpringStiffness = BaseStiffness; _hasPlayed = true; } else if ((int)Weapon.Mode == 0 && !_hasPlayed) { Weapon.Mode = (ShotgunMode)1; Weapon.UsesSlamFireTrigger = false; Weapon.Handle.LockHandle(); Animator.Play(AnimBase2AltName); SM.PlayCoreSound((FVRPooledAudioType)0, Base2AltAudio, ((Component)Weapon).transform.position); ((FVRFireArm)Weapon).AudioClipSet = AltAudioSet; ((FVRFireArm)Weapon).RecoilProfile = AltRecoil; ((FVRFireArm)Weapon).MuzzlePos = AltMuzzlePoint; ((FVRFireArm)Weapon).CurrentMuzzle = AltMuzzlePoint; ForeSG.SetActive(false); ForeSR.SetActive(true); AdditionalBarrel.SetActive(false); Weapon.Bolt.Speed_Forward = AltForwardSpeed; Weapon.Bolt.Speed_Rearward = AltRearwardSpeed; Weapon.Bolt.SpringStiffness = AltStiffness; _hasPlayed = true; } } } } namespace Niko666 { public class JusticePumpFore : FVRAlternateGrip { public ClosedBoltWeapon Weapon; public Transform PumpHolder; public ClosedBoltSecondarySwitch Switch; public Animator Animator; public string AnimBase2AltPreName = "Base2AltPre"; public string AnimAlt2BasePreName = "Alt2BasePre"; public string AnimBase2AltPostName = "Base2AltPost"; public string AnimAlt2BasePostName = "Alt2BasePost"; public string AnimBaseInspName = "BaseInsp"; public string AnimAltInspName = "AltInsp"; public ForePos CurPos = (ForePos)2; public ForePos LastPos = (ForePos)2; public Transform Point_Forward; public Transform Point_Rearward; public AudioEvent AudEvent_PumpClose; public AudioEvent AudEvent_PumpOpen; public AudioEvent AudEvent_PumpForward; public AudioEvent AudEvent_PumpRearward; public FVRFirearmAudioSet BaseAudioSet; public FVRFirearmAudioSet AltAudioSet; public FVRFireArmRecoilProfile BaseRecoil; public FVRFireArmRecoilProfile AltRecoil; public FireArmRoundType BaseRoundType; public FireArmRoundType AltRoundType; private float m_handZOffset; private float m_curSlideSpeed; private float m_curPumpRotSpeed = 0.1f; private float m_slideZ_current; private float m_slideZ_heldTarget; private float m_slideZ_forward; private float m_slideZ_rear; private bool m_isPumpClosed = true; private bool m_isTransformButtonPressed; private bool m_isTransforming; private bool m_isInspMode; private bool m_isPumpForwarded; 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) ((FVRAlternateGrip)this).Awake(); m_slideZ_current = ((Component)this).transform.localPosition.z; m_slideZ_forward = Point_Forward.localPosition.z; m_slideZ_rear = Point_Rearward.localPosition.z; Animator.cullingMode = (AnimatorCullingMode)0; SM.PlayCoreSound((FVRPooledAudioType)0, AudEvent_PumpClose, ((Component)Weapon).transform.position); } public override void BeginInteraction(FVRViveHand hand) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) ((FVRAlternateGrip)this).BeginInteraction(hand); m_handZOffset = ((Component)this).transform.InverseTransformPoint(((HandInput)(ref hand.Input)).Pos).z; } public void FixedUpdate() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Invalid comparison between Unknown and I4 //IL_01cf: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) if ((int)Switch.Modes[Switch.CurModeIndex].ModeType == 3 && (Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundType != BaseRoundType && AM.DoesClassExistForType(Weapon.Chamber.m_round.RoundClass, BaseRoundType)) { GameObject gameObject = ((AnvilAsset)AM.GetRoundSelfPrefab(BaseRoundType, Weapon.Chamber.m_round.RoundClass)).GetGameObject(); Weapon.Chamber.SetRound(gameObject.GetComponent(), false); } if ((int)Switch.Modes[Switch.CurModeIndex].ModeType == 1 && (Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundType != AltRoundType && AM.DoesClassExistForType(Weapon.Chamber.m_round.RoundClass, AltRoundType)) { GameObject gameObject2 = ((AnvilAsset)AM.GetRoundSelfPrefab(AltRoundType, Weapon.Chamber.m_round.RoundClass)).GetGameObject(); Weapon.Chamber.SetRound(gameObject2.GetComponent(), false); } if (!m_isPumpClosed) { PumpHolder.localPosition = new Vector3(Mathf.SmoothDamp(PumpHolder.localPosition.x, 1f, ref m_curPumpRotSpeed, 0.1f), 0f, 0f); } else if (!m_isTransforming) { PumpHolder.localPosition = new Vector3(Mathf.SmoothDamp(PumpHolder.localPosition.x, 0f, ref m_curPumpRotSpeed, 0.1f), 0f, 0f); } } public override void UpdateInteraction(FVRViveHand hand) { //IL_00ac: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0282: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Expected I4, but got Unknown //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Expected I4, but got Unknown //IL_029d: 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_02a9: Invalid comparison between Unknown and I4 //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Invalid comparison between Unknown and I4 //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Invalid comparison between Unknown and I4 //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Invalid comparison between Unknown and I4 //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Invalid comparison between Unknown and I4 //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Invalid comparison between Unknown and I4 //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Invalid comparison between Unknown and I4 //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Invalid comparison between Unknown and I4 //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Invalid comparison between Unknown and I4 //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_0608: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Invalid comparison between Unknown and I4 //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Invalid comparison between Unknown and I4 //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Invalid comparison between Unknown and I4 //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Invalid comparison between Unknown and I4 ((FVRAlternateGrip)this).UpdateInteraction(hand); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(m_slideZ_rear, m_slideZ_forward); float num = m_slideZ_current; m_isTransformButtonPressed = false; if ((hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadPressed && Vector3.Angle(Vector2.op_Implicit(hand.Input.TouchpadAxes), Vector2.op_Implicit(Vector2.up)) < 45f)) { m_isTransformButtonPressed = true; if ((int)Weapon.FireSelector_Modes[Weapon.m_fireSelectorMode].ModeType != 0 && !m_isTransforming) { m_isPumpClosed = false; ((FVRFireArm)Weapon).PlayAudioAsHandling(AudEvent_PumpOpen, ((Component)this).transform.position); Weapon.m_isHammerCocked = false; } } if (((FVRInteractiveObject)this).IsHeld) { Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Forward.position, Point_Rearward.position, ((HandInput)(ref hand.Input)).Pos - ((Component)this).transform.forward * m_handZOffset * ((Component)Weapon).transform.localScale.x); m_slideZ_heldTarget = ((Component)Weapon).transform.InverseTransformPoint(closestValidPoint).z; float slideZ_heldTarget = m_slideZ_heldTarget; num = Mathf.MoveTowards(m_slideZ_current, slideZ_heldTarget, 5f * Time.deltaTime); } num = Mathf.Clamp(num, val.x, val.y); if (Mathf.Abs(num - m_slideZ_current) > Mathf.Epsilon) { if (!m_isPumpClosed) { m_slideZ_current = num; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_slideZ_current); } } else { m_curSlideSpeed = 0f; } ForePos val2 = ((Mathf.Abs(m_slideZ_current - m_slideZ_forward) < 0.003f) ? ((ForePos)0) : ((!(Mathf.Abs(m_slideZ_current - m_slideZ_rear) < 0.001f)) ? ((ForePos)1) : ((ForePos)2))); int num2 = (int)CurPos; CurPos = (ForePos)Mathf.Clamp((int)val2, num2 - 1, num2 + 1); if ((int)CurPos == 2 && (int)LastPos != 2 && m_isPumpForwarded) { ((FVRFireArm)Weapon).PlayAudioAsHandling(AudEvent_PumpRearward, ((Component)this).transform.position); Animator.Play(((int)Switch.Modes[Switch.CurModeIndex].ModeType != 3) ? AnimAltInspName : AnimBaseInspName); m_isTransforming = true; Weapon.m_isHammerCocked = false; } else if ((int)CurPos != 2 && (int)LastPos == 2) { m_isPumpClosed = false; } else if ((int)CurPos == 0 && (int)LastPos != 0 && !m_isPumpForwarded) { ((FVRFireArm)Weapon).PlayAudioAsHandling(AudEvent_PumpForward, ((Component)this).transform.position); Animator.Play(((int)Switch.Modes[Switch.CurModeIndex].ModeType != 3) ? AnimAlt2BasePreName : AnimBase2AltPreName); m_isPumpForwarded = true; Weapon.m_isHammerCocked = false; } else if ((int)CurPos == 2 && (int)LastPos == 2 && m_isTransforming) { if (m_isTransformButtonPressed) { Switch.CycleMode(); ((FVRFireArm)Weapon).PlayAudioAsHandling(AudEvent_PumpClose, ((Component)this).transform.position); Animator.Play(((int)Switch.Modes[Switch.CurModeIndex].ModeType != 3) ? AnimBase2AltPostName : AnimAlt2BasePostName); ((FVRFireArm)Weapon).AudioClipSet = (((int)Switch.Modes[Switch.CurModeIndex].ModeType != 3) ? AltAudioSet : BaseAudioSet); ((FVRFireArm)Weapon).RecoilProfile = (((int)Switch.Modes[Switch.CurModeIndex].ModeType != 3) ? AltRecoil : BaseRecoil); Weapon.Bolt.HasReciprocatingBarrel = (int)Switch.Modes[Switch.CurModeIndex].ModeType != 3; m_isTransforming = false; m_isPumpForwarded = false; m_isPumpClosed = true; Weapon.m_isHammerCocked = true; } else if ((hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.AXButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadPressed && Vector3.Angle(Vector2.op_Implicit(hand.Input.TouchpadAxes), Vector2.op_Implicit(Vector2.down)) < 45f)) { ((FVRFireArm)Weapon).PlayAudioAsHandling(AudEvent_PumpClose, ((Component)this).transform.position); Animator.Play(((int)Switch.Modes[Switch.CurModeIndex].ModeType != 3) ? AnimBase2AltPostName : AnimAlt2BasePostName); m_isTransforming = false; m_isPumpForwarded = false; m_isPumpClosed = true; Weapon.m_isHammerCocked = true; } } LastPos = CurPos; } } public class LaserLightOnOffToggleThing : MonoBehaviour { public LaserLightAttachment Attachment; public GameObject OnObject; public GameObject OffObject; private void Update() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Attachment != (Object)null && Attachment.Settings.Count > 0) { LaserLightSetting val = Attachment.Settings[Attachment.SettingsIndex]; if ((int)val.LaserMode == 0 && (int)val.LightMode == 0) { OffObject.SetActive(true); OnObject.SetActive(false); } else { OffObject.SetActive(false); OnObject.SetActive(true); } } } } public class M4TZombieDualBarrelSystem : FVRInteractiveObject { [Serializable] public class Muzzles { public Transform MuzzlePosition; public GameObject MuzzleObject; public MuzzleState MuzzleState; public FVRFireArmMechanicalAccuracyClass MuzzleDamping; public MuzzleEffectSize CustomMuzzleEffectSize; public MuzzleEffect[] CustomMuzzleEffects; } public ClosedBoltWeapon Weapon; private int CurMuzzleIndex; private int MuzzlePosIndex; public Muzzles[] MuzzlesIndexes; public AudioEvent AudEvent_Toggle; public GameObject MuzzlePozHolder; private bool _hasSwitchedMuzzle = true; public override void SimpleInteraction(FVRViveHand hand) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); SM.PlayCoreSound((FVRPooledAudioType)0, AudEvent_Toggle, base.GameObject.transform.position); for (int i = 0; i < MuzzlesIndexes.Length; i++) { MuzzlesIndexes[i].MuzzleObject.SetActive(false); } CurMuzzleIndex++; if (CurMuzzleIndex >= MuzzlesIndexes.Length) { CurMuzzleIndex = 0; } ((FVRFireArm)Weapon).DefaultMuzzleState = MuzzlesIndexes[CurMuzzleIndex].MuzzleState; ((FVRFireArm)Weapon).AccuracyClass = MuzzlesIndexes[CurMuzzleIndex].MuzzleDamping; ((FVRFireArm)Weapon).DefaultMuzzleDamping = MuzzlesIndexes[CurMuzzleIndex].MuzzleDamping; ((FVRFireArm)Weapon).DefaultMuzzleEffectSize = MuzzlesIndexes[CurMuzzleIndex].CustomMuzzleEffectSize; ((FVRFireArm)Weapon).MuzzleEffects = MuzzlesIndexes[CurMuzzleIndex].CustomMuzzleEffects; MuzzlePozHolder.transform.position = MuzzlesIndexes[CurMuzzleIndex].MuzzlePosition.position; MuzzlesIndexes[CurMuzzleIndex].MuzzleObject.SetActive(true); } } public class M7SBAnimController : MonoBehaviour { public ClosedBoltWeapon Weapon; public Transform Proxy; public void Update() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRFireArm)Weapon).Magazine == (Object)null) { Proxy.localPosition = new Vector3(1f, 0f, 0f); } else if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound() && !Weapon.Chamber.IsFull) { Proxy.localPosition = new Vector3(2f, 0f, 0f); } else { Proxy.localPosition = new Vector3(0f, 0f, 0f); } } } public class MaterialSwitch : FVRInteractiveObject { [Serializable] public class MaterialSet { public Material[] Materials; public Renderer[] Renderers; } public GameObject Base; public int CurMaterialIndex = 0; public MaterialSet[] MaterialSets; public AudioEvent AudEvent_Toggle; public override void Awake() { ((FVRInteractiveObject)this).Awake(); ApplyMaterial(); } public override void SimpleInteraction(FVRViveHand hand) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); if (MaterialSets == null || MaterialSets.Length == 0) { Debug.LogWarning((object)"Cannot toggle materials: MaterialSets is null or empty"); return; } SM.PlayCoreSound((FVRPooledAudioType)0, AudEvent_Toggle, base.GameObject.transform.position); CurMaterialIndex++; int num = MaterialSets.Min((MaterialSet ms) => (ms.Materials != null) ? ms.Materials.Length : 0); if (num > 0) { CurMaterialIndex %= num; } else { CurMaterialIndex = 0; Debug.LogWarning((object)"All Materials arrays are empty, resetting CurMaterialIndex"); } ApplyMaterial(); } private void ApplyMaterial() { if (MaterialSets == null || MaterialSets.Length == 0) { Debug.LogWarning((object)"MaterialSets is null or empty"); return; } for (int i = 0; i < MaterialSets.Length; i++) { if (MaterialSets[i] == null || MaterialSets[i].Renderers == null) { Debug.LogWarning((object)"MaterialSet at index {i} or its Renderers is null"); continue; } if (MaterialSets[i].Materials == null || MaterialSets[i].Materials.Length == 0) { Debug.LogWarning((object)"Materials array in MaterialSet at index {i} is null or empty"); continue; } int num = CurMaterialIndex % MaterialSets[i].Materials.Length; Renderer[] renderers = MaterialSets[i].Renderers; foreach (Renderer val in renderers) { if ((Object)(object)val != (Object)null) { val.material = MaterialSets[i].Materials[num]; } } } } } public class MuzzlePointForDiffModes : MonoBehaviour { public ClosedBoltWeapon Weapon; public int FireSelectorPosition1; public int FireSelectorPosition2; public Transform Muzzle1; public Transform Muzzle2; public void Update() { if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null) { if (Weapon.m_fireSelectorMode == FireSelectorPosition1) { ((FVRFireArm)Weapon).MuzzlePos = Muzzle1; ((FVRFireArm)Weapon).CurrentMuzzle = Muzzle1; } if (Weapon.m_fireSelectorMode == FireSelectorPosition2) { ((FVRFireArm)Weapon).MuzzlePos = Muzzle2; ((FVRFireArm)Weapon).CurrentMuzzle = Muzzle2; } } } } public class MuzzleSwitch : FVRInteractiveObject { [Serializable] public class Muzzles { public Transform MuzzlePosition; public GameObject MuzzleObject; public MuzzleState MuzzleState; public FVRFireArmMechanicalAccuracyClass MuzzleDamping; public MuzzleEffectSize CustomMuzzleEffectSize; public MuzzleEffect[] CustomMuzzleEffects; } public ClosedBoltWeapon Weapon; public int CurMuzzleIndex = 0; public Muzzles[] MuzzlesIndexes; public AudioEvent AudEvent_Toggle; public override void SimpleInteraction(FVRViveHand hand) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); SM.PlayCoreSound((FVRPooledAudioType)0, AudEvent_Toggle, base.GameObject.transform.position); for (int i = 0; i < MuzzlesIndexes.Length; i++) { MuzzlesIndexes[i].MuzzleObject.SetActive(false); } CurMuzzleIndex++; if (CurMuzzleIndex >= MuzzlesIndexes.Length) { CurMuzzleIndex = 0; } ((FVRFireArm)Weapon).DefaultMuzzleState = MuzzlesIndexes[CurMuzzleIndex].MuzzleState; ((FVRFireArm)Weapon).MuzzlePos = MuzzlesIndexes[CurMuzzleIndex].MuzzlePosition; ((FVRFireArm)Weapon).AccuracyClass = MuzzlesIndexes[CurMuzzleIndex].MuzzleDamping; ((FVRFireArm)Weapon).DefaultMuzzleDamping = MuzzlesIndexes[CurMuzzleIndex].MuzzleDamping; ((FVRFireArm)Weapon).DefaultMuzzleEffectSize = MuzzlesIndexes[CurMuzzleIndex].CustomMuzzleEffectSize; ((FVRFireArm)Weapon).MuzzleEffects = MuzzlesIndexes[CurMuzzleIndex].CustomMuzzleEffects; MuzzlesIndexes[CurMuzzleIndex].MuzzleObject.SetActive(true); } } public class PistolRotateToChamber : FVRInteractiveObject { public Handgun Weapon; public Transform RotPiece; public AudioEvent HandleCrank; private float m_curRot; private Vector3 lastHandForward = Vector3.zero; public override void BeginInteraction(FVRViveHand hand) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); lastHandForward = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, ((Component)this).transform.right); } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); } public override void FVRFixedUpdate() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)this).IsHeld) { float curRot = m_curRot; Vector3 val = Vector3.ProjectOnPlane(((HandInput)(ref base.m_hand.Input)).Up, -((Component)this).transform.right); Vector3 val2 = Vector3.ProjectOnPlane(lastHandForward, -((Component)this).transform.right); float num = Mathf.Atan2(Vector3.Dot(-((Component)this).transform.right, Vector3.Cross(val, val2)), Vector3.Dot(val, val2)) * 57.29578f; if (num > 0f) { m_curRot -= num; } if (curRot > -45f && m_curRot <= -45f) { SM.PlayCoreSound((FVRPooledAudioType)10, HandleCrank, ((Component)this).transform.position); } if (m_curRot <= -90f) { RotPiece.localEulerAngles = new Vector3(0f, 0f, 0f); Weapon.Slide.KnockToRear(); SM.PlayCoreSound((FVRPooledAudioType)10, HandleCrank, ((Component)this).transform.position); m_curRot = 0f; base.m_hand.EndInteractionIfHeld((FVRInteractiveObject)(object)this); ((FVRInteractiveObject)this).ForceBreakInteraction(); } else { RotPiece.localEulerAngles = new Vector3(0f, 0f, m_curRot); } lastHandForward = val; } ((FVRInteractiveObject)this).FVRFixedUpdate(); } } public class PlayAnimWhenModeChange : MonoBehaviour { public ClosedBoltWeapon Weapon; public Animator Animator; public string AnimationNode1Name = "animation1"; public string AnimationNode2Name = "animation2"; public int FireSelectorPosition1; public int FireSelectorPosition2; private Vector2 dir = Vector2.left; public void Awake() { Animator.cullingMode = (AnimatorCullingMode)0; } public void Update() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if (!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) { if (Weapon.m_fireSelectorMode == FireSelectorPosition1) { Animator.Play(AnimationNode1Name); } else if (Weapon.m_fireSelectorMode == FireSelectorPosition2) { Animator.Play(AnimationNode2Name); } } if (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonPressed) { if (Weapon.m_fireSelectorMode == FireSelectorPosition1) { Animator.Play(AnimationNode1Name); } else if (Weapon.m_fireSelectorMode == FireSelectorPosition2) { Animator.Play(AnimationNode2Name); } } } } public class PlayAudioWhenModeChange : MonoBehaviour { public ClosedBoltWeapon Weapon; public int SemiAutoFireSelectorPosition; public int FullAutoFireSelectorPosition; public AudioClip FullAutoAudioClips; public AudioClip SemiAutoAudioClips; public AudioSource AudioSource; private Vector2 dir = Vector2.left; public void Update() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if (!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, dir) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) { if (Weapon.m_fireSelectorMode == SemiAutoFireSelectorPosition) { AudioSource.clip = SemiAutoAudioClips; if (!AudioSource.isPlaying) { AudioSource.Play(); } } else if (Weapon.m_fireSelectorMode == FullAutoFireSelectorPosition) { AudioSource.clip = FullAutoAudioClips; if (!AudioSource.isPlaying) { AudioSource.Play(); } } } if (!((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode || !((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonPressed) { return; } if (Weapon.m_fireSelectorMode == SemiAutoFireSelectorPosition) { AudioSource.clip = SemiAutoAudioClips; if (!AudioSource.isPlaying) { AudioSource.Play(); } } else if (Weapon.m_fireSelectorMode == FullAutoFireSelectorPosition) { AudioSource.clip = FullAutoAudioClips; if (!AudioSource.isPlaying) { AudioSource.Play(); } } } } public class PlayAudioWhenTransform : MonoBehaviour { public enum dirtype { x, y, z, w } public enum transformtype { position, rotation, scale, quaternion, quaternionPresentedEuler } [Header("Object Being Observed")] public GameObject ObservedObject; public dirtype DirectionOfObservation; public transformtype TransformationTypeOfObservedObject; public float StartOfObservation; public float StopOfObservation; [Header("Audio")] public AudioClip AudioClipsStartOfObservation; public AudioClip AudioClipsStopOfObservation; public AudioSource AudioSource; [HideInInspector] public float observationpoint; [HideInInspector] public bool _isObservedObjectNotNull; public bool _hasPlayedStartAudio = false; public bool _hasPlayedStopAudio = false; public void Start() { _isObservedObjectNotNull = (Object)(object)ObservedObject != (Object)null; _hasPlayedStartAudio = false; _hasPlayedStopAudio = false; } public void Update() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) if (_isObservedObjectNotNull) { switch (TransformationTypeOfObservedObject) { case transformtype.position: { Vector3 localPosition = ObservedObject.transform.localPosition; observationpoint = ((Vector3)(ref localPosition))[(int)DirectionOfObservation]; break; } case transformtype.rotation: { Vector3 localEulerAngles = ObservedObject.transform.localEulerAngles; observationpoint = ((Vector3)(ref localEulerAngles))[(int)DirectionOfObservation]; break; } case transformtype.scale: { Vector3 localScale = ObservedObject.transform.localScale; observationpoint = ((Vector3)(ref localScale))[(int)DirectionOfObservation]; break; } case transformtype.quaternion: { Quaternion localRotation2 = ObservedObject.transform.localRotation; observationpoint = ((Quaternion)(ref localRotation2))[(int)DirectionOfObservation]; break; } case transformtype.quaternionPresentedEuler: { Quaternion localRotation = ObservedObject.transform.localRotation; observationpoint = ((Quaternion)(ref localRotation))[(int)DirectionOfObservation] * 180f; break; } } } if (observationpoint == StopOfObservation) { _hasPlayedStartAudio = false; if (!_hasPlayedStopAudio) { AudioSource.clip = AudioClipsStopOfObservation; if (!AudioSource.isPlaying) { AudioSource.PlayOneShot(AudioClipsStopOfObservation, 0.4f); } } _hasPlayedStopAudio = true; } if (observationpoint != StartOfObservation) { return; } _hasPlayedStopAudio = false; if (!_hasPlayedStartAudio) { AudioSource.clip = AudioClipsStartOfObservation; if (!AudioSource.isPlaying) { AudioSource.PlayOneShot(AudioClipsStartOfObservation, 0.4f); } _hasPlayedStartAudio = true; } } } public class RoundClassForDiffModes : MonoBehaviour { public ClosedBoltWeapon Weapon; public int FireSelectorPosition1; public int FireSelectorPosition2; public FireArmRoundClass RoundClass1; public FireArmRoundClass RoundClass2; public void Update() { //IL_0070: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_0151: 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) if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null) { if (Weapon.m_fireSelectorMode == FireSelectorPosition1 && (Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != RoundClass1) { Weapon.Chamber.m_round = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, RoundClass1)).GetGameObject().GetComponent(); Weapon.Chamber.UpdateProxyDisplay(); } if (Weapon.m_fireSelectorMode == FireSelectorPosition2 && (Object)(object)Weapon.Chamber != (Object)null && (Object)(object)Weapon.Chamber.m_round != (Object)null && Weapon.Chamber.m_round.RoundClass != RoundClass2) { Weapon.Chamber.m_round = ((AnvilAsset)AM.GetRoundSelfPrefab(Weapon.Chamber.m_round.RoundType, RoundClass2)).GetGameObject().GetComponent(); Weapon.Chamber.UpdateProxyDisplay(); } } } } public class SlapToEjectMag : MonoBehaviour { public ClosedBoltWeapon gun; private Vector3 velLinearWorld; public Transform slapdir; private bool Slamed = false; public GameObject assistGeo; public float forwardvalue; public float forref; public AudioEvent slap; public void FixedUpdate() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRInteractiveObject)gun).m_hand != (Object)null) { velLinearWorld = ((FVRInteractiveObject)gun).m_hand.OtherHand.Input.VelLinearWorld; if (!Slamed && Vector3.Distance(((FVRInteractiveObject)gun).m_hand.OtherHand.PalmTransform.position, slapdir.position) < 0.1f && Vector3.Angle(velLinearWorld, slapdir.forward) < 50f && ((Vector3)(ref velLinearWorld)).magnitude > 1.5f) { Slamed = true; } } if (Slamed) { if ((Object)(object)((FVRFireArm)gun).Magazine != (Object)null) { ((FVRFireArm)gun).EjectMag(false); } } else if (!Slamed) { assistGeo.transform.localPosition = new Vector3(0f, 0f, Mathf.SmoothDamp(assistGeo.transform.localPosition.z, 0f, ref forref, 0.1f)); } if (assistGeo.transform.localPosition.z >= forwardvalue * 0.9f) { Slamed = false; } } } public class UniversalShotgunSpeedloader : MonoBehaviour { private FVRFireArm CurrentShotgun; public FVRFireArmClip Clip; private bool _loadingRounds = false; private void OnTriggerEnter(Collider collider) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Clip != (Object)null) || !((Object)(object)((FVRInteractiveObject)Clip).m_hand != (Object)null) || !((Object)(object)((FVRPhysicalObject)Clip).QuickbeltSlot == (Object)null) || !((Object)(object)collider != (Object)null) || !((Component)collider).gameObject.CompareTag("FVRFireArmMagazineReloadTrigger")) { return; } FVRFireArmMagazineReloadTrigger component = ((Component)collider).gameObject.GetComponent(); if (!((Object)(object)component != (Object)null) || !((Object)(object)component.Magazine != (Object)null) || !component.Magazine.IsIntegrated || !((Object)(object)component.Magazine.FireArm != (Object)null) || !(component.Magazine.FireArm.ClipEjectDelay <= 0f)) { return; } if (!_loadingRounds && (Object)(object)((Component)component.Magazine.FireArm).gameObject.GetComponent() != (Object)null) { CurrentShotgun = (FVRFireArm)(object)((Component)component.Magazine.FireArm).gameObject.GetComponent(); if (CurrentShotgun.RoundType == Clip.RoundType) { ((MonoBehaviour)this).StartCoroutine(LoadRoundsOneByOne()); } } else if (!_loadingRounds && (Object)(object)((Component)component.Magazine.FireArm).gameObject.GetComponent() != (Object)null) { CurrentShotgun = (FVRFireArm)(object)((Component)component.Magazine.FireArm).gameObject.GetComponent(); if (CurrentShotgun.RoundType == Clip.RoundType) { ((MonoBehaviour)this).StartCoroutine(LoadRoundsOneByOne()); } } } private void OnTriggerExit(Collider collider) { ((MonoBehaviour)this).StopCoroutine(LoadRoundsOneByOne()); } private IEnumerator LoadRoundsOneByOne() { _loadingRounds = true; while (Clip.HasARound() && !CurrentShotgun.Magazine.IsFull()) { if (!CurrentShotgun.Magazine.IsFull() && Clip.HasARound()) { FireArmRoundClass val = Clip.RemoveRoundReturnClass(); SM.PlayGenericSound(Clip.LoadFromClipToMag, ((Component)CurrentShotgun).transform.position); CurrentShotgun.Magazine.AddRound(val, false, true); } else { SM.PlayGenericSound(Clip.RemoveClip, ((Component)CurrentShotgun).transform.position); } yield return (object)new WaitForSeconds(0.1f); } _loadingRounds = false; } } } namespace H3VRUtils.Vehicles { public class ButtonIgnition : FVRInteractiveObject { public VehicleControl vehicle; public VehicleAudioSet audioSet; public float ignitionTime; private float m_it; public float failChance; public Random rand; public void Start() { rand = new Random(); } public void BeginInteraction(FVRViveHand hand) { m_it = ignitionTime; if (!vehicle.isOn) { if (vehicle.isForciblyOff) { } } else { vehicle.TurnOffEngine(forcibly: false); } } public void UpdateInteraction(FVRViveHand hand) { m_it -= Time.fixedDeltaTime; if (m_it <= 0f) { float num = (float)rand.Next(0, 10000) / 100f; if (!(num <= failChance)) { vehicle.TurnOnEngine(forcibly: false); } } } } } namespace H3VRUtils.Vehicles.Core { public class DamagingArea : MonoBehaviour { public VehicleControl vehicle; public float damageMult = 15f; public float sharpyness = 50f; } } namespace H3VRUtils.Vehicles { [Serializable] public class DriveShiftNode { public Vector3 localposition; public Vector3 rotation; public int left = -1; public int up = -1; public int right = -1; public int down = -1; public int gear = 0; } public class DriveShift : FVRInteractiveObject { public VehicleControl vehicle; public Text gearText; public int currentNode; public List driveShiftNodes; public VehicleAudioSet audioSet; public void Update() { if (vehicle.carSetting.automaticGear) { if (vehicle.currentGear > 0 && vehicle.speed > 1f) { gearText.text = vehicle.currentGear.ToString(); } else if (vehicle.speed > 1f) { gearText.text = "R"; } else { gearText.text = "N"; } } else if (vehicle.NeutralGear) { gearText.text = "N"; } else if (vehicle.currentGear != 0) { gearText.text = vehicle.currentGear.ToString(); } else { gearText.text = "R"; } } public void UpdateInteraction(FVRViveHand hand) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) bool flag = false; if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].left != -1) { flag = true; currentNode = driveShiftNodes[currentNode].left; } if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].up != -1) { flag = true; currentNode = driveShiftNodes[currentNode].up; } if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].right != -1) { flag = true; currentNode = driveShiftNodes[currentNode].right; } if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && driveShiftNodes[currentNode].down != -1) { flag = true; currentNode = driveShiftNodes[currentNode].down; } if (flag) { vehicle.ShiftTo(driveShiftNodes[currentNode].gear); ((Component)this).transform.localPosition = driveShiftNodes[currentNode].localposition; ((Component)this).transform.localEulerAngles = driveShiftNodes[currentNode].rotation; } } } internal class EngineDamagable : VehicleDamagable { public GameObject particleSystemCentre; public GameObject explosionCentre; public float SmokeParticleHPThreshold; public float explosionStrength = 200f; public GameObject particleSmokePrefab; public GameObject particleFirePrefab; public GameObject explosionPrefab; public GameObject fixedMesh; public GameObject damagedMesh; public GameObject destroyedMesh; private ParticleSystem particleSmoke; private ParticleSystem particleFire; public void Start() { GameObject val = Object.Instantiate(particleSmokePrefab, particleSystemCentre.transform); particleSmoke = val.GetComponent(); particleSmoke.Stop(); GameObject val2 = Object.Instantiate(particleFirePrefab, particleSystemCentre.transform); particleFire = val2.GetComponent(); particleFire.Stop(); } public override void onHealthChange() { if (HPLessThanPercent(SmokeParticleHPThreshold)) { if (!particleSmoke.IsAlive()) { particleSmoke.Play(); } } else { particleSmoke.Stop(); } if (health < 0f) { fixedMesh.SetActive(false); damagedMesh.SetActive(false); destroyedMesh.SetActive(true); } else if (HPLessThanPercent(SmokeParticleHPThreshold)) { fixedMesh.SetActive(false); damagedMesh.SetActive(true); destroyedMesh.SetActive(false); } else { fixedMesh.SetActive(true); damagedMesh.SetActive(false); destroyedMesh.SetActive(false); } } public override void onDeath() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) particleFire.Play(); if ((Object)(object)explosionPrefab != (Object)null) { Object.Instantiate(explosionPrefab, explosionCentre.transform.position, explosionCentre.transform.rotation); } } public override void whileDead() { } public override void whileUndead() { } public override void Heal(float heal) { base.Heal(heal); } public override void HealPercent(float percentHeal) { base.HealPercent(percentHeal); } public override void onUndeath() { particleFire.Stop(); } public override void Damage() { } } internal class EnterVehicle : FVRInteractiveObject { public VehicleSeat vehicleSeat; } internal class ForkliftLift : FVRInteractiveObject { public Vector3 rotUpwards; public Vector3 rotRegular; public Vector3 rotDownwards; public GameObject lift; public float liftSpeed; public float minLiftY; public float maxLiftY; public void UpdateInteraction(FVRViveHand hand) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) Vector3 position = lift.transform.position; ((Component)this).transform.localEulerAngles = rotRegular; if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f) { position.y += liftSpeed / 50f; ((Component)this).transform.localEulerAngles = rotUpwards; } if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f) { position.y -= liftSpeed / 50f; ((Component)this).transform.localEulerAngles = rotDownwards; } if (position.y > maxLiftY) { position.y = maxLiftY; } else if (position.y < minLiftY) { position.y = minLiftY; } lift.transform.position = position; } } public class FuelNeedle : MonoBehaviour { public FuelTank tank; public GameObject needle; public bool isImperial; public Vector3 needleNoFuel; public Vector3 needleMaxFuel; public void Update() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) float num = tank.currentFuel; if (isImperial) { num *= 0.6213712f; } float num2 = Mathf.InverseLerp(0f, tank.maxFuel, num); needle.transform.localEulerAngles = Vector3.Lerp(needleNoFuel, needleMaxFuel, num2); } } public class FuelTank : VehicleDamagable { public float currentFuel; public float maxFuel; public float fuelUsagePer1000Rpm = 0.01f; public float leakMult; public GameObject explosionEffect; public bool BlowsOnDeath; public AudioSource leakSound; private new void FixedUpdate() { base.FixedUpdate(); float num = vehicle.motorRPM / 1000f; float num2 = num * (fuelUsagePer1000Rpm / 3000f); currentFuel -= num2; float num3 = Mathf.InverseLerp(maxHealth, 0f, health); currentFuel -= num3 * leakMult / 50f; if ((Object)(object)leakSound != (Object)null) { leakSound.volume = num3; } } public override void onDeath() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) base.onDeath(); if (BlowsOnDeath) { Object.Instantiate(explosionEffect, ((Component)this).transform.position, ((Component)this).transform.rotation); } } public float AddFuel(float fuelAdded) { currentFuel += fuelAdded; float num = maxFuel - currentFuel; if (num <= 0f) { return 0f; } return num; } } } namespace H3VRUtils { internal class LockGun : MonoBehaviour { public FVRPhysicalObject Firearm; public GameObject LockPos; public void Update() { } } } namespace H3VRUtils.Vehicles { public class ParkingBrakeClick : FVRInteractiveObject { public VehicleControl vehicle; public Vector3 positionOff; public Vector3 positionOn; public Vector3 rotationOff; public Vector3 rotationOn; public bool isOn; public VehicleAudioSet audioSet; } public class SpedometerNeedle : MonoBehaviour { public VehicleControl vehicle; public GameObject needle; public bool isImperial; public float maxSpeed; public Vector3 needleNoSpeed; public Vector3 needleMaxSpeed; public void Update() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs(vehicle.speed); if (isImperial) { num *= 0.6213712f; } float num2 = Mathf.InverseLerp(0f, maxSpeed, num); needle.transform.localEulerAngles = Vector3.Lerp(needleNoSpeed, needleMaxSpeed, num2); } } internal class SteeringWheel : FVRInteractiveObject { public VehicleControl vehicle; public float resetLerpSpeed; public float maxRot; public bool isBraking; public bool reverseRot; [Header("Debug Values")] public Text rotText; public float rot; public float rh; public float lr; public float inlerp; public float lerp; public float rotAmt; public VehicleAudioSet audioSet; public void BeginInteraction(FVRViveHand hand) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) Transform child = ((Component)this).transform.GetChild(0); child.parent = null; Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles; ((Component)this).transform.LookAt(((Component)hand).transform); ((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, localEulerAngles.z); child.parent = ((Component)this).transform; } public void EndInteraction(FVRViveHand hand) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Transform child = ((Component)this).transform.GetChild(0); child.parent = null; ((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, 0f, ((Component)this).transform.localEulerAngles.z); child.parent = ((Component)this).transform; } public void UpdateInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles; ((Component)this).transform.LookAt(((Component)hand).transform); Vector3 localEulerAngles2 = ((Component)this).transform.localEulerAngles; rot = Mathf.DeltaAngle((float)Math.Round(localEulerAngles2.y), (float)Math.Round(localEulerAngles.y)); rotAmt += rot; if (rotAmt >= maxRot) { rotAmt = maxRot; ((Component)this).transform.localEulerAngles = localEulerAngles; } else if (rotAmt <= 0f - maxRot) { rotAmt = 0f - maxRot; ((Component)this).transform.localEulerAngles = localEulerAngles; } else { ((Component)this).transform.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles2.y, localEulerAngles.z); } rh = localEulerAngles2.y; lr = localEulerAngles.y; SetRot(); if (Vector2.Angle(hand.Input.TouchpadAxes, -Vector2.up) <= 45f && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.3f) { isBraking = !isBraking; } float triggerFloat = hand.Input.TriggerFloat; if (isBraking) { vehicle.accel = 0f - triggerFloat; } else { vehicle.accel = triggerFloat; } } private void FixedUpdate() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.m_hand != (Object)null) { float num = resetLerpSpeed; if (rotAmt > 0f) { num = 0f - num; } if (rotAmt > num || rotAmt < 0f - num) { rotAmt += num; ((Component)this).transform.localEulerAngles = new Vector3(((Component)this).transform.localEulerAngles.x, ((Component)this).transform.localEulerAngles.y + num, ((Component)this).transform.localEulerAngles.z); vehicle.accel = 0f; SetRot(); } } } private void SetRot() { if (rotAmt > 0f) { inlerp = Mathf.InverseLerp(0f, maxRot, rotAmt); lerp = 0f - Mathf.Lerp(0f, 1f, inlerp); } else { inlerp = Mathf.InverseLerp(0f, 0f - maxRot, rotAmt); lerp = Mathf.Lerp(0f, 1f, inlerp); } if (reverseRot) { lerp = 0f - lerp; } vehicle.steer = lerp; } } [CreateAssetMenu(fileName = "New Vehicle Audio Set", menuName = "Vehicles/AudioSet", order = 0)] public class VehicleAudioSet : ScriptableObject { private static AudioEvent defaultAE; public AudioEvent VehicleStart; public AudioEvent VehicleIdle; public AudioEvent VehicleStop; public AudioEvent HandbrakeUp; public AudioEvent HandbrakeDown; public AudioEvent ShiftDownGear; public AudioEvent RevLoop; public AudioEvent ShiftUpGear; public AudioEvent Brake; public AudioEvent BrakeLong; public AudioEvent PedalSwitchSound; static VehicleAudioSet() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) AudioEvent val = new AudioEvent(); val.PitchRange = new Vector2(0.98f, 1.04f); val.VolumeRange = new Vector2(0.98f, 1.04f); val.ClipLengthRange = new Vector2(1f, 1f); defaultAE = val; } } } public enum ControlMode { simple = 1, touch } public class VehicleControl : MonoBehaviour { [Serializable] public class CarWheels { public ConnectWheel wheels; } [Serializable] public class ConnectWheel { public bool frontWheelDrive = true; public Transform frontRight; public Transform frontLeft; public WheelSetting frontSetting; public bool backWheelDrive = true; public Transform backRight; public Transform backLeft; public WheelSetting rearSetting; } [Serializable] public class WheelSetting { public float Radius = 0.4f; public float Weight = 1000f; public float Distance = 0.2f; } [Serializable] public class CarLights { public Light[] brakeLights; public Light[] reverseLights; } [Serializable] public class CarSounds { public AudioSource IdleEngine; public AudioSource LowEngine; public AudioSource HighEngine; public float minPitch = 1f; public float maxPitch = 10f; public AudioSource nitro; public AudioSource switchGear; } [Serializable] public class CarParticles { public GameObject brakeParticlePerfab; public ParticleSystem shiftParticle1; public ParticleSystem shiftParticle2; private GameObject[] wheelParticle = (GameObject[])(object)new GameObject[4]; } [Serializable] public class CarSetting { public bool showNormalGizmos = false; public Transform carSteer; public HitGround[] hitGround; public List cameraSwitchView; public float springs = 25000f; public float dampers = 1500f; public float carPower = 120f; public float shiftPower = 150f; public float brakePower = 8000f; public Vector3 shiftCentre = new Vector3(0f, -0.8f, 0f); public float maxSteerAngle = 25f; public float shiftDownRPM = 1500f; public float shiftUpRPM = 2500f; public float idleRPM = 500f; public float stiffness = 2f; public bool automaticGear = true; public float[] gears = new float[6] { -10f, 9f, 6f, 4.5f, 3f, 2.5f }; public float LimitBackwardSpeed = 60f; public float LimitForwardSpeed = 220f; } [Serializable] public class HitGround { public string tag = "street"; public bool grounded = false; public AudioClip brakeSound; public AudioClip groundSound; public Color brakeColor; } private class WheelComponent { public Transform wheel; public WheelCollider collider; public Vector3 startPos; public float rotation = 0f; public float rotation2 = 0f; public float maxSteer; public bool drive; public float pos_y = 0f; public WheelSetting settings; } public ControlMode controlMode = ControlMode.simple; public bool activeControl = false; public CarWheels carWheels; public CarLights carLights; public CarSounds carSounds; public CarParticles carParticles; public CarSetting carSetting; [HideInInspector] public float steer = 0f; [HideInInspector] public float accel = 0f; [HideInInspector] public bool brake; private bool shifmotor; [HideInInspector] public float curTorque = 100f; [HideInInspector] public float powerShift = 100f; [HideInInspector] public bool shift; private float torque = 100f; [HideInInspector] public float speed = 0f; private float lastSpeed = -10f; private bool shifting = false; private float[] efficiencyTable = new float[22] { 0.6f, 0.65f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 1f, 1f, 0.95f, 0.8f, 0.7f, 0.6f, 0.5f, 0.45f, 0.4f, 0.36f, 0.33f, 0.3f, 0.2f, 0.1f, 0.05f }; private float efficiencyTableStep = 250f; private float Pitch; private float PitchDelay; private float shiftTime = 0f; private float shiftDelay = 0f; [HideInInspector] public int currentGear = 0; [HideInInspector] public bool NeutralGear = true; [HideInInspector] public float motorRPM = 0f; [HideInInspector] public bool Backward = false; [HideInInspector] public float accelFwd = 0f; [HideInInspector] public float accelBack = 0f; [HideInInspector] public float steerAmount = 0f; private float wantedRPM = 0f; private float w_rotate; private float slip; private float slip2 = 0f; private GameObject[] Particle = (GameObject[])(object)new GameObject[4]; private Vector3 steerCurAngle; private Rigidbody myRigidbody; private WheelComponent[] wheels; public bool isOn = true; public bool isForciblyOff = false; private WheelComponent SetWheelComponent(Transform wheel, float maxSteer, bool drive, float pos_y, WheelSetting setting) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) WheelComponent wheelComponent = new WheelComponent(); GameObject val = new GameObject(((Object)wheel).name + "WheelCollider"); val.transform.parent = ((Component)this).transform; val.transform.position = wheel.position; val.transform.eulerAngles = ((Component)this).transform.eulerAngles; pos_y = val.transform.localPosition.y; WheelCollider val2 = (WheelCollider)val.AddComponent(typeof(WheelCollider)); wheelComponent.wheel = wheel; wheelComponent.collider = val.GetComponent(); wheelComponent.drive = drive; wheelComponent.pos_y = pos_y; wheelComponent.maxSteer = maxSteer; wheelComponent.startPos = val.transform.localPosition; wheelComponent.settings = setting; return wheelComponent; } private void Awake() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) if (carSetting.automaticGear) { NeutralGear = false; } myRigidbody = ((Component)((Component)this).transform).GetComponent(); wheels = new WheelComponent[4]; wheels[0] = SetWheelComponent(carWheels.wheels.frontRight, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontRight.position.y, carWheels.wheels.frontSetting); wheels[1] = SetWheelComponent(carWheels.wheels.frontLeft, carSetting.maxSteerAngle, carWheels.wheels.frontWheelDrive, carWheels.wheels.frontLeft.position.y, carWheels.wheels.frontSetting); wheels[2] = SetWheelComponent(carWheels.wheels.backRight, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backRight.position.y, carWheels.wheels.rearSetting); wheels[3] = SetWheelComponent(carWheels.wheels.backLeft, 0f, carWheels.wheels.backWheelDrive, carWheels.wheels.backLeft.position.y, carWheels.wheels.rearSetting); if (Object.op_Implicit((Object)(object)carSetting.carSteer)) { steerCurAngle = carSetting.carSteer.localEulerAngles; } WheelComponent[] array = wheels; foreach (WheelComponent wheelComponent in array) { WheelCollider collider = wheelComponent.collider; collider.suspensionDistance = wheelComponent.settings.Distance; JointSpring suspensionSpring = collider.suspensionSpring; suspensionSpring.spring = carSetting.springs; suspensionSpring.damper = carSetting.dampers; collider.suspensionSpring = suspensionSpring; collider.radius = wheelComponent.settings.Radius; collider.mass = wheelComponent.settings.Weight; WheelFrictionCurve val = collider.forwardFriction; ((WheelFrictionCurve)(ref val)).asymptoteValue = 5000f; ((WheelFrictionCurve)(ref val)).extremumSlip = 2f; ((WheelFrictionCurve)(ref val)).asymptoteSlip = 20f; ((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness; collider.forwardFriction = val; val = collider.sidewaysFriction; ((WheelFrictionCurve)(ref val)).asymptoteValue = 7500f; ((WheelFrictionCurve)(ref val)).asymptoteSlip = 2f; ((WheelFrictionCurve)(ref val)).stiffness = carSetting.stiffness; collider.sidewaysFriction = val; } } public void TurnOnEngine(bool forcibly) { if (!isForciblyOff) { isOn = true; } else if (forcibly) { isForciblyOff = false; isOn = true; } } public void TurnOffEngine(bool forcibly) { isForciblyOff = forcibly; isOn = false; } public void ShiftTo(int newGear) { ((Component)carSounds.switchGear).GetComponent().Play(); currentGear = newGear; if (currentGear == 0) { NeutralGear = true; } else { NeutralGear = false; } if (currentGear == -1) { currentGear = 0; } } public void ShiftUp(bool ignoreDelay) { float timeSinceLevelLoad = Time.timeSinceLevelLoad; if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || currentGear >= carSetting.gears.Length - 1) { return; } ((Component)carSounds.switchGear).GetComponent().Play(); if (!carSetting.automaticGear) { if (currentGear == 0) { if (NeutralGear) { currentGear++; NeutralGear = false; } else { NeutralGear = true; } } else { currentGear++; } } else { currentGear++; } shiftDelay = timeSinceLevelLoad + 1f; shiftTime = 1.5f; } public void ShiftDown(bool ignoreDelay) { float timeSinceLevelLoad = Time.timeSinceLevelLoad; if ((timeSinceLevelLoad < shiftDelay && !ignoreDelay) || (currentGear <= 0 && !NeutralGear)) { return; } ((Component)carSounds.switchGear).GetComponent().Play(); if (!carSetting.automaticGear) { if (currentGear == 1) { if (!NeutralGear) { currentGear--; NeutralGear = true; } } else if (currentGear == 0) { NeutralGear = false; } else { currentGear--; } } else { currentGear--; } shiftDelay = timeSinceLevelLoad + 0.1f; shiftTime = 2f; } private void OnCollisionEnter(Collision collision) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((Component)collision.transform.root).GetComponent())) { VehicleControl component = ((Component)collision.transform.root).GetComponent(); Vector3 relativeVelocity = collision.relativeVelocity; component.slip2 = Mathf.Clamp(((Vector3)(ref relativeVelocity)).magnitude, 0f, 10f); myRigidbody.angularVelocity = new Vector3((0f - myRigidbody.angularVelocity.x) * 0.5f, myRigidbody.angularVelocity.y * 0.5f, (0f - myRigidbody.angularVelocity.z) * 0.5f); myRigidbody.velocity = new Vector3(myRigidbody.velocity.x, myRigidbody.velocity.y * 0.5f, myRigidbody.velocity.z); } } private void OnCollisionStay(Collision collision) { if (Object.op_Implicit((Object)(object)((Component)collision.transform.root).GetComponent())) { ((Component)collision.transform.root).GetComponent().slip2 = 5f; } } private void Update() { } private void FixedUpdate() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_079b: Unknown result type (might be due to invalid IL or missing references) //IL_0acf: Unknown result type (might be due to invalid IL or missing references) //IL_0ae0: Unknown result type (might be due to invalid IL or missing references) //IL_0ae5: Unknown result type (might be due to invalid IL or missing references) //IL_0fca: Unknown result type (might be due to invalid IL or missing references) //IL_0fd4: Unknown result type (might be due to invalid IL or missing references) //IL_0ee6: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Unknown result type (might be due to invalid IL or missing references) //IL_0ef2: Unknown result type (might be due to invalid IL or missing references) //IL_0f0c: Unknown result type (might be due to invalid IL or missing references) //IL_0f17: Unknown result type (might be due to invalid IL or missing references) //IL_0f1c: Unknown result type (might be due to invalid IL or missing references) //IL_0f25: Unknown result type (might be due to invalid IL or missing references) //IL_0fec: Unknown result type (might be due to invalid IL or missing references) //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0d23: Unknown result type (might be due to invalid IL or missing references) if (!isOn) { accel = 0f; } Vector3 velocity = myRigidbody.velocity; speed = ((Vector3)(ref velocity)).magnitude * 2.7f; if (speed < lastSpeed - 10f && slip < 10f) { slip = lastSpeed / 15f; } lastSpeed = speed; if (slip2 != 0f) { slip2 = Mathf.MoveTowards(slip2, 0f, 0.1f); } myRigidbody.centerOfMass = carSetting.shiftCentre; if (!carWheels.wheels.frontWheelDrive && !carWheels.wheels.backWheelDrive) { accel = 0f; } if (Object.op_Implicit((Object)(object)carSetting.carSteer)) { carSetting.carSteer.localEulerAngles = new Vector3(steerCurAngle.x, steerCurAngle.y, steerCurAngle.z + steer * -120f); } if (carSetting.automaticGear && currentGear == 1 && accel < 0f) { if (speed < 5f) { ShiftDown(ignoreDelay: false); } } else if (carSetting.automaticGear && currentGear == 0 && accel > 0f) { if (speed < 5f) { ShiftUp(ignoreDelay: false); } } else if (carSetting.automaticGear && motorRPM > carSetting.shiftUpRPM && accel > 0f && speed > 10f && !brake) { ShiftUp(ignoreDelay: false); } else if (carSetting.automaticGear && motorRPM < carSetting.shiftDownRPM && currentGear > 1) { ShiftDown(ignoreDelay: false); } if (speed < 1f) { Backward = true; } if (currentGear != 0 || !Backward) { Backward = false; } Light[] brakeLights = carLights.brakeLights; foreach (Light val in brakeLights) { if (brake || accel < 0f || speed < 1f) { val.intensity = Mathf.MoveTowards(val.intensity, 8f, 0.5f); } else { val.intensity = Mathf.MoveTowards(val.intensity, 0f, 0.5f); } ((Behaviour)val).enabled = val.intensity != 0f; } Light[] reverseLights = carLights.reverseLights; foreach (Light val2 in reverseLights) { if (speed > 2f && currentGear == 0) { val2.intensity = Mathf.MoveTowards(val2.intensity, 8f, 0.5f); } else { val2.intensity = Mathf.MoveTowards(val2.intensity, 0f, 0.5f); } ((Behaviour)val2).enabled = val2.intensity != 0f; } wantedRPM = 5500f * accel * 0.1f + wantedRPM * 0.9f; float num = 0f; int num2 = 0; bool flag = false; int num3 = 0; WheelComponent[] array = wheels; WheelHit val4 = default(WheelHit); foreach (WheelComponent wheelComponent in array) { WheelCollider collider = wheelComponent.collider; if (wheelComponent.drive) { num = ((!NeutralGear && brake && currentGear < 2) ? (num + accel * carSetting.idleRPM) : (NeutralGear ? (num + carSetting.idleRPM * accel) : (num + collider.rpm))); num2++; } if (brake || accel < 0f) { if (accel < 0f || (brake && (wheelComponent == wheels[2] || wheelComponent == wheels[3]))) { if (brake && accel > 0f) { slip = Mathf.Lerp(slip, 5f, accel * 0.01f); } else if (speed > 1f) { slip = Mathf.Lerp(slip, 1f, 0.002f); } else { slip = Mathf.Lerp(slip, 1f, 0.02f); } wantedRPM = 0f; collider.brakeTorque = carSetting.brakePower; wheelComponent.rotation = w_rotate; } } else { float brakeTorque; if (accel == 0f || NeutralGear) { float num5 = (collider.brakeTorque = 1000f); brakeTorque = num5; } else { float num5 = (collider.brakeTorque = 0f); brakeTorque = num5; } collider.brakeTorque = brakeTorque; slip = ((!(speed > 0f)) ? (slip = Mathf.Lerp(slip, 0.01f, 0.02f)) : ((!(speed > 100f)) ? (slip = Mathf.Lerp(slip, 1.5f, 0.02f)) : (slip = Mathf.Lerp(slip, 1f + Mathf.Abs(steer), 0.02f)))); w_rotate = wheelComponent.rotation; } WheelFrictionCurve val3 = collider.forwardFriction; ((WheelFrictionCurve)(ref val3)).asymptoteValue = 5000f; ((WheelFrictionCurve)(ref val3)).extremumSlip = 2f; ((WheelFrictionCurve)(ref val3)).asymptoteSlip = 20f; ((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2); collider.forwardFriction = val3; val3 = collider.sidewaysFriction; ((WheelFrictionCurve)(ref val3)).stiffness = carSetting.stiffness / (slip + slip2); ((WheelFrictionCurve)(ref val3)).extremumSlip = 0.2f + Mathf.Abs(steer); collider.sidewaysFriction = val3; if (shift && currentGear > 1 && speed > 50f && shifmotor && Mathf.Abs(steer) < 0.2f) { if (powerShift == 0f) { shifmotor = false; } powerShift = Mathf.MoveTowards(powerShift, 0f, Time.deltaTime * 10f); carSounds.nitro.volume = Mathf.Lerp(carSounds.nitro.volume, 1f, Time.deltaTime * 10f); if (!carSounds.nitro.isPlaying) { ((Component)carSounds.nitro).GetComponent().Play(); } curTorque = ((!(powerShift > 0f)) ? carSetting.carPower : carSetting.shiftPower); carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f); carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, (float)((powerShift > 0f) ? 50 : 0), Time.deltaTime * 10f); } else { if (powerShift > 20f) { shifmotor = true; } carSounds.nitro.volume = Mathf.MoveTowards(carSounds.nitro.volume, 0f, Time.deltaTime * 2f); if (carSounds.nitro.volume == 0f) { carSounds.nitro.Stop(); } powerShift = Mathf.MoveTowards(powerShift, 100f, Time.deltaTime * 5f); curTorque = carSetting.carPower; carParticles.shiftParticle1.emissionRate = Mathf.Lerp(carParticles.shiftParticle1.emissionRate, 0f, Time.deltaTime * 10f); carParticles.shiftParticle2.emissionRate = Mathf.Lerp(carParticles.shiftParticle2.emissionRate, 0f, Time.deltaTime * 10f); } wheelComponent.rotation = Mathf.Repeat(wheelComponent.rotation + Time.deltaTime * collider.rpm * 360f / 60f, 360f); wheelComponent.rotation2 = Mathf.Lerp(wheelComponent.rotation2, collider.steerAngle, 0.1f); wheelComponent.wheel.localRotation = Quaternion.Euler(wheelComponent.rotation, wheelComponent.rotation2, 0f); Vector3 localPosition = wheelComponent.wheel.localPosition; if (collider.GetGroundHit(ref val4)) { if (Object.op_Implicit((Object)(object)carParticles.brakeParticlePerfab)) { if ((Object)(object)Particle[num3] == (Object)null) { Particle[num3] = Object.Instantiate(carParticles.brakeParticlePerfab, wheelComponent.wheel.position, Quaternion.identity); ((Object)Particle[num3]).name = "WheelParticle"; Particle[num3].transform.parent = ((Component)this).transform; Particle[num3].AddComponent(); Particle[num3].GetComponent().maxDistance = 50f; Particle[num3].GetComponent().spatialBlend = 1f; Particle[num3].GetComponent().dopplerLevel = 5f; Particle[num3].GetComponent().rolloffMode = (AudioRolloffMode)2; } ParticleSystem component = Particle[num3].GetComponent(); bool flag2 = false; for (int l = 0; l < carSetting.hitGround.Length; l++) { if (((Component)((WheelHit)(ref val4)).collider).CompareTag(carSetting.hitGround[l].tag)) { flag2 = carSetting.hitGround[l].grounded; if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.5f) && speed > 1f) { Particle[num3].GetComponent().clip = carSetting.hitGround[l].brakeSound; } else if ((Object)(object)Particle[num3].GetComponent().clip != (Object)(object)carSetting.hitGround[l].groundSound && !Particle[num3].GetComponent().isPlaying) { Particle[num3].GetComponent().clip = carSetting.hitGround[l].groundSound; } Particle[num3].GetComponent().startColor = carSetting.hitGround[l].brakeColor; } } if (flag2 && speed > 5f && !brake) { component.enableEmission = true; Particle[num3].GetComponent().volume = 0.5f; if (!Particle[num3].GetComponent().isPlaying) { Particle[num3].GetComponent().Play(); } } else if ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && speed > 1f) { if (accel < 0f || ((brake || Mathf.Abs(((WheelHit)(ref val4)).sidewaysSlip) > 0.6f) && (wheelComponent == wheels[2] || wheelComponent == wheels[3]))) { if (!Particle[num3].GetComponent().isPlaying) { Particle[num3].GetComponent().Play(); } component.enableEmission = true; Particle[num3].GetComponent().volume = 10f; } } else { component.enableEmission = false; Particle[num3].GetComponent().volume = Mathf.Lerp(Particle[num3].GetComponent().volume, 0f, Time.deltaTime * 10f); } } localPosition.y -= Vector3.Dot(wheelComponent.wheel.position - ((WheelHit)(ref val4)).point, ((Component)this).transform.TransformDirection(0f, 1f, 0f) / ((Component)this).transform.lossyScale.x) - collider.radius; localPosition.y = Mathf.Clamp(localPosition.y, -10f, wheelComponent.pos_y); flag = flag || wheelComponent.drive; } else { if ((Object)(object)Particle[num3] != (Object)null) { ParticleSystem component2 = Particle[num3].GetComponent(); component2.enableEmission = false; } localPosition.y = wheelComponent.startPos.y - wheelComponent.settings.Distance; myRigidbody.AddForce(Vector3.down * 5000f); } num3++; wheelComponent.wheel.localPosition = localPosition; } if (num2 > 1) { num /= (float)num2; } motorRPM = 0.95f * motorRPM + 0.05f * Mathf.Abs(num * carSetting.gears[currentGear]); if (motorRPM > 5500f) { motorRPM = 5200f; } int num7 = (int)(motorRPM / efficiencyTableStep); if (num7 >= efficiencyTable.Length) { num7 = efficiencyTable.Length - 1; } if (num7 < 0) { num7 = 0; } float num8 = curTorque * carSetting.gears[currentGear] * efficiencyTable[num7]; WheelComponent[] array2 = wheels; foreach (WheelComponent wheelComponent2 in array2) { WheelCollider collider2 = wheelComponent2.collider; if (wheelComponent2.drive) { if (Mathf.Abs(collider2.rpm) > Mathf.Abs(wantedRPM)) { collider2.motorTorque = 0f; } else { float motorTorque = collider2.motorTorque; if (!brake && accel != 0f && !NeutralGear) { if ((speed < carSetting.LimitForwardSpeed && currentGear > 0) || (speed < carSetting.LimitBackwardSpeed && currentGear == 0)) { collider2.motorTorque = motorTorque * 0.9f + num8 * 1f; } else { collider2.motorTorque = 0f; collider2.brakeTorque = 2000f; } } else { collider2.motorTorque = 0f; } } } if (brake || slip2 > 2f) { collider2.steerAngle = Mathf.Lerp(collider2.steerAngle, steer * wheelComponent2.maxSteer, 0.02f); continue; } float num9 = Mathf.Clamp(speed / carSetting.maxSteerAngle, 1f, carSetting.maxSteerAngle); collider2.steerAngle = steer * (wheelComponent2.maxSteer / num9); } Pitch = Mathf.Clamp(1.2f + (motorRPM - carSetting.idleRPM) / (carSetting.shiftUpRPM - carSetting.idleRPM), 1f, 10f); shiftTime = Mathf.MoveTowards(shiftTime, 0f, 0.1f); if (Pitch == 1f) { carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1f, 0.1f); carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f); carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.1f); } else { carSounds.IdleEngine.volume = Mathf.Lerp(carSounds.IdleEngine.volume, 1.8f - Pitch, 0.1f); if ((Pitch > PitchDelay || accel > 0f) && shiftTime == 0f) { carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0f, 0.2f); carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 1f, 0.1f); } else { carSounds.LowEngine.volume = Mathf.Lerp(carSounds.LowEngine.volume, 0.5f, 0.1f); carSounds.HighEngine.volume = Mathf.Lerp(carSounds.HighEngine.volume, 0f, 0.2f); } carSounds.HighEngine.pitch = Pitch; carSounds.LowEngine.pitch = Pitch; PitchDelay = Pitch; } if (!isOn) { carSounds.IdleEngine.volume = 0f; carSounds.LowEngine.volume = 0f; carSounds.HighEngine.volume = 0f; } } private void OnDrawGizmos() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (carSetting.showNormalGizmos && !Application.isPlaying) { Matrix4x4 matrix = Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.lossyScale); Gizmos.matrix = matrix; Gizmos.color = new Color(1f, 0f, 0f, 0.5f); Gizmos.DrawCube(Vector3.up / 1.5f, new Vector3(2.5f, 2f, 6f)); Gizmos.DrawSphere(carSetting.shiftCentre / ((Component)this).transform.lossyScale.x, 0.2f); } } } namespace H3VRUtils.Vehicles { [Serializable] public class VehicleDamagableMult { public float projectileMult = 1f; public float meleeMult = 1f; public float explosionMult = 1f; public float piercingMult = 1f; public float cuttingMult = 1f; public float thermalMult = 1f; public float bluntMult = 1f; public float totalKineticMult = 1f; } public class VehicleDamagable : MonoBehaviour { public float health; public float maxHealth; public float minHealth; public VehicleDamagableMult dmgMult; public VehicleControl vehicle; public bool dead; private float prevhealth; public virtual void FixedUpdate() { if (health < 0f) { if (!dead) { onDeath(); dead = true; } whileDead(); } else { if (dead) { onUndeath(); dead = false; } whileUndead(); } if (health < minHealth) { health = minHealth; } if (health != prevhealth) { onHealthChange(); } prevhealth = health; } public virtual void onHealthChange() { } public bool HPLessThan(float num) { if (health < num) { return true; } return false; } public bool HPLessThanPercent(float num) { if (health < num * maxHealth) { return true; } return false; } public virtual void onDeath() { } public virtual void whileDead() { } public virtual void whileUndead() { } public virtual void onUndeath() { } public virtual void HealPercent(float percentHeal) { Heal(percentHeal * maxHealth); Debug.Log((object)("percenthealing for " + percentHeal)); } public virtual void Heal(float heal) { health += heal; Debug.Log((object)("Healed for " + heal)); } public virtual void Damage() { } public float getDamage() { return 0f; } } public class VehicleRepairTool : MonoBehaviour { public float percentHeal; private void OnCollisionEnter(Collision collision) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Vector3 relativeVelocity = collision.relativeVelocity; if (!(((Vector3)(ref relativeVelocity)).magnitude < 2f)) { VehicleDamagable component = collision.gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.HealPercent(percentHeal); } } } } internal class VehicleSeat : MonoBehaviour { public FVRViveHand hand; public GameObject SitPos; public GameObject EjectPos; public void Update() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hand != (Object)null) { ((Component)hand.MovementManager).transform.position = SitPos.transform.position; } } } } namespace Niko666 { public class VisionWeaponSystem : MonoBehaviour { public ClosedBoltWeapon Weapon; public Animator Animator; public string AnimBase2AltName = "Base2Alt"; public string AnimAlt2BaseName = "Alt2Base"; public GameObject SightDMR; public GameObject SightSMG; public FVRFirearmAudioSet BaseAudioSet; public FVRFirearmAudioSet AltAudioSet; public FVRFireArmRecoilProfile BaseRecoil; public FVRFireArmRecoilProfile AltRecoil; public AudioEvent Base2AltAudio; public AudioEvent Alt2BaseAudio; public float BaseForwardSpeed; public float BaseRearwardSpeed; public float BaseStiffness; public float AltForwardSpeed; public float AltRearwardSpeed; public float AltStiffness; private Vector2 dir = Vector2.left; private Vector2 dir2 = Vector2.down; private Vector3 v3; private Vector3 velLinearWorld; private int CurMode = 0; public BreakActionAlt Lid; public void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) Animator.cullingMode = (AnimatorCullingMode)0; SM.PlayCoreSound((FVRPooledAudioType)0, Alt2BaseAudio, ((Component)Weapon).transform.position); Lid._latchHeldOpen = true; Lid._latchRot = 1f * Lid.MaxLatchRot; } public void FixedUpdate() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Invalid comparison between Unknown and I4 //IL_0106: 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) if (!((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null)) { return; } if ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound() && (int)Weapon.Bolt.CurPos == 2 && !Weapon.Chamber.IsFull && Lid._isLatched) { Lid._latchHeldOpen = true; Lid._latchRot = 1f * Lid.MaxLatchRot; } if (CurMode != Weapon.m_fireSelectorMode) { if (Weapon.m_fireSelectorMode == 0) { CurMode = Weapon.m_fireSelectorMode; Animator.Play(AnimAlt2BaseName); SM.PlayCoreSound((FVRPooledAudioType)0, Alt2BaseAudio, ((Component)Weapon).transform.position); ((FVRFireArm)Weapon).AudioClipSet = BaseAudioSet; ((FVRFireArm)Weapon).RecoilProfile = BaseRecoil; Weapon.Bolt.Speed_Forward = BaseForwardSpeed; Weapon.Bolt.Speed_Rearward = BaseRearwardSpeed; Weapon.Bolt.SpringStiffness = BaseStiffness; SightDMR.SetActive(true); SightSMG.SetActive(false); } else if (Weapon.m_fireSelectorMode == 1) { CurMode = Weapon.m_fireSelectorMode; Animator.Play(AnimBase2AltName); SM.PlayCoreSound((FVRPooledAudioType)0, Base2AltAudio, ((Component)Weapon).transform.position); ((FVRFireArm)Weapon).AudioClipSet = AltAudioSet; ((FVRFireArm)Weapon).RecoilProfile = AltRecoil; Weapon.Bolt.Speed_Forward = AltForwardSpeed; Weapon.Bolt.Speed_Rearward = AltRearwardSpeed; Weapon.Bolt.SpringStiffness = AltStiffness; SightDMR.SetActive(false); SightSMG.SetActive(true); } } } } } public class EnableOnSpecificUser : MonoBehaviour { public enum action { Enable, Disable, ModifyFirearm } public action Action; public List listofUsers; [Header("Object Enable")] public GameObject objectToEnable; [Header("Firearm Modify")] public Handgun Handgun; public bool HasMagReleaseButton; } namespace H3VRUtils { public class FVRInteractableObjectProxy : MonoBehaviour { } public class HandgunEjectionTrigger : FVRInteractiveObject { public Handgun hgReceiver; } } namespace H3VRUtils.Proxy { public class attachmentYFoldingStockProxy : FVRInteractableObjectProxy { } } namespace H3VRUtils.ProxyLoader { public class attachmentYFoldingStockProxyLoader : MonoBehaviour { } } namespace H3VRUtils { internal class ActivateSeveralFVRInteractiveAtOnce : FVRInteractiveObject { public List InteractiveObjects; } } namespace H3VRUtils.AlternatingMags { internal class AlternatingMagMount { public GameObject MagMountWhenActive; public GameObject MagMountWhenInactive; [HideInInspector] public FVRFireArmMagazine curmag; public FVRFireArm firearm; [HideInInspector] public bool IsActive; } internal class AlternatingMagSingleSwitch : FVRInteractiveObject { public GameObject transformOnInactive; public GameObject transformOnActive; public AlternatingMagsHandler MagHandler; [Tooltip("Use the relevant number in the MagHandler's list of MagMounts.")] public int ConnectedMagMount; public AudioEvent ClickAudio; public void FixedUpdate() { } } internal class AlternatingMagsHandler { public bool AlternateOnEachShot; public List MagMounts; public FVRFireArm firearm; [HideInInspector] public int activeMagMount; } } namespace H3VRUtils.FVRInteractiveObjects { public class AttachableChargingHandle : MultipleChargingHandleClosedBolt { public FVRFireArmAttachment attachment; private ClosedBoltWeapon weapon; } internal class AutoRackOnMagLoadFixed : MonoBehaviour { public FVRFireArm weapon; private Handgun hg; private ClosedBoltWeapon cbw; private OpenBoltReceiver obr; private bool WasLoaded; public void Start() { if (weapon is Handgun) { ref Handgun reference = ref hg; FVRFireArm obj = weapon; reference = (Handgun)(object)((obj is Handgun) ? obj : null); } if (weapon is ClosedBoltWeapon) { ref ClosedBoltWeapon reference2 = ref cbw; FVRFireArm obj2 = weapon; reference2 = (ClosedBoltWeapon)(object)((obj2 is ClosedBoltWeapon) ? obj2 : null); } if (weapon is Handgun) { ref OpenBoltReceiver reference3 = ref obr; FVRFireArm obj3 = weapon; reference3 = (OpenBoltReceiver)(object)((obj3 is OpenBoltReceiver) ? obj3 : null); } } public void FixedUpdate() { if ((Object)(object)weapon.Magazine != (Object)null) { if (!WasLoaded) { if ((Object)(object)hg != (Object)null && (!hg.Chamber.IsFull || hg.Chamber.IsSpent)) { hg.Slide.ImpartFiringImpulse(); } if ((Object)(object)cbw != (Object)null && (!cbw.Chamber.IsFull || cbw.Chamber.IsSpent)) { cbw.Bolt.ImpartFiringImpulse(); } if ((Object)(object)obr != (Object)null && (!obr.Chamber.IsFull || obr.Chamber.IsSpent)) { obr.Bolt.ImpartFiringImpulse(); } } WasLoaded = true; } else { WasLoaded = false; } } } } namespace H3VRUtils { internal class BetterMagReleaseLatch : MonoBehaviour { [FormerlySerializedAs("FireArm")] public FVRFireArm fireArm; [FormerlySerializedAs("Joint")] public HingeJoint joint; private float _timeSinceLastCollision = 6f; [Tooltip("Greatly reduce what you think it may be. I recommend 2 for Sensitivity.")] public float jointReleaseSensitivity = 2f; [HideInInspector] public float jointAngle; [FormerlySerializedAs("_jointReleaseSensitivityAbove")] [HideInInspector] public float jointReleaseSensitivityAbove; [FormerlySerializedAs("_jointReleaseSensitivityBelow")] [HideInInspector] public float jointReleaseSensitivityBelow; private bool _isMagazineNotNull; [HideInInspector] public float basex; } public class BreakOpenFlareGun : FVRFireArm { [Header("Flaregun Params")] public Renderer[] GunUndamaged; public Renderer[] GunDamaged; public FVRFireArmChamber Chamber; public Axis HingeAxis; public Transform Hinge; public float RotOut = 35f; public bool CanUnlatch = true; public bool IsHighPressureTolerant; private bool m_isHammerCocked; private bool m_isTriggerReset = true; private bool m_isLatched = true; private bool m_isDestroyed; private float TriggerFloat; public Transform Hammer; public bool HasVisibleHammer = true; public bool CanCockHammer = true; public bool CocksOnOpen; private float m_hammerXRot; public Axis HammerAxis; public InterpStyle HammerInterp = (InterpStyle)1; public float HammerMinRot; public float HammerMaxRot = -70f; public Transform Trigger; public Vector2 TriggerForwardBackRots; public Transform Muzzle; public ParticleSystem SmokePSystem; public ParticleSystem DestroyPSystem; public bool DeletesCartridgeOnFire; } } namespace H3VRUtils.FVRInteractiveObjects { internal class GoToNearestSosig : MonoBehaviour { public float speed; public Rigidbody rigidbody; [Tooltip("Change this if you want the object to throw itself to a different tag")] public string TagOverride; public void Start() { //IL_004b: 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_00c6: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(TagOverride)) { TagOverride = "AgentBody"; } GameObject[] array = GameObject.FindGameObjectsWithTag(TagOverride); if (array.Length == 0) { return; } GameObject val = null; float num = 999999f; for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(((Component)this).transform.position, array[i].transform.position); if (num2 < num) { val = array[i]; num = num2; } } if ((Object)(object)val == (Object)null) { Debug.LogError((object)"The nearest sosig is over a full 1,000 kms away, what the fuck are you doing?"); return; } ((Component)this).transform.LookAt(val.transform); rigidbody.velocity = new Vector3(0f, 0f, speed); } } public class GrenadeOneHandArm : MonoBehaviour { public PinnedGrenade grenade; [Tooltip("Trigger is a terrible idea for this. Please don't use trigger. I mean, i can't stop you, but i dont recommend it.")] public H3VRUtilsMagRelease.TouchpadDirType dirType; private Vector2 dir; public bool kickOutLever; } } namespace H3VRUtils { public class H3VRUtilsMagRelease : FVRInteractiveObject { public enum TouchpadDirType { Up, Down, Left, Right, Trigger, NoDirection } public ClosedBoltWeapon ClosedBoltReceiver; public OpenBoltReceiver OpenBoltWeapon; public Handgun HandgunReceiver; public BoltActionRifle BoltActionWeapon; [HideInInspector] public int WepType; [HideInInspector] public bool DisallowEjection; private Collider col; public bool PressDownToRelease; public TouchpadDirType TouchpadDir; [HideInInspector] public Vector2 dir; } internal class H3VRUtilsPhysBoltRelease : FVRInteractiveObject { public enum TouchpadDirType { Up, Down, Left, Right, Trigger } public ClosedBoltWeapon ClosedBoltReceiver; [HideInInspector] public OpenBoltReceiver OpenBoltWeapon; [HideInInspector] public Handgun HandgunReceiver; public bool ButtonPressToRelease; public TouchpadDirType TouchpadDir; [HideInInspector] public int WepType = 0; } internal class HandgunSecondarySwitch : FVRInteractiveObject { public Handgun Weapon; public int CurModeIndex; public int ModeIndexToSub = 1; public Transform SelctorSwitch; public Axis Axis; public InterpStyle InterpStyle; public FireSelectorMode[] Modes; } } namespace H3VRUtils.FVRInteractiveObjects { public class MultipleChargingHandleClosedBolt : ClosedBoltHandle { public void BeginInteraction(FVRViveHand hand) { if (!((Object)(object)((FVRInteractiveObject)base.Weapon.Handle).m_hand != (Object)null)) { base.Weapon.Handle = (ClosedBoltHandle)(object)this; } } } } namespace H3VRUtils.Weapons.NadeCup { internal class NadeCupLauncher : MonoBehaviour { public FVRFireArmChamber mainChamber; public FVRFireArmChamber nadeCup; public bool alreadyFired; } } namespace H3VRUtils { internal class OpenBoltBurstFire : MonoBehaviour { public OpenBoltReceiver Receiver; [Tooltip("Selector setting position that will be burst. Remember, selectors go pos: 0, 1 ,2, not 1, 2, 3")] public int SelectorSetting; public int BurstAmt; private int BurstSoFar; private bool wasLoaded; public void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) Receiver.FireSelector_Modes[SelectorSetting].ModeType = (FireSelectorModeType)2; } public void Update() { } public void lockUp() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) Receiver.FireSelector_Modes[SelectorSetting].ModeType = (FireSelectorModeType)0; } public void unLock() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) BurstSoFar = 0; Receiver.FireSelector_Modes[SelectorSetting].ModeType = (FireSelectorModeType)2; } } internal class AttachmentModifyFirearmFixed : MonoBehaviour { public enum actionType { attach, detach } public enum CapType { AddTo, SetTo } private FVRFireArmAttachment attachment; private FVRFireArm weapon; [Header("Recoil Modifier")] public bool ChangesRecoil; private FVRFireArmRecoilProfile originalRecoil; public FVRFireArmRecoilProfile modifiedRecoil; [Header("Magazine Modifer")] public bool ChangesMagCapacity; private int prevCapacity; public CapType CapacityModifierType; [Tooltip("Keep it off unless you're sure it should apply to non-internal mags.")] public bool applyToNonInternalMags; public int setCapacityTo; [Header("Bolt Speed Modifier")] public bool ChangesBoltSpeed; public bool ChangesBoltSpeedForward; public bool ChangesBoltSpeedRearward; public bool ChangesBoltSpeedStiffness; public CapType BoltSpeedModifierType; public float BoltSpeedForward; private float prevBoltSpeedForward; public float BoltSpeedBackwards; private float prevBoltSpeedBackwards; public float BoltSpringStiffness; private float prevBoltSpringStiffness; [HideInInspector] public bool ChangesSpread; [HideInInspector] public float spreadmult; [Header("GrabPos Modifier")] public bool ChangesGrabPos; public Transform NewPoseOverride; private Transform oldPoseOverride; public Transform NewPoseOverrideTouch; private Transform oldPoseOverrideTouch; public void Start() { attachment = ((Component)this).GetComponent(); } private void FixedUpdate() { if ((Object)(object)attachment.curMount != (Object)null) { if ((Object)(object)weapon == (Object)null) { OnAttach(); } } else if ((Object)(object)weapon != (Object)null) { OnDetach(); } if (ChangesSpread) { ChangeSpread(); } } public void OnAttach() { weapon = ((Component)attachment.curMount.Parent).GetComponent(); if (ChangesRecoil) { RecoilModifier(actionType.attach); } if (ChangesMagCapacity) { MagSizeModifier(actionType.attach); } if (ChangesBoltSpeed) { BoltSpeedModifier(actionType.attach); } if (ChangesGrabPos) { ChangeGrabPos(actionType.attach); } } public void OnDetach() { if (ChangesRecoil) { RecoilModifier(actionType.detach); } if (ChangesMagCapacity) { MagSizeModifier(actionType.detach); } if (ChangesBoltSpeed) { BoltSpeedModifier(actionType.detach); } if (ChangesGrabPos) { ChangeGrabPos(actionType.detach); } weapon = null; } public void ChangeGrabPos(actionType ActType) { if (ActType == actionType.attach) { oldPoseOverride = ((FVRInteractiveObject)weapon).PoseOverride; ((FVRInteractiveObject)weapon).PoseOverride = NewPoseOverride; oldPoseOverrideTouch = ((FVRInteractiveObject)weapon).PoseOverride_Touch; ((FVRInteractiveObject)weapon).PoseOverride_Touch = NewPoseOverrideTouch; } if (ActType == actionType.detach) { ((FVRInteractiveObject)weapon).PoseOverride = oldPoseOverride; ((FVRInteractiveObject)weapon).PoseOverride_Touch = oldPoseOverrideTouch; } } public void ChangeSpread() { FVRFireArmRound val = null; if (weapon is OpenBoltReceiver) { FVRFireArm obj = weapon; OpenBoltReceiver val2 = (OpenBoltReceiver)(object)((obj is OpenBoltReceiver) ? obj : null); val = val2.Chamber.GetRound(); } else if (weapon is ClosedBoltWeapon) { FVRFireArm obj2 = weapon; ClosedBoltWeapon val3 = (ClosedBoltWeapon)(object)((obj2 is ClosedBoltWeapon) ? obj2 : null); val = val3.Chamber.GetRound(); } else if (weapon is Handgun) { FVRFireArm obj3 = weapon; Handgun val4 = (Handgun)(object)((obj3 is Handgun) ? obj3 : null); val = val4.Chamber.GetRound(); } else if (weapon is TubeFedShotgun) { FVRFireArm obj4 = weapon; TubeFedShotgun val5 = (TubeFedShotgun)(object)((obj4 is TubeFedShotgun) ? obj4 : null); val = val5.Chamber.GetRound(); } if (!((Object)(object)val == (Object)null) && (double)((FVRPhysicalObject)val).ThrowAngMultiplier != 1.1) { ((FVRPhysicalObject)val).ThrowAngMultiplier = 1.1f; FVRFireArmRound obj5 = val; obj5.ProjectileSpread *= spreadmult; } } public void RecoilModifier(actionType ActType) { if (ActType == actionType.attach) { originalRecoil = weapon.RecoilProfile; weapon.RecoilProfile = modifiedRecoil; } if (ActType == actionType.detach) { weapon.RecoilProfile = originalRecoil; } } public void MagSizeModifier(actionType ActType) { if ((Object)(object)weapon.Magazine == (Object)null) { return; } if (ActType == actionType.attach && (weapon.Magazine.IsIntegrated || applyToNonInternalMags)) { prevCapacity = weapon.Magazine.m_capacity; if (CapacityModifierType == CapType.AddTo) { FVRFireArmMagazine magazine = weapon.Magazine; magazine.m_capacity += setCapacityTo; } if (CapacityModifierType == CapType.SetTo) { weapon.Magazine.m_capacity = setCapacityTo; } } if (ActType == actionType.detach && (weapon.Magazine.IsIntegrated || applyToNonInternalMags)) { weapon.Magazine.m_capacity = prevCapacity; } } public void BoltSpeedModifier(actionType ActType) { int num = 0; OpenBoltReceiver val = null; ClosedBoltWeapon val2 = null; Handgun val3 = null; TubeFedShotgun val4 = null; if (weapon is OpenBoltReceiver) { FVRFireArm obj = weapon; val = (OpenBoltReceiver)(object)((obj is OpenBoltReceiver) ? obj : null); num = 1; } else if (weapon is ClosedBoltWeapon) { FVRFireArm obj2 = weapon; val2 = (ClosedBoltWeapon)(object)((obj2 is ClosedBoltWeapon) ? obj2 : null); num = 2; } else if (weapon is Handgun) { FVRFireArm obj3 = weapon; val3 = (Handgun)(object)((obj3 is Handgun) ? obj3 : null); num = 3; } else if (weapon is TubeFedShotgun) { FVRFireArm obj4 = weapon; val4 = (TubeFedShotgun)(object)((obj4 is TubeFedShotgun) ? obj4 : null); num = 4; } float num2 = 0f; float num3 = 0f; float num4 = 0f; switch (num) { case 1: num2 = val.Bolt.BoltSpeed_Rearward; num3 = val.Bolt.BoltSpeed_Forward; num4 = val.Bolt.BoltSpringStiffness; break; case 2: num2 = val2.Bolt.Speed_Rearward; num3 = val2.Bolt.Speed_Forward; num4 = val2.Bolt.SpringStiffness; break; case 3: num2 = val3.Slide.Speed_Forward; num3 = val3.Slide.Speed_Rearward; num4 = val3.Slide.SpringStiffness; break; } if (ActType == actionType.attach) { prevBoltSpeedBackwards = num2; prevBoltSpeedForward = num3; prevBoltSpringStiffness = num4; if (BoltSpeedModifierType == CapType.SetTo) { num2 = BoltSpeedBackwards; num3 = BoltSpeedForward; num4 = BoltSpringStiffness; } if (BoltSpeedModifierType == CapType.AddTo) { num2 += BoltSpeedBackwards; num3 += BoltSpeedForward; num4 += BoltSpringStiffness; } } if (ActType == actionType.detach) { num2 = prevBoltSpeedBackwards; num3 = prevBoltSpeedForward; num4 = prevBoltSpringStiffness; } if (ChangesBoltSpeedRearward) { switch (num) { case 1: val.Bolt.BoltSpeed_Rearward = num2; break; case 2: val2.Bolt.Speed_Rearward = num2; break; case 3: val3.Slide.Speed_Forward = num2; break; } } if (ChangesBoltSpeedForward) { switch (num) { case 1: val.Bolt.BoltSpeed_Forward = num3; break; case 2: val2.Bolt.Speed_Forward = num3; break; case 3: val3.Slide.Speed_Rearward = num3; break; } } if (ChangesBoltSpeedStiffness) { switch (num) { case 1: val.Bolt.BoltSpringStiffness = num4; break; case 2: val2.Bolt.SpringStiffness = num4; break; case 3: val3.Slide.SpringStiffness = num4; break; } } } } internal class DisplayOnAttached : MonoBehaviour { public GameObject displayOnAttach; public FVRFireArmAttachmentMount AttachmentMount; } internal class attachmentXFoldingStock : FVRFoldingStockXAxis { public FVRFireArmAttachment attachment; } public class attachmentYFoldingStock : FVRInteractiveObject { public enum StockPos { Closed, Mid, Open } [FormerlySerializedAs("Root")] public Transform root; [FormerlySerializedAs("Stock")] public Transform stock; public float minRot; public float maxRot; [Tooltip("Default 5; this is the angle diff at which point the stock clamps to closed/open. (AKA: if angle is 4, and minRot is 0, the difference is less than 5, so it just clamps to 0.)")] public float clampStrength = 5f; [FormerlySerializedAs("m_curPos")] public StockPos mCurPos; [FormerlySerializedAs("m_lastPos")] public StockPos mLastPos; public bool isMinClosed = true; [FormerlySerializedAs("FireArm")] [Tooltip("Leave as null if attachment.")] public FVRFireArm fireArm; public FVRFireArmAttachment attachment; [Header("Alternate Use Settings")] [Tooltip("If true, it will not affect the stock point.")] public bool isNotAttachment; public bool forBreakOpenFlareGun; public BreakOpenFlareGun flareGun; public float _rotAngle; [HideInInspector] public Vector3 lhs; public GameObject hand; public void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_0178: 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_022e: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) Vector3 val = hand.transform.position - root.position; Vector3 val2 = Vector3.ProjectOnPlane(val, root.up); val = ((Vector3)(ref val2)).normalized; Vector3 val3 = -((Component)root).transform.forward; _rotAngle = Mathf.Atan2(Vector3.Dot(root.up, Vector3.Cross(val3, val)), Vector3.Dot(val3, val)) * 57.29578f; if (Mathf.Abs(_rotAngle - minRot) < 5f && Mathf.Abs(_rotAngle - minRot) < 5f) { _rotAngle = minRot; } if (Mathf.Abs(_rotAngle - maxRot) < 5f) { _rotAngle = maxRot; } if (!(_rotAngle >= minRot) || !(_rotAngle <= maxRot)) { return; } stock.localEulerAngles = new Vector3(0f, _rotAngle, 0f); float num = Mathf.InverseLerp(minRot, maxRot, _rotAngle); if (!((Object)(object)fireArm != (Object)null)) { return; } if (isMinClosed) { if (num < 0.02f) { mCurPos = (StockPos)0; if (isNotAttachment) { fireArm.HasActiveShoulderStock = false; } } else if (num > 0.9f) { mCurPos = (StockPos)2; if (isNotAttachment) { fireArm.HasActiveShoulderStock = true; } } else { mCurPos = (StockPos)1; if (isNotAttachment) { fireArm.HasActiveShoulderStock = false; } } } else if (num < 0.1f) { mCurPos = (StockPos)2; if (isNotAttachment) { fireArm.HasActiveShoulderStock = true; } } else if (num > 0.98f) { mCurPos = (StockPos)0; if (isNotAttachment) { fireArm.HasActiveShoulderStock = false; } } else { mCurPos = (StockPos)1; if (isNotAttachment) { fireArm.HasActiveShoulderStock = false; } } mLastPos = mCurPos; } private void OnDrawGizmosSelected() { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0072: 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_0081: 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_00c7: 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_00de: Unknown result type (might be due to invalid IL or missing references) if (Application.isPlaying) { Gizmos.color = new Color(0.1f, 0.3f, 0.9f); Gizmos.DrawWireCube(((Component)stock).transform.position, Vector3.one * 0.025f); Gizmos.color = new Color(0.1f, 0.3f, 0.9f, 0.5f); Gizmos.DrawCube(((Component)stock).transform.position, Vector3.one * 0.025f); float timeSinceLevelLoad = Time.timeSinceLevelLoad; Gizmos.color = new Color(0.1f, 0.7f, 0.9f, Mathf.Clamp01((0.5f - timeSinceLevelLoad) * 2f)); Gizmos.DrawWireCube(((Component)stock).transform.position, Vector3.one * (0.1f * (timeSinceLevelLoad + 0.5f))); } Vector3 val = ((Component)stock).transform.position + -((Component)stock).transform.forward; Gizmos.color = new Color(0.7f, 0.9f, 0.1f); Gizmos.DrawWireCube(val, Vector3.one * 0.02f); Gizmos.color = new Color(0.7f, 0.9f, 0.1f, 0.5f); Gizmos.DrawCube(val, Vector3.one * 0.02f); Gizmos.color = new Color(0.9f, 0.7f, 0.1f); Gizmos.DrawRay(((Component)this).transform.position, Quaternion.AngleAxis(minRot, ((Component)this).transform.right) * ((Component)this).transform.up); Gizmos.DrawRay(((Component)this).transform.position, Quaternion.AngleAxis(0f - maxRot, ((Component)this).transform.right) * ((Component)this).transform.up); } } } namespace H3VRUtils.customItems.shotClock { internal class shotClock : MonoBehaviour { public enum screen { shot, register, delay } public string stopclocktextstring; public Vector2 startingTimeWindow = new Vector2(2f, 5f); public float stopclock; public int shotsfired; public float regmaxdist = 0.5f; public GameObject startbutton; public GameObject stopbutton; public bool isClockOn; public bool isInDelayProcess; public Text stopclocktext; public Text lastshottext; public Text shotsfiredtext; public Text delaymintext; public Text delaymaxtext; private float waittime; public FVRFireArmChamber[] registery; private bool[] registerySpent; public Text[] weptext; public BoxCollider registertrigger; public GameObject[] chambersInScene; private bool alreadyInRegisteryFlag; public float[] distfromshotclock; public screen currentScreen; public void Awake() { registerySpent = new bool[11]; } public void startClockProcess() { waittime = Random.Range(startingTimeWindow.x, startingTimeWindow.y); isInDelayProcess = true; } private void Update() { if (isClockOn) { stopclock += Time.deltaTime; stopclocktext.text = updateStopClockTextString(); } if (isInDelayProcess) { stopclock += Time.deltaTime; if (stopclock > waittime) { isInDelayProcess = false; StartClock(); } } if (isClockOn || isInDelayProcess) { startbutton.SetActive(false); stopbutton.SetActive(true); } else { startbutton.SetActive(true); stopbutton.SetActive(false); } for (int i = 0; i < registery.Length; i++) { if (!((Object)(object)registery[i] != (Object)null)) { continue; } if (registery[i].IsSpent) { if (!registerySpent[i]) { registerySpent[i] = true; ShotDetected(); } } else { registerySpent[i] = false; } } } private void updateRegistery() { //IL_0039: 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) chambersInScene = GameObject.FindGameObjectsWithTag("FVRFireArmChamber"); distfromshotclock = new float[chambersInScene.Length]; for (int i = 0; i < chambersInScene.Length; i++) { distfromshotclock[i] = Vector3.Distance(((Component)this).transform.position, chambersInScene[i].transform.position); if (!(distfromshotclock[i] < regmaxdist)) { continue; } FVRFireArmChamber component = chambersInScene[i].GetComponent(); FVRFireArmChamber[] array = registery; foreach (FVRFireArmChamber val in array) { if ((Object)(object)val != (Object)null && (Object)(object)val == (Object)(object)component) { alreadyInRegisteryFlag = true; } } if (alreadyInRegisteryFlag) { continue; } Debug.Log((object)("Ready to load " + chambersInScene[i])); for (int k = 0; k < registery.Length; k++) { if ((Object)(object)registery[k] == (Object)null) { registery[k] = chambersInScene[i].GetComponent(); Debug.Log((object)string.Concat(registery[k], " loaded successfully from ", distfromshotclock[i], " units away!")); break; } } updateRegisteryText(); } } public void updateRegisteryText() { for (int i = 0; i < registery.Length; i++) { if ((Object)(object)registery[i] != (Object)null) { weptext[i].text = ((object)((Component)registery[i]).transform.root).ToString(); } else { weptext[i].text = "EMPTY"; } } } public string updateStopClockTextString() { stopclocktextstring = ""; TimeSpan timeSpan = TimeSpan.FromSeconds(stopclock); if (timeSpan.Minutes < 10) { stopclocktextstring += "0"; } stopclocktextstring = stopclocktextstring + timeSpan.Minutes + ":"; if (timeSpan.Seconds < 10) { stopclocktextstring += "0"; } stopclocktextstring = stopclocktextstring + timeSpan.Seconds + ":"; if (timeSpan.Milliseconds < 100) { stopclocktextstring += "0"; if (timeSpan.Milliseconds < 10) { stopclocktextstring += "0"; } } stopclocktextstring += Math.Round((double)timeSpan.Milliseconds, 3); return stopclocktextstring; } public void StartClock() { isClockOn = true; stopclock = 0f; } public void StopClock() { isClockOn = false; stopclock = 0f; } public void ShotDetected() { if (isClockOn) { TimeSpan timeSpan = TimeSpan.FromSeconds(stopclock); lastshottext.text = updateStopClockTextString(); } } } internal class shotClockButton : FVRPhysicalObject { public enum buttonType { start, stop, register, delay } public shotClock shotclock; public bool pressed; public buttonType button; public void Update() { if (pressed) { pressed = false; SimpleInteraction(null); } } public void SimpleInteraction(FVRViveHand hand) { switch (button) { case buttonType.start: shotclock.startClockProcess(); break; case buttonType.stop: shotclock.StopClock(); break; case buttonType.register: break; case buttonType.delay: break; } } } } namespace H3VRUtils { internal class lockToHead : MonoBehaviour { public void Update() { } } } namespace H3VRUtils.MonoScripts.UIModifiers { public class DispBulletAmount : MonoBehaviour { [Header("Only fill out one of these.")] public FVRFireArm firearm; public FVRFireArmMagazine magazine; public FVRFireArmAttachment attachment; [Header("Ammo Counter Settings")] [Tooltip("Text to display ammo left in the gun.")] public Text UItext; [Tooltip("Text to display maximum ammo.")] public Text MaxAmmoText; [Tooltip("Text to display the type of ammo.")] public Text ammoTypeText; [Tooltip("Adds a minimum character count. See tooltip for MinCharLength for more.")] public bool AddMinCharLength; [Tooltip("i.e if MinCharLength is 2 and the amount of rounds left is 5, it will display 05 instead of 5.")] public int MinCharLength; [Tooltip("Will not instantly be the correct amount of rounds, but will tick up/down until it is.")] public bool enableDispLerp; [Tooltip("MaxAmmo will also lerp according to the DispLerpAmt")] public bool enableLerpForMaxAmmo; [Tooltip("EnabledObjects will also lerp according to the DispLerpAmt")] public bool enableLerpForEnabledObjects; [Tooltip("From 0-1. The % amount moved towards its correct amount every 50th of a second.")] [Range(0f, 0.2f)] public float DispLerpAmt; [Header("Alternate Displays")] [Tooltip("Enables enabling/disabling objects based on rounds left in mag.")] public bool EnabledObjects; [Tooltip("Object enabled when there is no magazine.")] public GameObject ObjectWhenEmpty; [Tooltip("Element no. corresponds to rounds left. 0 means no rounds, 1 means one round. Enables the 5th object if there are 5 rounds, and so on.")] public List Objects; [Tooltip("Enables all objects under the round count. Enables the 0th, 1st, 2nd, 3rd objects if there are 3 rounds left, and so on.")] public bool EnableAllUnderAmount; [Tooltip("Overrides Objects. #0 means Objects' #0 displays from 0% to #0%, #1 means Objects' #1 displays from #0% to #1%, etc- written normally, not mathmatically (e.g 57.32)")] public bool EnableBasedOnPercentage; public List ObjectPercentages; private FVRFireArm _fa; private FVRFireArmMagazine _mag; private FVRFirearmMovingProxyRound[] proxies; private FVRFireArmChamber[] chambers; private int lastAmountOfBullets; private int lastAmountOfMaxBullets; private int lastAmountOfBulletsForEnableObjects; private bool _isFireArmNotNull; private bool _isMagazineNotNull; private bool _isAttachmentNotNull; private bool _isUItextNotNull; private bool _isMaxAmmoTextNotNull; private bool _isammoTypeTextNotNull; private void GetFirearmAndMag() { if (_isFireArmNotNull) { _fa = firearm; _mag = firearm.Magazine; } else if (_isMagazineNotNull) { _mag = magazine; _fa = magazine.FireArm; } else if (_isAttachmentNotNull) { if ((Object)(object)attachment.curMount != (Object)null) { if ((Object)(object)_fa == (Object)null) { ref FVRFireArm fa = ref _fa; FVRPhysicalObject parent = attachment.curMount.Parent; fa = (FVRFireArm)(object)((parent is FVRFireArm) ? parent : null); } } else { _fa = null; } if ((Object)(object)_fa != (Object)null) { _mag = _fa.Magazine; } } if ((Object)(object)_fa == (Object)null) { chambers = null; proxies = null; return; } if (chambers == null) { chambers = GetFireArmDeets.GetFireArmChamber(_fa); } proxies = GetFireArmDeets.GetFireArmProxySwitch(_fa, true); } private int GetAmmoCount() { int num = 0; FVRFireArm fa = _fa; FVRFireArmMagazine mag = _mag; if ((Object)(object)mag == (Object)null) { return num; } num += mag.m_numRounds; if ((Object)(object)fa != (Object)null) { num += chambers.Count((FVRFireArmChamber chamber) => chamber.IsFull && !chamber.IsSpent); FVRFirearmMovingProxyRound[] array = proxies; foreach (FVRFirearmMovingProxyRound val in array) { if (val.IsFull) { num++; } } if ((Object)(object)fa.BeltDD != (Object)null) { num += fa.BeltDD.m_roundsOnBelt; } } return num; } private int GetMaxAmmoCount() { if ((Object)(object)_mag != (Object)null) { return _mag.m_capacity; } return 0; } private string GetAmmoType() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_fa != (Object)null) { return AM.GetFullRoundName(_fa.RoundType, _fa.GetChamberRoundList()[0]); } return string.Empty; } private void Update() { GetFirearmAndMag(); if (_isUItextNotNull) { string text = CalculateAmmoCounterAmount(GetAmmoCount(), ref lastAmountOfBullets, enableDispLerp, DispLerpAmt, AddMinCharLength, MinCharLength); UItext.text = text; } if (_isMaxAmmoTextNotNull) { string text2 = CalculateAmmoCounterAmount(GetMaxAmmoCount(), ref lastAmountOfMaxBullets, enableLerpForMaxAmmo, DispLerpAmt, AddMinCharLength, MinCharLength); MaxAmmoText.text = text2; } if (_isammoTypeTextNotNull) { ammoTypeText.text = GetAmmoType(); } if (EnabledObjects) { int num = int.Parse(CalculateAmmoCounterAmount(GetAmmoCount(), ref lastAmountOfBulletsForEnableObjects, enableLerpForEnabledObjects, DispLerpAmt)); if (EnableBasedOnPercentage) { SetEnabledObjectsPercentage(num); } else { SetEnabledObjects(num); } } } public static string CalculateAmmoCounterAmount(int currentammo, ref int lastammo, bool lerp = false, float lerpAmt = 0f, bool pad = false, int padAmt = 0) { if (lerp) { currentammo = LerpInt(lastammo, currentammo, lerpAmt); } string text = currentammo.ToString(); if (pad) { text = PadStringNumberToAmt(text, padAmt); } lastammo = currentammo; return text; } public static string PadStringNumberToAmt(string str, int minCharLength) { int num = minCharLength - str.Length; for (int i = 0; i < num; i++) { str = "0" + str; } return str; } public static int LerpInt(int a, int b, float lerp) { bool flag = a == 0; a = Mathf.CeilToInt(Mathf.Lerp((float)a, (float)b, lerp)); if (a == 1 && flag) { a = 0; } return a; } private void SetEnabledObjects(int amt) { amt = Mathf.Clamp(amt, 0, Objects.Count - 1); for (int i = 0; i < Objects.Count; i++) { Objects[i].SetActive(false); ObjectWhenEmpty.SetActive(false); } if ((Object)(object)_mag == (Object)null && (Object)(object)ObjectWhenEmpty != (Object)null) { ObjectWhenEmpty.SetActive(true); return; } for (int j = 0; j < Objects.Count; j++) { if (j < amt) { if (EnableAllUnderAmount) { Objects[j].SetActive(true); } } else if (j == amt) { Objects[j].SetActive(true); } } } private void SetEnabledObjectsPercentage(int amt) { amt = Mathf.Clamp(amt, 0, Objects.Count - 1); int maxAmmoCount = GetMaxAmmoCount(); float num = (float)amt / (float)maxAmmoCount; for (int i = 0; i < Objects.Count; i++) { Objects[i].SetActive(false); ObjectWhenEmpty.SetActive(false); } if ((Object)(object)_mag == (Object)null && (Object)(object)ObjectWhenEmpty != (Object)null) { ObjectWhenEmpty.SetActive(true); return; } for (int j = 0; j < Objects.Count; j++) { float num2 = ObjectPercentages[j] / 100f; float num3 = 0f; if (j > 0) { num3 = ObjectPercentages[j - 1] / 100f; } if (!(num > num2)) { continue; } if (num > num3) { if (EnableAllUnderAmount) { Objects[j].SetActive(true); } } else { Objects[j].SetActive(true); } } } private void Start() { NullCheck(); SafetyCheck(); } public void NullCheck() { _isammoTypeTextNotNull = (Object)(object)ammoTypeText != (Object)null; _isMaxAmmoTextNotNull = (Object)(object)MaxAmmoText != (Object)null; _isUItextNotNull = (Object)(object)UItext != (Object)null; _isFireArmNotNull = (Object)(object)firearm != (Object)null; _isMagazineNotNull = (Object)(object)magazine != (Object)null; _isAttachmentNotNull = (Object)(object)attachment != (Object)null; } private void SafetyCheck() { int num = (_isFireArmNotNull ? 1 : 0) + (_isMagazineNotNull ? 1 : 0) + (_isAttachmentNotNull ? 1 : 0); if (num > 1) { Debug.LogWarning((object)"AmmoCounter has more than one field filled out! Is this supposed to be on a firearm, magazine, or attachment? Choose one!"); } else if (num == 0) { Debug.LogWarning((object)"AmmoCounter doesn't have any field filled out!"); } } } } namespace H3VRUtils.MonoScripts.VisualModifiers { internal class AnimPlayOnGrab : MonoBehaviour { public Animation animation; public FVRPhysicalObject Object; public string AnimNameOnGrab; public string AnimNameOnLetGo; private bool isGrabbed; public void Update() { if (animation.isPlaying) { return; } if ((Object)(object)((FVRInteractiveObject)Object).m_hand != (Object)null) { if (!isGrabbed) { animation.Play(AnimNameOnGrab); isGrabbed = true; } } else if (isGrabbed) { animation.Play(AnimNameOnLetGo); isGrabbed = false; } } } internal class CycleOnBoltRelease : MonoBehaviour { public FVRFireArmChamber chamber; public GameObject muzzle; public List Locs; private int pointer; private bool wasFull; public void Update() { //IL_0064: 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) if (wasFull && !chamber.IsFull) { pointer++; if (pointer > Locs.Count) { pointer = 0; } muzzle.transform.position = Locs[pointer].position; muzzle.transform.rotation = Locs[pointer].rotation; } wasFull = chamber.IsFull; } } internal class FeedRamp : MonoBehaviour { public GameObject Carrier; public FVRFireArm firearm; public float CarrierDetectDistance; public Vector2 CarrierRots; public Transform CarrierComparePoint1; public Transform CarrierComparePoint2; private float m_curCarrierRot; private float m_tarCarrierRot; } } namespace H3VRUtils { internal class InvisibleMagOnLoad : MonoBehaviour { public FVRFireArmMagazine magazine; public void Update() { if ((Object)(object)magazine.FireArm != (Object)null) { ((Component)magazine.Viz).gameObject.SetActive(false); } else { ((Component)magazine.Viz).gameObject.SetActive(true); } } } public class MagFollower : MonoBehaviour { [Header("Only fill out one of the ones below.")] public FVRFireArmMagazine magazine; public FVRFireArmClip clip; public GameObject follower; [Header("Translation Mag Follower")] public bool UsesOneRoundPos; [Tooltip("The round count where the follower starts moving (e.g 20)")] public int StartAtRoundCount; [Tooltip("The round count where the follower stops moving (e.g 0)")] public int StopAtRoundCount; [Tooltip("The position where the follower should be when the magazine is full.")] public GameObject StartPos; [Tooltip("The position where the follower should be when the magazine has one round left.")] public GameObject OneRoundPos; [Tooltip("The position where the follower should be when the magazine is empty.")] public GameObject StopPos; [Header("Individual Point Mag Follower")] public bool UsesIndivdualPointMagFollower; [Tooltip("Top-to-bottom order, where the 0th position is when the magazine is empty. ")] public List Positions; [Header("Individual Mesh Replacement")] public bool UsesIndividualMeshReplacement; [Tooltip("Top-to-bottom order, where the 0th position is when the magazine is empty. ")] public List Meshes; private int magrounds; private MeshFilter followerFilter; public void Update() { if (magazine.m_numRounds != magrounds) { magrounds = magazine.m_numRounds; UpdateDisp(); } } public void Start() { followerFilter = follower.GetComponent(); } public void UpdateDisp() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) if (UsesOneRoundPos) { Transform transform = StopPos.transform; int num = StopAtRoundCount; if (UsesOneRoundPos) { transform = OneRoundPos.transform; num++; } follower.transform.position = Vector3.Lerp(StartPos.transform.position, transform.position, Mathf.InverseLerp((float)StartAtRoundCount, (float)num, (float)magazine.m_numRounds)); if (magazine.m_numRounds == 0) { follower.transform.position = StopPos.transform.position; } } if (UsesIndivdualPointMagFollower) { if (Positions.Count < magazine.m_numRounds || (Object)(object)Positions[magazine.m_numRounds] == (Object)null) { return; } follower.transform.position = Positions[magazine.m_numRounds].transform.position; follower.transform.rotation = Positions[magazine.m_numRounds].transform.rotation; } if (UsesIndivdualPointMagFollower) { if (Positions.Count < magazine.m_numRounds || (Object)(object)Positions[magazine.m_numRounds] == (Object)null) { return; } follower.transform.position = Positions[magazine.m_numRounds].transform.position; follower.transform.rotation = Positions[magazine.m_numRounds].transform.rotation; } if (UsesIndividualMeshReplacement && Meshes.Count >= magazine.m_numRounds && !((Object)(object)Meshes[magazine.m_numRounds] == (Object)null)) { followerFilter.mesh = Meshes[magazine.m_numRounds]; followerFilter.mesh = Meshes[magazine.m_numRounds]; } } } } namespace H3VRUtils.MonoScripts.VisualModifiers { public class ManipulateObjectFixed : MonoBehaviour { public enum dirtype { x, y, z, w } public enum transformtype { position, rotation, scale, quaternion, quaternionPresentedEuler } public enum dir { both, towardsStop, towardsStart } public enum StreamlinedDirType { AX_Button, BY_Button, Trigger } [Header("Object Being Observed")] public GameObject ObservedObject; public dirtype DirectionOfObservation; public transformtype TransformationTypeOfObservedObject; public float StartOfObservation; public float StopOfObservation; public dir ObservationDirection; [Header("Object Being Affected")] public GameObject AffectedObject; public dirtype DirectionOfAffection; public transformtype TransformationTypeOfAffectedObject; public float StartOfAffected; public float StopOfAffected; [Header("General Modifiers")] [Tooltip("Affected object will move itself over time to the expected position, instead of immediately. Recommended from 5-40. Defaults to 100 for effectively instant movement.")] public float LerpAmount = 100f; public bool usesCurve; [Tooltip("X/Y axis must be 0 to 1.")] public AnimationCurve Curve; [Header("Debug Values")] public float observationpoint; public float observationDistancePc; public float finalPoint; public float previousObservationDistancePc; public float previousFinalPoint; public float finalLerpAmt; private float rememberLerpPoint = -999f; [Header("Special Observations")] [Tooltip("When the observed object reaches or exceeds the stopofobservation, the affected object will snap back to the startofaffected, and will only reset when the observed object reaches the startofobserved.")] [Header("Snap Forwards")] public bool SnapForwardsOnMax; public bool SnappedForwards; public float SnapBackAt; [Tooltip("If off, it will 'unsnap' when under the bounds of Start Of Observation, Stop Of Observation, and Snap Back At. When on, it will unsnap when above all of those.")] public bool ResetIfOverBounds; [Tooltip("When on, it will lock when at its max, rather than snapping forward.")] public bool LockForward; [Header("Move On Touch Pad")] public bool ReadHandTouchpadMovement; public FVRInteractiveObject ItemToReadFrom; public H3VRUtilsMagRelease.TouchpadDirType DirToRead; public StreamlinedDirType DirToReadStreamlined; [Header("Move On Mag Loaded")] public bool ReadIfGunIsLoaded; public FVRFireArm FirearmToReadFrom; [Header("Move If Bolt Locked - Closed Bolt Only")] public bool ReadIfBoltIsLocked; public ClosedBolt BoltToReadFrom; [Header("Move If Specific Attachment Attached")] public bool MoveIfSpecificAttachmentAttached; public List AttachmentIDs; public FVRFireArmAttachmentMount AttachmentMount; private int rememberAttached; private float lastDecision; [Header("Move If Object Held")] public bool MoveIfObjectHeld; public FVRInteractiveObject HeldObject; private bool _isObservedObjectNotNull; [Header("Move If Grenade Armed")] public bool MoveIfGrenadeArmed; public PinnedGrenade grenade; [Header("Move If Disabled")] public bool MoveIfDisabled; [Header("Move If Chamber Full")] public bool MoveIfChamberFull; public FVRFireArmChamber Chamber; public bool considerFullEvenIfRoundFired; [Header("Special Affected Things")] [Header("Move Attached Items")] public bool MoveAttachedItems; [Tooltip("NOTE: THIS ONLY APPLIES TO THE FIRST ATTACHMENT IN THE MOUNT.")] public FVRFireArmAttachmentMount MAImount; [Header("Disable If Observed Object Moved")] public bool DisableIfMoved; [Tooltip("The percentage (from 0-1, not 0-100) at which point it disables. NOTE: IF SCRIPT IS ON DISABLED OBJECT, WILL NOT REENABLE")] [Range(0f, 1f)] public float percentageCutoff; private void Start() { _isObservedObjectNotNull = (Object)(object)ObservedObject != (Object)null; } public void Update() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Invalid comparison between Unknown and I4 //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_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Invalid comparison between Unknown and I4 //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_074d: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_0789: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) //IL_07fc: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Unknown result type (might be due to invalid IL or missing references) previousObservationDistancePc = observationDistancePc; observationDistancePc = 0f; if (_isObservedObjectNotNull) { switch (TransformationTypeOfObservedObject) { case transformtype.position: { Vector3 localPosition = ObservedObject.transform.localPosition; observationpoint = ((Vector3)(ref localPosition))[(int)DirectionOfObservation]; break; } case transformtype.rotation: { Vector3 localEulerAngles = ObservedObject.transform.localEulerAngles; observationpoint = ((Vector3)(ref localEulerAngles))[(int)DirectionOfObservation]; break; } case transformtype.scale: { Vector3 localScale = ObservedObject.transform.localScale; observationpoint = ((Vector3)(ref localScale))[(int)DirectionOfObservation]; break; } case transformtype.quaternion: { Quaternion localRotation2 = ObservedObject.transform.localRotation; observationpoint = ((Quaternion)(ref localRotation2))[(int)DirectionOfObservation]; break; } case transformtype.quaternionPresentedEuler: { Quaternion localRotation = ObservedObject.transform.localRotation; observationpoint = ((Quaternion)(ref localRotation))[(int)DirectionOfObservation] * 180f; break; } } observationDistancePc = Mathf.InverseLerp(StartOfObservation, StopOfObservation, observationpoint); } if (SnapForwardsOnMax) { bool flag = observationpoint <= Math.Min(StopOfObservation, Math.Min(StartOfObservation, SnapBackAt)); bool flag2 = observationpoint >= Math.Max(StopOfObservation, Math.Max(StartOfObservation, SnapBackAt)); if (flag || flag2) { SnappedForwards = true; } if (SnappedForwards) { observationDistancePc = 0f; } if ((!flag && !ResetIfOverBounds) || (!flag2 && ResetIfOverBounds)) { SnappedForwards = false; } if (SnappedForwards && LockForward) { observationDistancePc = 1f; } } if (ReadHandTouchpadMovement) { Vector2 up = Vector2.up; bool flag3 = false; if (DirToRead == H3VRUtilsMagRelease.TouchpadDirType.Up) { up = Vector2.up; } if (DirToRead == H3VRUtilsMagRelease.TouchpadDirType.Down) { up = Vector2.down; } if (DirToRead == H3VRUtilsMagRelease.TouchpadDirType.Left) { up = Vector2.left; } if (DirToRead == H3VRUtilsMagRelease.TouchpadDirType.Right) { up = Vector2.right; } if (DirToRead == H3VRUtilsMagRelease.TouchpadDirType.Trigger) { flag3 = true; } if ((Object)(object)ItemToReadFrom.m_hand != (Object)null) { switch (DirToReadStreamlined) { case StreamlinedDirType.AX_Button: if (ItemToReadFrom.m_hand.Input.AXButtonPressed) { observationDistancePc = 1f; } break; case StreamlinedDirType.Trigger: if (ItemToReadFrom.m_hand.Input.TriggerDown) { observationDistancePc = 1f; } break; } } } if (ReadIfGunIsLoaded) { if ((Object)(object)FirearmToReadFrom.Magazine != (Object)null) { observationDistancePc = 1f; } else { observationDistancePc = 0f; } } if (ReadIfBoltIsLocked) { if ((int)BoltToReadFrom.CurPos == 2 && (int)BoltToReadFrom.LastPos == 2) { observationDistancePc = 1f; } else { observationDistancePc = 0f; } } if (MoveIfSpecificAttachmentAttached) { foreach (FVRFireArmAttachment attachments in AttachmentMount.AttachmentsList) { foreach (string attachmentID in AttachmentIDs) { if (((FVRPhysicalObject)attachments).ObjectWrapper.ItemID == attachmentID) { observationDistancePc = 1f; break; } } } } if (MoveIfObjectHeld) { if ((Object)(object)HeldObject.m_hand != (Object)null) { observationDistancePc = 1f; } else { observationDistancePc = 0f; } } if (MoveIfGrenadeArmed) { } if (MoveIfDisabled) { if (!ObservedObject.activeSelf) { observationDistancePc = 1f; } else { observationDistancePc = 0f; } } if (MoveIfChamberFull) { if (considerFullEvenIfRoundFired) { if (Chamber.IsFull) { observationDistancePc = 1f; } } else if (Chamber.IsFull && !Chamber.IsSpent) { observationDistancePc = 1f; } else { observationDistancePc = 0f; } } finalLerpAmt = Mathf.Lerp(previousObservationDistancePc, observationDistancePc, LerpAmount * Time.deltaTime); if (usesCurve) { finalLerpAmt = Curve.Evaluate(finalLerpAmt); } previousFinalPoint = finalPoint; finalPoint = Mathf.Lerp(StartOfAffected, StopOfAffected, finalLerpAmt); finalPoint = Mathf.Lerp(previousFinalPoint, finalPoint, LerpAmount * Time.deltaTime); bool flag4 = false; if (Math.Abs(rememberLerpPoint - finalPoint) < float.Epsilon) { flag4 = true; } if (!SnappedForwards) { if (finalPoint - rememberLerpPoint < 0f && ObservationDirection == dir.towardsStop) { flag4 = true; } if (finalPoint - rememberLerpPoint > 0f && ObservationDirection == dir.towardsStart) { flag4 = true; } } rememberLerpPoint = finalPoint; if (flag4) { return; } if (MoveAttachedItems) { } if (DisableIfMoved) { Debug.Log((object)(observationDistancePc + ", " + percentageCutoff)); if (observationDistancePc >= percentageCutoff) { Debug.Log((object)"Hi!"); AffectedObject.SetActive(false); } else { AffectedObject.SetActive(true); } } if ((Object)(object)AffectedObject != (Object)null) { Vector3 val; switch (TransformationTypeOfAffectedObject) { case transformtype.position: val = AffectedObject.transform.localPosition; ((Vector3)(ref val))[(int)DirectionOfAffection] = finalPoint; AffectedObject.transform.localPosition = val; break; case transformtype.rotation: val = AffectedObject.transform.localEulerAngles; ((Vector3)(ref val))[(int)DirectionOfAffection] = finalPoint; AffectedObject.transform.localEulerAngles = val; break; case transformtype.scale: val = AffectedObject.transform.localScale; ((Vector3)(ref val))[(int)DirectionOfAffection] = finalPoint; AffectedObject.transform.localScale = val; break; case transformtype.quaternion: { Quaternion rotation = AffectedObject.transform.rotation; ((Quaternion)(ref rotation))[(int)DirectionOfAffection] = finalPoint; AffectedObject.transform.localRotation = rotation; break; } case transformtype.quaternionPresentedEuler: val = AffectedObject.transform.localEulerAngles; ((Vector3)(ref val))[(int)DirectionOfAffection] = finalPoint; AffectedObject.transform.localEulerAngles = val; break; } } } } } namespace Niko666 { internal class SpinOnDemand : MonoBehaviour { public ClosedBoltWeapon Weapon; public GameObject SpinnyThing; public float DefaultSpinRate = 1f; public float MaxSpinRate = 10f; public float AccelerationRate = 1f; public float DecelerationRate = 0.5f; private float currentSpinSpeed = 0f; public float RPMMultiplier = 1f; public cullOnZLoc.dirType DirectionOfSpin; private int _shotsSoFar = 0; public bool DisplayRPM = true; public Text DispText; public int minCharLength = 5; public void ShotFired(FVRFireArm fireArm) { if ((Object)(object)fireArm == (Object)(object)Weapon) { _shotsSoFar++; } } public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); currentSpinSpeed = DefaultSpinRate; } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } public void FixedUpdate() { //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Weapon != (Object)null) { if (_shotsSoFar > 0 && currentSpinSpeed < MaxSpinRate) { currentSpinSpeed += AccelerationRate * Time.deltaTime; if (currentSpinSpeed > MaxSpinRate) { currentSpinSpeed = MaxSpinRate; } } if ((!Weapon.Chamber.IsFull && ((Object)(object)((FVRFireArm)Weapon).Magazine == (Object)null || ((Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound()))) || ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null && ((FVRInteractiveObject)Weapon).m_hand.Input.TriggerUp)) { _shotsSoFar = 0; } if (_shotsSoFar == 0 && currentSpinSpeed > DefaultSpinRate) { currentSpinSpeed -= DecelerationRate * Time.deltaTime; if (currentSpinSpeed < DefaultSpinRate) { currentSpinSpeed = DefaultSpinRate; } } } if ((Object)(object)SpinnyThing != (Object)null) { Vector3 zero = Vector3.zero; int directionOfSpin = (int)DirectionOfSpin; if (directionOfSpin >= 0 && directionOfSpin <= 2) { ((Vector3)(ref zero))[directionOfSpin] = currentSpinSpeed * Time.deltaTime; SpinnyThing.transform.Rotate(zero); } else { Debug.LogWarning((object)"Invalid DirectionOfSpin value!"); } } if (DisplayRPM) { string text = (currentSpinSpeed * RPMMultiplier).ToString("f0"); int num = minCharLength - text.Length; for (int i = 0; i < num; i++) { text = "0" + text; } DispText.text = text; } } } } namespace H3VRUtils.FVRInteractiveObjects { internal class YFoldingStockEndPiece : MonoBehaviour { public cullOnZLoc.dirType MainPieceDir; public GameObject MainPiece; public float MainPieceMinRot; public float MainPieceMaxRot; public cullOnZLoc.dirType EndPieceDir; public GameObject EndPiece; public float EndPieceMinRot; public float EndPieceMaxRot; public void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_009b: Unknown result type (might be due to invalid IL or missing references) Vector3 localEulerAngles = EndPiece.transform.localEulerAngles; float[] array = new float[3] { localEulerAngles.x, localEulerAngles.y, localEulerAngles.z }; float mainPieceMinRot = MainPieceMinRot; float mainPieceMaxRot = MainPieceMaxRot; Quaternion localRotation = MainPiece.transform.localRotation; float num = Mathf.InverseLerp(mainPieceMinRot, mainPieceMaxRot, ((Quaternion)(ref localRotation))[(int)MainPieceDir] * 180f); array[(int)EndPieceDir] = Mathf.Lerp(EndPieceMinRot, EndPieceMaxRot, num); EndPiece.transform.localEulerAngles = new Vector3(array[0], array[1], array[2]); } } } namespace H3VRUtils { internal class compressingSpring : MonoBehaviour { public enum dirType { x, y, z } public GameObject compressor; public GameObject spring; public dirType directionOfCompression = dirType.z; public dirType directionOfCompressor = dirType.z; [Tooltip("The directionOfCompression position where the scale will be 1.")] public float fullextend; [Tooltip("The directionOfCompression position where the scale will be 0.")] public float fullcompress; private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0093: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = spring.transform.localScale; float[] array = new float[3] { localScale.x, localScale.y, localScale.z }; dirType num = directionOfCompression; Vector3 localPosition = compressor.transform.localPosition; array[(int)num] = (((Vector3)(ref localPosition))[(int)directionOfCompressor] - fullcompress) * (1f / (fullextend - fullcompress)); ((Vector3)(ref localScale))..ctor(array[0], array[1], array[2]); spring.transform.localScale = localScale; } } public class cullOnZLoc : MonoBehaviour { public enum cutOffType { above, below } public enum dirType { x, y, z } public cutOffType cutoff; public double loc; public GameObject objTarget; public dirType dir; private MeshRenderer objMeshRenderer; private void Start() { objMeshRenderer = ((Component)this).gameObject.GetComponent(); } private void Update() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) switch (cutoff) { case cutOffType.below: { MeshRenderer obj2 = objMeshRenderer; Vector3 localPosition2 = objTarget.transform.localPosition; ((Renderer)obj2).enabled = (double)((Vector3)(ref localPosition2))[(int)dir] > loc; break; } case cutOffType.above: { MeshRenderer obj = objMeshRenderer; Vector3 localPosition = objTarget.transform.localPosition; ((Renderer)obj).enabled = (double)((Vector3)(ref localPosition))[(int)dir] < loc; break; } } } } internal class followDir : MonoBehaviour { public GameObject leader; public GameObject follower; public cullOnZLoc.dirType FollowDirection; public Vector3 followerpos; public Vector3 leaderpos; public Vector3 resultpos; private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) follower.transform.position = leader.transform.position; } } } namespace H3VRUtils.MonoScripts.VisualModifiers { internal class laser : MonoBehaviour { public GameObject endpoint; private LineRenderer lr; private void Start() { lr = ((Component)this).GetComponent(); } private void Update() { //IL_000e: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) lr.SetPosition(0, ((Component)this).transform.position); RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val)) { if (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider)) { lr.SetPosition(1, ((RaycastHit)(ref val)).point); } } else { lr.SetPosition(1, endpoint.transform.position); } } } } namespace H3VRUtils.QOL { public class ItemCaller : MonoBehaviour { [Tooltip("This deletes the gameobject this script is on after death.")] public bool deleteGameObjectAfterSpawn; public bool spawnKinematicLocked; public List sets = new List { new ItemCallerSet { primaryItemID = "MyItemId", backupID = "My Backup ID if Primary ID fails to spawn" } }; public void Start() { } } [Serializable] public class ItemCallerSet { [Tooltip("Primary ID. this is the item the object will attempt to spawn.")] public string primaryItemID; [Tooltip("If your item fails to spawn, it will spawn the backup ID.")] public string backupID; [Tooltip("Offset from object position it will spawn from in local world space.")] public Vector3 offset; } } namespace H3VRUtils.MonoScripts.VisualModifiers { public class RotateTowardsPlayer : MonoBehaviour { public bool rotateOnX; public bool rotateOnY; public bool rotateOnZ; public void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) Vector3 localEulerAngles = ((Component)this).gameObject.transform.localEulerAngles; if (rotateOnX) { localEulerAngles.x = ((Component)this).gameObject.transform.localEulerAngles.x; } if (rotateOnY) { localEulerAngles.y = ((Component)this).gameObject.transform.localEulerAngles.y; } if (rotateOnZ) { localEulerAngles.z = ((Component)this).gameObject.transform.localEulerAngles.z; } ((Component)this).gameObject.transform.localEulerAngles = localEulerAngles; } } } namespace H3VRUtils.QOL { public class SouthpawSupporter : MonoBehaviour { [Tooltip("If true, automatically generates LeftHand and LeftHand_Touch.m")] public bool AutoSwapRot = true; public Transform LeftHand; public Transform LeftHand_Touch; private Transform RightHand; private Transform RightHand_Touch; private FVRPhysicalObject _physicalObject; public void Start() { //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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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) _physicalObject = ((Component)this).GetComponent(); RightHand = ((FVRInteractiveObject)_physicalObject).PoseOverride; RightHand_Touch = ((FVRInteractiveObject)_physicalObject).PoseOverride_Touch; if (AutoSwapRot) { LeftHand = setupEmpty(((FVRInteractiveObject)_physicalObject).PoseOverride).transform; LeftHand_Touch = setupEmpty(((FVRInteractiveObject)_physicalObject).PoseOverride_Touch).transform; Vector3 position = LeftHand.position; Vector3 localEulerAngles = LeftHand.localEulerAngles; position.x = 0f - position.x; LeftHand.localPosition = position; localEulerAngles.y = 0f - localEulerAngles.y; localEulerAngles.z = 0f - localEulerAngles.z; LeftHand.localEulerAngles = localEulerAngles; position = LeftHand_Touch.position; localEulerAngles = LeftHand_Touch.localEulerAngles; position.x = 0f - position.x; LeftHand_Touch.localPosition = position; localEulerAngles.y = 0f - localEulerAngles.y; localEulerAngles.z = 0f - localEulerAngles.z; LeftHand_Touch.localEulerAngles = localEulerAngles; } } public static GameObject setupEmpty(Transform tf) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(); val.transform.parent = tf; val.transform.localPosition = Vector3.zero; val.transform.localEulerAngles = Vector3.zero; val.transform.localScale = Vector3.zero; val.transform.parent = tf.parent; return val; } public void Update() { } } } namespace H3VRUtils { public class SimpleControls_ClosedBolt_BoltRelease : MonoBehaviour { } } namespace H3VRUtils.UniqueCode { internal class AssignMagIfNull : MonoBehaviour { public FVRFireArm firearm; public FVRFireArmMagazine magazine; public void FixedUpdate() { if ((Object)(object)firearm.Magazine == (Object)null) { firearm.Magazine = magazine; } } } public class BOMO : MonoBehaviour { [Tooltip("If there are no objects in the BOMO, it will act like a regular harnessed object (grab, move it about, let go and it returns to the slot.) If enabled, it will simply force you to let it go, and not let you unharness the object.")] public bool isStatic; [Tooltip("For usage as a static object. Puts itself into quickbelt and harnesses.")] public FVRQuickBeltSlot qbSlotForStatic; [Tooltip("Physical object the BOMO is connected to.")] public FVRPhysicalObject physobj; [Tooltip("List of all the items in the BOMO.")] public List itemsInTheBag; [Tooltip("Text that displays the amount of items in the bag. Not necessary.")] public Text itemsInTheBagText; [Tooltip("Maximum amount of items that can be stored in the BOMO.")] public int maxItems = 5; [Tooltip("If true, will just nuke any item put into it.")] public bool thevoid; public AudioEvent dropInToSound; public AudioEvent takeOutOfSound; private bool _isitemsInTheBagTextNotNull; private int deniedObjectTime; public List notPhysObjects = new List(); } public class DumpInternalMag : MonoBehaviour { public Handgun handgun; public H3VRUtilsMagRelease.TouchpadDirType presstoejectbutton; } internal class LebelCutoff : FVRInteractiveObject { public FVRFireArmMagazine TubeMagazine; public FVRFireArm Firearm; public Transform CutoffSwitchFalse; public Transform CutoffSwitchTrue; public GameObject CutoffSwitch; public Transform CutoffFlagFalse; public Transform CutoffFlagTrue; public GameObject CutoffFlag; public bool isCutoff; } internal class SelbstladerUnlockSystem : FVRInteractiveObject { public enum ChangePositionType { Swap, Unlock, Lock } public enum locktype { MagLocking, BoltLocking } public GameObject lockingpiece; public Transform lockingpieceunlocked; public Transform lockingpiecelocked; public ClosedBoltWeapon wep; public H3VRUtilsMagRelease magrelease; public FVRFireArmReloadTriggerWell magreloadtrigger; private float velocity; private bool unlocked; private Collider col; private Collider mrtcol; public locktype locker; } } namespace H3VRUtils.Mapping { public class SosigSpawn : MonoBehaviour { private Transform sosigSpawnLocation; [Header("Choose Sosig Type")] public SosigEnemyID listOfSosigs; private void Awake() { sosigSpawnLocation = ((Component)this).transform; } } }