using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using HarmonyLib; using OtherLoader; using ProBuilder2.Common; using ProBuilder2.MeshOperations; using Sodalite.Api; using Sodalite.Utilities; using UnityEditor; using UnityEngine; using UnityEngine.AI; 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] public class MagazineGizmos : MonoBehaviour { public float gizmoSize; public void OnDrawGizmos() { //IL_0001: 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) Gizmos.color = Color.yellow; Gizmos.DrawSphere(((Component)this).transform.position, gizmoSize); } } public class MagazineHelper : EditorWindow { public FVRFireArmMagazine Magazine; public bool isCurved; public Transform magazineRadiusCenter; public GameObject firstCartridge; public int numberOfCartridges = 1; public bool mirrorX; public float cartridgeOffsetY = 0f; public float cartridgeOffsetZ = 0f; public float cartridgeAngleOffsetX; public bool generateFollowerPoints; public bool useFollowerOffsets = false; public bool invertFollowerOffsets = false; public GameObject follower; public float followerOffsetY = 0f; public float followerOffsetZ = 0f; public bool showGizmo = false; public float gizmoSize = 0.01f; private GameObject cartridge_root; private GameObject[] CartridgeObjectList; private MeshFilter[] CartridgeMeshFilterList; private MeshRenderer[] CartridgeMeshRendererList; private float cartridge_currentX; private float cartridge_currentY; private float cartridge_currentZ; private bool ready1 = true; private bool ready2 = true; private GameObject follower_root; private GameObject[] FollowerObjectList; private float follower_currentX; private float follower_currentY; private float follower_currentZ; private float cartridge_angleX; private float cartridge_angleY; private MagazineGizmos gizmo; [MenuItem("Window/Magazine Helper")] public static void ShowWindow() { EditorWindow.GetWindow(typeof(MagazineHelper)); } private void OnGUI() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown GUILayout.Label("Cartridge Settings", EditorStyles.boldLabel, (GUILayoutOption[])(object)new GUILayoutOption[0]); EditorGUIUtility.labelWidth = 300f; Magazine = (FVRFireArmMagazine)EditorGUILayout.ObjectField("Magazine", (Object)(object)Magazine, typeof(FVRFireArmMagazine), true, (GUILayoutOption[])(object)new GUILayoutOption[0]); if ((Object)(object)Magazine == (Object)null) { EditorGUILayout.HelpBox("Please add Magazine!", (MessageType)3); ready1 = false; } isCurved = EditorGUILayout.Toggle("is curved", isCurved, (GUILayoutOption[])(object)new GUILayoutOption[0]); if (isCurved) { magazineRadiusCenter = (Transform)EditorGUILayout.ObjectField("Magazine Radius Center", (Object)(object)magazineRadiusCenter, typeof(Transform), true, (GUILayoutOption[])(object)new GUILayoutOption[0]); if ((Object)(object)magazineRadiusCenter == (Object)null) { EditorGUILayout.HelpBox("Please add Magazine Radius Center!", (MessageType)3); ready1 = false; } else { cartridgeAngleOffsetX = EditorGUILayout.Slider("Cartridge Angle Offset X", cartridgeAngleOffsetX, -10f, 10f, (GUILayoutOption[])(object)new GUILayoutOption[0]); showGizmo = EditorGUILayout.Toggle("Show Curved Mag Gizmo", showGizmo, (GUILayoutOption[])(object)new GUILayoutOption[0]); gizmoSize = EditorGUILayout.FloatField("Gizmo Size", gizmoSize, (GUILayoutOption[])(object)new GUILayoutOption[0]); } } else { showGizmo = false; } ShowGizmo(showGizmo); if (showGizmo) { gizmo.gizmoSize = gizmoSize; } firstCartridge = (GameObject)EditorGUILayout.ObjectField("First Cartridge", (Object)(object)firstCartridge, typeof(GameObject), true, (GUILayoutOption[])(object)new GUILayoutOption[0]); if ((Object)(object)firstCartridge == (Object)null) { EditorGUILayout.HelpBox("Please add Reference Cartridge!", (MessageType)3); ready1 = false; } numberOfCartridges = EditorGUILayout.IntField("Number of Cartridges", numberOfCartridges, (GUILayoutOption[])(object)new GUILayoutOption[0]); if (numberOfCartridges <= 0) { numberOfCartridges = 1; } mirrorX = EditorGUILayout.Toggle("Is double stacked Magazine (mirror X axis)", mirrorX, (GUILayoutOption[])(object)new GUILayoutOption[0]); if (!isCurved) { cartridgeOffsetY = EditorGUILayout.Slider("Cartridge Offset Y", cartridgeOffsetY, -0.1f, 0.1f, (GUILayoutOption[])(object)new GUILayoutOption[0]); cartridgeOffsetZ = EditorGUILayout.Slider("Cartridge Offset Z", cartridgeOffsetZ, -0.1f, 0.1f, (GUILayoutOption[])(object)new GUILayoutOption[0]); } generateFollowerPoints = EditorGUILayout.BeginToggleGroup("Generate Follower Points", generateFollowerPoints); follower = (GameObject)EditorGUILayout.ObjectField("Last Round Follower", (Object)(object)follower, typeof(GameObject), true, (GUILayoutOption[])(object)new GUILayoutOption[0]); if ((Object)(object)follower == (Object)null && generateFollowerPoints) { EditorGUILayout.HelpBox("Please add Follower!", (MessageType)3); ready2 = false; } followerOffsetY = cartridgeOffsetY; followerOffsetZ = cartridgeOffsetZ; EditorGUILayout.EndToggleGroup(); if (ready1 && !generateFollowerPoints) { if (GUILayout.Button("Add Cartridges", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) })) { AddCartridges(); } if (GUILayout.Button("Clear Cartridges", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) })) { ClearCartridges(all: true); } } else if (ready1 && ready2) { if (GUILayout.Button("Add Cartridges and FollowerPoints", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) })) { AddCartridges(); AddFollowerPoints(); } if (GUILayout.Button("Clear Cartridges and FollowerPoints", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) })) { ClearCartridges(all: true); ClearFollowerPoints(all: true); } if (GUILayout.Button("Remove FollowerPoint Visuals", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) })) { RemoveFollowerPointVisuals(); } } ready1 = true; ready2 = true; } private void AddCartridges() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_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_01fd: 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_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: 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_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: 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_02fc: 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_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) ClearCartridges(); CartridgeObjectList = (GameObject[])(object)new GameObject[numberOfCartridges]; CartridgeMeshFilterList = (MeshFilter[])(object)new MeshFilter[numberOfCartridges]; CartridgeMeshRendererList = (MeshRenderer[])(object)new MeshRenderer[numberOfCartridges]; CartridgeObjectList[0] = firstCartridge; CartridgeMeshFilterList[0] = firstCartridge.GetComponent(); CartridgeMeshRendererList[0] = firstCartridge.GetComponent(); cartridge_currentX = firstCartridge.transform.position.x; cartridge_currentY = firstCartridge.transform.position.y; cartridge_currentZ = firstCartridge.transform.position.z; if ((Object)(object)cartridge_root == (Object)null) { cartridge_root = new GameObject(); ((Object)cartridge_root).name = "Cartridge Root"; cartridge_root.transform.parent = firstCartridge.transform.parent; cartridge_root.transform.localPosition = new Vector3(0f, 0f, 0f); cartridge_root.transform.localEulerAngles = new Vector3(0f, 0f, 0f); cartridge_root.transform.localScale = new Vector3(1f, 1f, 1f); } Vector3 eulerAngles = default(Vector3); Vector3 val2 = default(Vector3); for (int i = 2; i <= numberOfCartridges; i++) { if (isCurved) { Vector3 val = CalculateNextCartridgePos(cartridgeAngleOffsetX * (float)(i - 1)); cartridge_currentY = val.y; cartridge_currentZ = val.z; } else { cartridge_currentY += cartridgeOffsetY; cartridge_currentZ += cartridgeOffsetZ; } Quaternion localRotation = firstCartridge.transform.localRotation; if (isCurved) { Quaternion localRotation2 = firstCartridge.transform.localRotation; float num = ((Quaternion)(ref localRotation2)).eulerAngles.x - cartridgeAngleOffsetX * (float)(i - 1); Quaternion localRotation3 = firstCartridge.transform.localRotation; float y = ((Quaternion)(ref localRotation3)).eulerAngles.y; Quaternion localRotation4 = firstCartridge.transform.localRotation; ((Vector3)(ref eulerAngles))..ctor(num, y, ((Quaternion)(ref localRotation4)).eulerAngles.z); } else { Quaternion localRotation5 = firstCartridge.transform.localRotation; float x = ((Quaternion)(ref localRotation5)).eulerAngles.x; Quaternion localRotation6 = firstCartridge.transform.localRotation; float y2 = ((Quaternion)(ref localRotation6)).eulerAngles.y; Quaternion localRotation7 = firstCartridge.transform.localRotation; ((Vector3)(ref eulerAngles))..ctor(x, y2, ((Quaternion)(ref localRotation7)).eulerAngles.z); } ((Quaternion)(ref localRotation)).eulerAngles = eulerAngles; ((Vector3)(ref val2))..ctor(cartridge_currentX, cartridge_currentY, cartridge_currentZ); GameObject val3 = Object.Instantiate(firstCartridge, val2, localRotation, cartridge_root.transform); ((Object)val3).name = ((Object)firstCartridge).name + " (" + i + ")"; if (mirrorX && i % 2 == 0) { val3.transform.localPosition = new Vector3(0f - val3.transform.localPosition.x, val3.transform.localPosition.y, val3.transform.localPosition.z); } CartridgeObjectList[i - 1] = val3; CartridgeMeshFilterList[i - 1] = val3.GetComponent(); CartridgeMeshRendererList[i - 1] = val3.GetComponent(); } Magazine.DisplayBullets = CartridgeObjectList; Magazine.DisplayMeshFilters = CartridgeMeshFilterList; Magazine.DisplayRenderers = (Renderer[])(object)CartridgeMeshRendererList; } private void ClearCartridges(bool all = false) { if ((Object)(object)cartridge_root != (Object)null) { int childCount = cartridge_root.transform.childCount; for (int num = childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)cartridge_root.transform.GetChild(num)).gameObject); } if (all) { Object.DestroyImmediate((Object)(object)cartridge_root); } } } private void AddFollowerPoints() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: 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_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) ClearFollowerPoints(); FollowerObjectList = (GameObject[])(object)new GameObject[numberOfCartridges]; FollowerObjectList[0] = follower; follower_currentX = follower.transform.position.x; follower_currentY = follower.transform.position.y; follower_currentZ = follower.transform.position.z; if ((Object)(object)follower_root == (Object)null) { follower_root = new GameObject(); ((Object)follower_root).name = "Follower Root"; follower_root.transform.parent = follower.transform.parent; follower_root.transform.localPosition = new Vector3(0f, 0f, 0f); follower_root.transform.localEulerAngles = new Vector3(0f, 0f, 0f); follower_root.transform.localScale = new Vector3(1f, 1f, 1f); } Vector3 val2 = default(Vector3); Vector3 eulerAngles = default(Vector3); for (int i = 2; i <= numberOfCartridges; i++) { if (isCurved) { Vector3 val = CalculateNextCartridgePos(cartridgeAngleOffsetX * (float)(i - 1)); follower_currentY = val.y; follower_currentZ = val.z; } else { follower_currentY += followerOffsetY; follower_currentZ += followerOffsetZ; } ((Vector3)(ref val2))..ctor(follower_currentX, follower_currentY, follower_currentZ); Quaternion localRotation = follower.transform.localRotation; if (isCurved) { Quaternion localRotation2 = follower.transform.localRotation; float num = ((Quaternion)(ref localRotation2)).eulerAngles.x - cartridgeAngleOffsetX * (float)(i - 1); Quaternion localRotation3 = follower.transform.localRotation; float y = ((Quaternion)(ref localRotation3)).eulerAngles.y; Quaternion localRotation4 = follower.transform.localRotation; ((Vector3)(ref eulerAngles))..ctor(num, y, ((Quaternion)(ref localRotation4)).eulerAngles.z); } else { Quaternion localRotation5 = follower.transform.localRotation; float x = ((Quaternion)(ref localRotation5)).eulerAngles.x; Quaternion localRotation6 = follower.transform.localRotation; float y2 = ((Quaternion)(ref localRotation6)).eulerAngles.y; Quaternion localRotation7 = follower.transform.localRotation; ((Vector3)(ref eulerAngles))..ctor(x, y2, ((Quaternion)(ref localRotation7)).eulerAngles.z); } ((Quaternion)(ref localRotation)).eulerAngles = eulerAngles; GameObject val3 = Object.Instantiate(follower, val2, localRotation, follower_root.transform); ((Object)val3).name = ((Object)follower).name + " (" + i + ")"; FollowerObjectList[i - 1] = val3; } } private void ClearFollowerPoints(bool all = false) { if ((Object)(object)follower_root != (Object)null) { int childCount = follower_root.transform.childCount; for (int num = childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)follower_root.transform.GetChild(num)).gameObject); } if (all) { Object.DestroyImmediate((Object)(object)follower_root); } } } private void RemoveFollowerPointVisuals() { if ((Object)(object)follower_root == (Object)null) { return; } GameObject[] followerObjectList = FollowerObjectList; foreach (GameObject val in followerObjectList) { if ((Object)(object)val != (Object)(object)follower) { MeshRenderer val2 = val.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = val.GetComponentInChildren(); } Object.DestroyImmediate((Object)(object)val2); MeshFilter val3 = val.GetComponent(); if ((Object)(object)val3 == (Object)null) { val3 = val.GetComponentInChildren(); } Object.DestroyImmediate((Object)(object)val3); } } } private void ShowGizmo(bool on) { switch (on) { case false: if ((Object)(object)gizmo != (Object)null) { Object.DestroyImmediate((Object)(object)gizmo); } break; case true: if ((Object)(object)gizmo == (Object)null) { gizmo = ((Component)magazineRadiusCenter).gameObject.AddComponent(); } break; } } private Vector3 CalculateNextCartridgePos(float deltaA) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00e8: Unknown result type (might be due to invalid IL or missing references) deltaA *= (float)Math.PI / 180f; Vector3 result = default(Vector3); Vector3 val = firstCartridge.transform.position - magazineRadiusCenter.position; float num = Mathf.Sqrt(Mathf.Pow(val.y, 2f) + Mathf.Pow(val.z, 2f)); float num2 = Mathf.Atan2(val.y, val.z); float num3 = Mathf.Sin(num2 + deltaA) * num + ((Component)magazineRadiusCenter).transform.position.y; float num4 = Mathf.Cos(num2 + deltaA) * num + ((Component)magazineRadiusCenter).transform.position.z; ((Vector3)(ref result))..ctor(firstCartridge.transform.position.x, num3, num4); return result; } private void ClearConsole() { Assembly assembly = Assembly.GetAssembly(typeof(ActiveEditorTracker)); Type type = assembly.GetType("UnityEditorInternal.LogEntries"); MethodInfo method = type.GetMethod("Clear"); method.Invoke(new object(), null); } private void OnDestroy() { Object.DestroyImmediate((Object)(object)gizmo); } } 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 != FreezeAxis.None) { 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 CustomScripts.FTR { public class AttachableClosedBoltReleaseTrigger : FVRInteractiveObject { public AttachableClosedBoltWeapon weapon; public override void Poke(FVRViveHand hand) { weapon.Bolt.ReleaseBolt(); } } public class AttachableTubeFedBoltReleaseTrigger : FVRInteractiveObject { public AttachableTubeFed weapon; public override void Poke(FVRViveHand hand) { weapon.Bolt.ReleaseBolt(); } } } namespace CustomScripts { public class GravRightAway : FVRPhysicalObject { public bool DoesUseHandedPose = true; [NonSerialized] [HideInInspector] public bool m_isInRightHandMode = true; [NonSerialized] [HideInInspector] public List m_rings = new List(); [Header("Lever")] public HingeJoint LeverJoint; [NonSerialized] [HideInInspector] public bool m_isLeverReleased; public GameObject FakeHandle; public GameObject RealHandle; public float LeverThreshold = 130f; [Header("Fusing")] public Vector2 DefaultFuse = new Vector2(3.3f, 3.3f); [NonSerialized] [HideInInspector] public float m_startFuseTime = 15f; [NonSerialized] [HideInInspector] public float m_fuseTime = 15f; public bool FuseOnSpawn; [NonSerialized] [HideInInspector] public bool m_isFused; public List FuseTimings = new List { 12f, 8f, 5f, 3f, 2f }; public bool HasImpactFuse; public bool DoesImpactFuseTickHeld; public float ImpactFuseVelThreshold = 5f; [NonSerialized] [HideInInspector] public bool m_isImpactFuseActive; public float m_impactFuseBurnDown = 1f; [Header("Special Params")] public bool UsesLaserEmit; public float LaserDelay = 1f; public PinnedGrenadeLaserEffect LasEffect; public bool UsesGravEffect; public float GravDelay = 1f; public PinnedGrenadeGrav GravEffect; public bool UsesGroundFireEffect; public GameObject GroundFirePrefab; public int GroundFireAmount = 8; public float GroundFireRange = 5f; public LayerMask LM_Env; [NonSerialized] [HideInInspector] public RaycastHit m_hit; [Header("Payload")] public List SpawnOnSplode; public SmokeSolidEmitter SmokeEmitter; [Header("Audio")] public AudioEvent AudEvent_StrikerActivate; public AudioEvent AudEvent_SafetyLeverRelease; public AudioEvent AudEvent_Pinpull; [NonSerialized] [HideInInspector] public float m_fuse_tick; [NonSerialized] [HideInInspector] public float m_fuse_PitchStart = 1.8f; [NonSerialized] [HideInInspector] public float m_fuse_PitchEnd = 3.7f; [NonSerialized] [HideInInspector] public float m_fuse_StartRefire = 0.4f; [NonSerialized] [HideInInspector] public float m_fuse_EndRefire = 0.02f; public AudioEvent AudEvent_FusePulse; public ParticleSystem FusePSystem; public Transform FuseCylinder; [NonSerialized] [HideInInspector] public int m_fuseCylinderSetting = 2; [NonSerialized] [HideInInspector] public float m_fuseCurYRotation; [NonSerialized] [HideInInspector] public float m_fuseTarYRotation; [NonSerialized] [HideInInspector] public bool m_isPinPulled; [NonSerialized] [HideInInspector] public bool m_hasSploded; public int IFF; public Rigidbody rb; public override void Awake() { //IL_0066: 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_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) ((FVRPhysicalObject)this).Awake(); AutoSplode(); ((MonoBehaviour)this).StartCoroutine("SplodeRoutine"); GravEffect.Engage(); rb.useGravity = false; rb.drag = 4f; rb.angularDrag = 20f; rb.mass = 20f; rb.AddForce(Vector3.up * 10f, (ForceMode)2); if (m_hasSploded) { return; } m_hasSploded = true; for (int i = 0; i < SpawnOnSplode.Count; i++) { GameObject val = Object.Instantiate(SpawnOnSplode[i], ((Component)this).transform.position, Quaternion.identity); Explosion component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.IFF = IFF; } ExplosionSound component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.IFF = IFF; } GrenadeExplosion component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.IFF = IFF; } } } public void AutoSplode() { ((MonoBehaviour)this).StartCoroutine("SplodeRoutine"); } private IEnumerator SplodeRoutine() { yield return null; for (int i = 0; i < m_rings.Count; i++) { if ((Object)(object)m_rings[i] != (Object)null && !m_rings[i].HasPinDetached()) { m_rings[i].PopOutRoutine(); } yield return null; } } public float FuseTime() { return m_fuseTime; } public float StartFuseTime() { return m_startFuseTime; } } public class An94BurstFromJerry : MonoBehaviour { public ClosedBoltWeapon An94; public bool isFullAuto = false; public bool triggerpulled = false; public bool one = false; public bool two = false; public FVRFireArmRecoilProfile norecoil; public FVRFireArmRecoilProfile hasrecoil; private void Start() { } private void Update() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) if (An94.m_triggerFloat > 0.8f) { triggerpulled = true; } else if (An94.m_triggerFloat < 0.8f) { triggerpulled = false; } if (isFullAuto) { An94.Bolt.Speed_Forward = 3f; An94.Bolt.Speed_Rearward = -4f; An94.Bolt.SpringStiffness = 50f; ((FVRFireArm)An94).RecoilProfile = hasrecoil; } else if (!isFullAuto) { An94.Bolt.Speed_Forward = 6f; An94.Bolt.Speed_Rearward = -8f; An94.Bolt.SpringStiffness = 500f; ((FVRFireArm)An94).RecoilProfile = norecoil; } if (triggerpulled && !isFullAuto) { if (((Component)An94.Bolt).gameObject.transform.localPosition.z < An94.Bolt.Point_Bolt_LockPoint.localPosition.z && !one && !two) { one = true; } if (((Component)An94.Bolt).gameObject.transform.localPosition.z > An94.Bolt.Point_Bolt_LockPoint.localPosition.z && one && !two) { two = true; } if (two) { isFullAuto = true; } } else if (!triggerpulled) { one = false; two = false; isFullAuto = false; } } } internal class autorackubweapon : MonoBehaviour { public AttachableFirearm weapon; private AttachableClosedBoltWeapon cbw; private AttachableTubeFed atf; private bool WasLoaded; public void Start() { if (weapon is AttachableClosedBoltWeapon) { ref AttachableClosedBoltWeapon reference = ref cbw; AttachableFirearm obj = weapon; reference = (AttachableClosedBoltWeapon)(object)((obj is AttachableClosedBoltWeapon) ? obj : null); } if (weapon is AttachableTubeFed) { ref AttachableTubeFed reference2 = ref atf; AttachableFirearm obj2 = weapon; reference2 = (AttachableTubeFed)(object)((obj2 is AttachableTubeFed) ? obj2 : null); } } public void FixedUpdate() { if ((Object)(object)weapon.Magazine != (Object)null) { if (!WasLoaded) { if ((Object)(object)cbw != (Object)null) { cbw.Bolt.ImpartFiringImpulse(); } if ((Object)(object)atf != (Object)null) { atf.Bolt.ImpartFiringImpulse(); } } WasLoaded = true; } else { WasLoaded = false; } } } public class chutefeedz : MonoBehaviour { public FVRFireArmMagazine Mag; public GameObject State; private void Start() { } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (State.transform.localPosition.z == 0f || ((double)State.transform.localPosition.z >= -0.02 && (double)State.transform.localPosition.z <= 0.02)) { Mag.IsExtractable = true; } else { Mag.IsExtractable = false; } } } public class TubeFedShotgunHandlePlus : TubeFedShotgunHandle { public enum BoltPos { Forward, ForwardToMid, Locked, LockedToRear, Rear } [Header("Rotating Bit")] public bool HasRotatingPart; public Transform RotatingPart; public Vector3 RotatingPartNeutralEulers; public Vector3 RotatingPartLeftEulers; public Vector3 RotatingPartRightEulers; private float m_handZOffset; private float m_boltZ_current; private float m_boltZ_heldTarget; private float m_boltZ_forward; private float m_boltZ_lock; private float m_boltZ_rear; private bool m_isHandleLocked; 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_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) ((TubeFedShotgunHandle)this).Awake(); m_boltZ_current = ((Component)this).transform.localPosition.z; m_boltZ_forward = base.Point_Bolt_Forward.localPosition.z; m_boltZ_lock = base.Point_Bolt_LockPoint.localPosition.z; m_boltZ_rear = base.Point_Bolt_Rear.localPosition.z; } public override void BeginInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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) m_handZOffset = ((Component)this).transform.InverseTransformPoint(((HandInput)(ref hand.Input)).Pos).z; ((TubeFedShotgunHandle)this).BeginInteraction(hand); if (HasRotatingPart) { Vector3 val = ((Component)this).transform.position - ((FVRInteractiveObject)this).m_hand.PalmTransform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; if (Vector3.Dot(normalized, ((Component)this).transform.right) > 0f) { RotatingPart.localEulerAngles = RotatingPartLeftEulers; } else { RotatingPart.localEulerAngles = RotatingPartRightEulers; } } } public float GetBoltLerpBetweenLockAndFore() { return Mathf.InverseLerp(m_boltZ_lock, m_boltZ_forward, m_boltZ_current); } public float GetBoltLerpBetweenRearAndFore() { return Mathf.InverseLerp(m_boltZ_rear, m_boltZ_forward, m_boltZ_current); } public void LockHandle() { m_isHandleLocked = true; } public void UnlockHandle() { m_isHandleLocked = false; } public void UpdateHandle() { //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_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_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_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e2: 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_00f8: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Expected I4, but got Unknown //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Expected I4, but got Unknown //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_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_0176: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_0348: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Invalid comparison between Unknown and I4 //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Invalid comparison between Unknown and I4 bool flag = false; if (((FVRInteractiveObject)this).IsHeld || ((FVRPhysicalObject)base.Shotgun).IsAltHeld) { flag = true; } if (flag && !m_isHandleLocked) { Vector3 closestValidPoint; if (((FVRInteractiveObject)this).IsHeld) { closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(base.Point_Bolt_Forward.position, base.Point_Bolt_Rear.position, ((HandInput)(ref ((FVRInteractiveObject)this).m_hand.Input)).Pos + -((Component)this).transform.forward * m_handZOffset * ((Component)base.Shotgun).transform.localScale.x); } else { if (((FVRInteractiveObject)base.Shotgun).m_hand.Input.TriggerPressed) { Vector3 velLinearWorld = ((FVRInteractiveObject)base.Shotgun).m_hand.Input.VelLinearWorld; velLinearWorld = Vector3.Project(velLinearWorld, ((Component)base.Shotgun).transform.forward); velLinearWorld = ((Component)base.Shotgun).transform.InverseTransformDirection(velLinearWorld); if (Mathf.Abs(velLinearWorld.z) > 1f) { float z = ((FVRInteractiveObject)base.Shotgun).GrabPointTransform.localPosition.z; float num = (0f - velLinearWorld.z) * Time.deltaTime; z += num; z = Mathf.Clamp(z, base.Point_Bolt_Rear.localPosition.z - 0.1f, base.Point_Bolt_Forward.localPosition.z + 0.1f); ((FVRInteractiveObject)base.Shotgun).GrabPointTransform.localPosition = new Vector3(((FVRInteractiveObject)base.Shotgun).GrabPointTransform.localPosition.x, ((FVRInteractiveObject)base.Shotgun).GrabPointTransform.localPosition.y, z); } } closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(base.Point_Bolt_Forward.position, base.Point_Bolt_Rear.position, ((HandInput)(ref ((FVRInteractiveObject)base.Shotgun).m_hand.Input)).Pos); } m_boltZ_heldTarget = ((Component)base.Shotgun).transform.InverseTransformPoint(closestValidPoint).z; } float num2 = m_boltZ_current; float boltZ_current = m_boltZ_current; if (flag && !m_isHandleLocked) { boltZ_current = m_boltZ_heldTarget; num2 = Mathf.MoveTowards(m_boltZ_current, boltZ_current, base.Speed_Held * Time.deltaTime); } if (Mathf.Abs(num2 - m_boltZ_current) > Mathf.Epsilon) { m_boltZ_current = num2; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_boltZ_current); } BoltPos curPos = base.CurPos; curPos = ((Mathf.Abs(m_boltZ_current - m_boltZ_forward) < 0.001f) ? ((BoltPos)0) : ((Mathf.Abs(m_boltZ_current - m_boltZ_lock) < 0.001f) ? ((BoltPos)2) : ((Mathf.Abs(m_boltZ_current - m_boltZ_rear) < 0.001f) ? ((BoltPos)4) : ((!(m_boltZ_current > m_boltZ_lock)) ? ((BoltPos)3) : ((BoltPos)1))))); int num3 = (int)base.CurPos; base.CurPos = (BoltPos)Mathf.Clamp((int)curPos, num3 - 1, num3 + 1); if ((int)base.CurPos == 0 && (int)base.LastPos != 0) { BoltEvent_ArriveAtFore(); } else if ((int)base.CurPos == 4 && (int)base.LastPos != 4) { BoltEvent_SmackRear(); } base.LastPos = base.CurPos; } private void BoltEvent_ArriveAtFore() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if ((int)base.Shotgun.Mode == 0) { if (base.Shotgun.IsHammerCocked) { LockHandle(); } if (base.Shotgun.Chamber.IsFull || base.Shotgun.HasExtractedRound()) { ((FVRFireArm)base.Shotgun).PlayAudioEvent((FirearmAudioEventType)11, 1f); } else { ((FVRFireArm)base.Shotgun).PlayAudioEvent((FirearmAudioEventType)40, 1f); } } } private void BoltEvent_SmackRear() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if ((int)base.Shotgun.Mode == 0) { if (base.Shotgun.Chamber.IsFull || base.Shotgun.HasExtractedRound()) { ((FVRFireArm)base.Shotgun).PlayAudioEvent((FirearmAudioEventType)10, 1f); } else { ((FVRFireArm)base.Shotgun).PlayAudioEvent((FirearmAudioEventType)41, 1f); } } } public override void UpdateInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector2 touchpadAxes = hand.Input.TouchpadAxes; bool flag = false; if (hand.IsInStreamlinedMode && hand.Input.BYButtonDown) { flag = true; } else if (hand.Input.TouchpadDown) { flag = true; } if (flag && (int)base.CurPos == 0 && base.Shotgun.CanModeSwitch) { base.Shotgun.ToggleMode(); } ((TubeFedShotgunHandle)this).UpdateInteraction(hand); } } [HelpURL("https://h3vr-modding.github.io/wiki/docs/h3vr/FistVR.CartridgeBox.html")] public class FTR_AmmoBox : FVRFireArmMagazine { public enum CartridgeBoxState { Closed, Open } [Header("Cartridge Box Stuff")] public FTR_AmmoBoxOpenControl Control; public int RoundsX = 5; public BoxCollider GrabCollider; public List Colliders; public List BoxPieces; public Transform InnerPiece; public Transform EjectPos; public BoxCollider GrabTrigger; public BoxCollider ReloadTriggerCol; public CartridgeBoxState BoxState; [Header("Audio")] public AudioEvent RoundsFallout_Many; public AudioEvent RoundsFallout_Few; public AudioEvent AudEvent_ShakeHard; public AudioEvent AudEvent_ShakeLight; [NonSerialized] public float timeSinceShakeSound = 1f; [NonSerialized] public Vector3 lastVel = Vector3.zero; [NonSerialized] public float height; [NonSerialized] public float width; [NonSerialized] public float timeSinceDumpSound = 0.1f; [NonSerialized] public int m_capacityCache; public override void FVRFixedUpdate() { //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_00ce: 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_007c: 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) ((FVRFireArmMagazine)this).FVRFixedUpdate(); Vector3 velocity = ((FVRPhysicalObject)this).RootRigidbody.velocity; if ((Object)(object)((FVRPhysicalObject)this).QuickbeltSlot == (Object)null) { float magnitude = ((Vector3)(ref velocity)).magnitude; float magnitude2 = ((Vector3)(ref lastVel)).magnitude; if (base.m_numRounds > RoundsX && timeSinceShakeSound > 0.2f) { if (Mathf.Abs(magnitude - magnitude2) > 1f) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_ShakeHard, ((Component)this).transform.position); timeSinceShakeSound = 0f; } if (Mathf.Abs(magnitude - magnitude2) > 0.25f) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_ShakeLight, ((Component)this).transform.position); timeSinceShakeSound = 0f; } } } lastVel = velocity; if (timeSinceShakeSound < 1f) { timeSinceShakeSound += Time.deltaTime; } } public override void Start() { ((FVRInteractiveObject)this).Start(); base.HideAllProxies = true; ((Collider)ReloadTriggerCol).enabled = false; } public void DumpAll() { //IL_0086: 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) if (base.m_numRounds >= 1 && base.m_numRounds > 0 && timeSinceDumpSound > 0.15f) { if (base.m_numRounds > RoundsX) { timeSinceDumpSound = 0f; SM.PlayCoreSound((FVRPooledAudioType)10, RoundsFallout_Many, ((Component)this).transform.position); } else { timeSinceDumpSound = 0f; SM.PlayCoreSound((FVRPooledAudioType)10, RoundsFallout_Few, ((Component)this).transform.position); } } } public override void FVRUpdate() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArmMagazine)this).FVRUpdate(); if (timeSinceDumpSound < 1f) { timeSinceDumpSound += Time.deltaTime; } float num = Vector3.Angle(((Component)this).transform.up, -Vector3.up); if (num < 30f) { DumpAll(); } if (m_capacityCache != base.m_numRounds) { m_capacityCache = base.m_numRounds; } } public void SetBoxState(CartridgeBoxState cbs) { //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_0013: 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_001c: Invalid comparison between Unknown and I4 //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) if (BoxState == cbs) { return; } if ((int)cbs != 0) { if ((int)cbs == 1) { base.HideAllProxies = false; ((FVRFireArmMagazine)this).UpdateBulletDisplay(); ((Collider)ReloadTriggerCol).enabled = true; } } else { base.HideAllProxies = true; ((FVRFireArmMagazine)this).UpdateBulletDisplay(); ((Collider)ReloadTriggerCol).enabled = false; } BoxState = cbs; } } [HelpURL("https://h3vr-modding.github.io/wiki/docs/h3vr/FistVR.CartridgeBox_GrabTrigger.html")] public class FTR_AmmoBoxGrabTrigger : FVRInteractiveObject { public FTR_AmmoBox Mag; public override bool IsInteractable() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) return ((FVRFireArmMagazine)Mag).HasARound() && (int)Mag.BoxState != 0 && ((FVRInteractiveObject)this).IsInteractable(); } public override void SimpleInteraction(FVRViveHand hand) { //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_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) //IL_00ae: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (((FVRFireArmMagazine)Mag).HasARound()) { GameObject val = ((FVRFireArmMagazine)Mag).RemoveRound(false); Vector3 position = ((FVRFireArmMagazine)Mag).DisplayBullets[Mathf.Clamp(((FVRFireArmMagazine)Mag).m_numRounds - 1, 0, ((FVRFireArmMagazine)Mag).DisplayBullets.Length - 1)].transform.position; Quaternion rotation = ((FVRFireArmMagazine)Mag).DisplayBullets[Mathf.Clamp(((FVRFireArmMagazine)Mag).m_numRounds - 1, 0, ((FVRFireArmMagazine)Mag).DisplayBullets.Length - 1)].transform.rotation; GameObject val2 = Object.Instantiate(val, ((FVRFireArmMagazine)Mag).DisplayBullets[((FVRFireArmMagazine)Mag).m_numRounds].transform.position, ((FVRFireArmMagazine)Mag).DisplayBullets[((FVRFireArmMagazine)Mag).m_numRounds].transform.rotation); FVRFireArmRound component = val2.GetComponent(); ((Component)component).GetComponent().BeginAnimationFrom(position, rotation); hand.ForceSetInteractable((FVRInteractiveObject)(object)component); ((FVRInteractiveObject)component).BeginInteraction(hand); } } } [HelpURL("https://h3vr-modding.github.io/wiki/docs/h3vr/FistVR.CartridgeBoxOpeningControl.html")] public class FTR_AmmoBoxOpenControl : FVRInteractiveObject { public FTR_AmmoBox Box; public AudioEvent AudEvent_Grab; public AudioEvent AudEvent_End; public override bool IsInteractable() { return ((FVRInteractiveObject)Box).IsHeld; } public override void BeginInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) SM.PlayCoreSound((FVRPooledAudioType)0, AudEvent_Grab, ((HandInput)(ref hand.Input)).Pos); ((FVRInteractiveObject)this).BeginInteraction(hand); } public override void UpdateInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).UpdateInteraction(hand); } public override void EndInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) SM.PlayCoreSound((FVRPooledAudioType)0, AudEvent_End, ((HandInput)(ref hand.Input)).Pos); ((FVRInteractiveObject)this).EndInteraction(hand); } } } namespace Sora101Ven.Strider_303_Sniper_Rifle { [BepInPlugin("Sora101Ven.Strider_303_Sniper_Rifle", "Strider_303_Sniper_Rifle", "1.0.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class Strider_303_Sniper_RiflePlugin : 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(), "Sora101Ven.Strider_303_Sniper_Rifle"); OtherLoader.RegisterDirectLoad(BasePath, "Sora101Ven.Strider_303_Sniper_Rifle", "", "", "bo7strider", ""); } } } public class ExtrudeRandomEdges : MonoBehaviour { private pb_Object pb; private pb_Face lastExtrudedFace = null; public float distance = 1f; private void Start() { pb = pb_ShapeGenerator.PlaneGenerator(1f, 1f, 0, 0, (Axis)2, false); pb.SetFaceMaterial(pb.faces, pb_Constant.DefaultMaterial); lastExtrudedFace = pb.faces[0]; } private void OnGUI() { if (GUILayout.Button("Extrude Random Edge", (GUILayoutOption[])(object)new GUILayoutOption[0])) { ExtrudeEdge(); } } private void ExtrudeEdge() { //IL_0096: 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_00b4: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0106: 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_0124: 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_0174: Unknown result type (might be due to invalid IL or missing references) pb_Face sourceFace = lastExtrudedFace; List wingedEdges = pb_WingedEdge.GetWingedEdges(pb, false); IEnumerable source = wingedEdges.Where((pb_WingedEdge x) => x.face == sourceFace); List list = (from y in source where y.opposite == null select y.edge.local).ToList(); int index = Random.Range(0, list.Count); pb_Edge val = list[index]; Vector3 val2 = (pb.vertices[val.x] + pb.vertices[val.y]) * 0.5f - pb_Math.Average((IList)sourceFace.distinctIndices, (Func)((int x) => pb.vertices[x]), (IList)null); ((Vector3)(ref val2)).Normalize(); pb_Edge[] selectedEdges = default(pb_Edge[]); pbMeshOps.Extrude(pb, (pb_Edge[])(object)new pb_Edge[1] { val }, 0f, false, true, ref selectedEdges); lastExtrudedFace = pb.faces.Last(); pb.SetSelectedEdges((IEnumerable)selectedEdges); pb_Object_Utility.TranslateVertices(pb, pb.SelectedTriangles, val2 * distance); pb.ToMesh(); pb.Refresh((RefreshMask)255); } } public class HighlightNearestFace : MonoBehaviour { public float travel = 50f; public float speed = 0.2f; private pb_Object target; private pb_Face nearest = null; private void Start() { //IL_0061: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) target = pb_ShapeGenerator.PlaneGenerator(travel, travel, 25, 25, (Axis)2, false); target.SetFaceMaterial(target.faces, pb_Constant.DefaultMaterial); ((Component)target).transform.position = new Vector3(travel * 0.5f, 0f, travel * 0.5f); target.ToMesh(); target.Refresh((RefreshMask)255); Camera main = Camera.main; ((Component)main).transform.position = new Vector3(25f, 40f, 0f); ((Component)main).transform.localRotation = Quaternion.Euler(new Vector3(65f, 0f, 0f)); } private void Update() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00dd: 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_013d: Unknown result type (might be due to invalid IL or missing references) float num = Time.time * speed; Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(Mathf.PerlinNoise(num, num) * travel, 2f, Mathf.PerlinNoise(num + 1f, num + 1f) * travel); ((Component)this).transform.position = position; if ((Object)(object)target == (Object)null) { Debug.LogWarning((object)"Missing the ProBuilder Mesh target!"); return; } Vector3 val = ((Component)target).transform.InverseTransformPoint(((Component)this).transform.position); if (nearest != null) { target.SetFaceColor(nearest, Color.white); } int num2 = target.faces.Length; float num3 = float.PositiveInfinity; nearest = target.faces[0]; for (int i = 0; i < num2; i++) { float num4 = Vector3.Distance(val, FaceCenter(target, target.faces[i])); if (num4 < num3) { num3 = num4; nearest = target.faces[i]; } } target.SetFaceColor(nearest, Color.blue); target.RefreshColors(); } private Vector3 FaceCenter(pb_Object pb, pb_Face face) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00c6: Unknown result type (might be due to invalid IL or missing references) Vector3[] vertices = pb.vertices; Vector3 zero = Vector3.zero; int[] distinctIndices = face.distinctIndices; foreach (int num in distinctIndices) { zero.x += vertices[num].x; zero.y += vertices[num].y; zero.z += vertices[num].z; } float num2 = face.distinctIndices.Length; zero.x /= num2; zero.y /= num2; zero.z /= num2; return zero; } } public class CTF_CaptureZone : MonoBehaviour { public CTF_Manager Manager; public CTF_Team Team; public void OnTriggerEnter(Collider other) { CTF_Flag component = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.Team != Team) { Manager.FlagCaptured(component); } } } public class CTF_Flag : FVRPhysicalObject { [Header("Flag stuffs")] public CTF_Team Team; public float RespawnDelay = 10f; public Vector3 FloorOffset = new Vector3(0f, 0.25f, 0f); private Vector3 _resetPosition; private Quaternion _resetRotation; private Transform _followTransform; private bool _isHeld; private bool _isTaken; private float _timer; private CTF_Sosig _heldBy; private void Update() { if (_isTaken && !_isHeld) { _timer -= Time.deltaTime; if (_timer < 0f) { ReturnFlag(); } } } public void Take() { _isHeld = true; _isTaken = true; } public void Drop() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).IsHeld = false; _timer = RespawnDelay; NavMeshHit val = default(NavMeshHit); NavMesh.SamplePosition(((Component)this).transform.position, ref val, 100f, -1); ((Component)this).transform.position = ((NavMeshHit)(ref val)).position + FloorOffset; ((Component)this).transform.rotation = Quaternion.identity; } public void ReturnFlag() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)this).IsHeld) { ((FVRInteractiveObject)this).ForceBreakInteraction(); } if (Object.op_Implicit((Object)(object)_heldBy)) { _heldBy.HeldFlag = null; } ((Component)this).transform.SetPositionAndRotation(_resetPosition, _resetRotation); _isTaken = false; } private void OnTriggerEnter(Collider other) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (_isHeld) { return; } CTF_Sosig componentInParent = ((Component)other).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent) && (int)componentInParent.Sosig.BodyState == 0) { if (componentInParent.Team == Team) { ReturnFlag(); return; } _heldBy = componentInParent; componentInParent.HeldFlag = this; Take(); } } public override void BeginInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).BeginInteraction(hand); Take(); } public override void EndInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).EndInteraction(hand); Drop(); } } public class CTF_Manager : MonoBehaviour { [Header("References")] public Text[] ScoreTexts; public Transform[] AttackPoints; public Text StartButtonText; [Header("Red Team")] public CTF_Flag RedFlag; public int RedTeamSize; public Transform[] RedSpawns; public SosigEnemyID[] RedTeam; [Header("Blue Team")] public CTF_Flag BlueFlag; public int BlueTeamSize; public Transform[] BlueSpawns; public SosigEnemyID[] BlueTeam; private int _blueScore; private int _redScore; private bool _running; private readonly List _sosigs = new List(); private readonly SpawnOptions _spawnOptions; public CTF_Manager() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown SpawnOptions val = new SpawnOptions(); val.SpawnState = (SosigOrder)7; val.SpawnActivated = true; val.EquipmentMode = (EquipmentSlots)7; val.SpawnWithFullAmmo = true; _spawnOptions = val; ((MonoBehaviour)this)..ctor(); } private void Start() { UpdateScoreText(); } public void ToggleGame() { if (_running) { EndGame(); StartButtonText.text = "Start Game"; } else { StartGame(); StartButtonText.text = "Stop Game"; } } private void StartGame() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ResetGame(); _running = true; GM.CurrentSceneSettings.SosigKillEvent += new SosigKill(CurrentSceneSettingsOnSosigKillEvent); ((MonoBehaviour)this).StartCoroutine(DoInitialSpawns()); } private void EndGame() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.SosigKillEvent -= new SosigKill(CurrentSceneSettingsOnSosigKillEvent); foreach (CTF_Sosig sosig in _sosigs) { sosig.Sosig.ClearSosig(); } _running = false; } private void CurrentSceneSettingsOnSosigKillEvent(Sosig s) { CTF_Sosig cTF_Sosig = _sosigs.FirstOrDefault((CTF_Sosig x) => (Object)(object)x.Sosig == (Object)(object)s); if (Object.op_Implicit((Object)(object)cTF_Sosig)) { ((MonoBehaviour)this).StartCoroutine(RespawnSosig(cTF_Sosig)); } } private void SpawnSosig(CTF_Team team) { //IL_001e: 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_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_007b: 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_008e: Unknown result type (might be due to invalid IL or missing references) _spawnOptions.IFF = (int)team; _spawnOptions.SosigTargetPosition = SodaliteUtils.GetRandom((IList)AttackPoints).position; Transform transform; SosigEnemyID random; if (team == CTF_Team.Red) { transform = ((Component)SodaliteUtils.GetRandom((IList)RedSpawns)).transform; random = SodaliteUtils.GetRandom((IList)RedTeam); } else { transform = ((Component)SodaliteUtils.GetRandom((IList)BlueSpawns)).transform; random = SodaliteUtils.GetRandom((IList)BlueTeam); } Sosig val = SosigAPI.Spawn(ManagerSingleton.Instance.odicSosigObjsByID[random], _spawnOptions, transform.position, transform.rotation); CTF_Sosig cTF_Sosig = ((Component)val).gameObject.AddComponent(); _sosigs.Add(cTF_Sosig); cTF_Sosig.Sosig = val; cTF_Sosig.Team = team; } private IEnumerator DoInitialSpawns() { int i = 0; while (i < Mathf.Max(RedTeamSize, BlueTeamSize)) { if (i < RedTeamSize) { SpawnSosig(CTF_Team.Red); } if (i < BlueTeamSize) { SpawnSosig(CTF_Team.Blue); } i++; yield return (object)new WaitForSeconds(2.5f); } } private IEnumerator RespawnSosig(CTF_Sosig sosig) { yield return (object)new WaitForSeconds(5f); sosig.Sosig.ClearSosig(); _sosigs.Remove(sosig); yield return (object)new WaitForSeconds(5f); if (_running) { int sosigsLeft = _sosigs.Count((CTF_Sosig x) => x.Team == sosig.Team); int teamSize = ((sosig.Team != CTF_Team.Red) ? BlueTeamSize : RedTeamSize); if (sosigsLeft < teamSize) { SpawnSosig(sosig.Team); } } } public void ResetGame() { _blueScore = 0; _redScore = 0; UpdateScoreText(); if (Object.op_Implicit((Object)(object)RedFlag)) { RedFlag.ReturnFlag(); } if (Object.op_Implicit((Object)(object)BlueFlag)) { BlueFlag.ReturnFlag(); } } public void FlagCaptured(CTF_Flag flag) { if (flag.Team == CTF_Team.Red) { _blueScore++; } else { _redScore++; } UpdateScoreText(); flag.ReturnFlag(); } public void UpdateScoreText() { Text[] scoreTexts = ScoreTexts; foreach (Text val in scoreTexts) { val.text = "" + _redScore + " - " + _blueScore + ""; } } private void OnDrawGizmos() { //IL_0001: 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_003b: 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_007d: 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) Gizmos.color = Color.red; Transform[] redSpawns = RedSpawns; foreach (Transform val in redSpawns) { Gizmos.DrawSphere(val.position, 0.15f); } Gizmos.color = Color.blue; Transform[] blueSpawns = BlueSpawns; foreach (Transform val2 in blueSpawns) { Gizmos.DrawSphere(val2.position, 0.15f); } Gizmos.color = Color.green; Transform[] attackPoints = AttackPoints; foreach (Transform val3 in attackPoints) { Gizmos.DrawSphere(val3.position, 0.15f); } } } public class CTF_Sosig : MonoBehaviour { public CTF_Team Team; public CTF_Flag HeldFlag; public Sosig Sosig; private void Awake() { Sosig = ((Component)this).GetComponent(); } private void Update() { //IL_001d: 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_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)HeldFlag)) { Vector3 val = ((Component)Sosig).transform.position - ((Component)Sosig).transform.forward * 0.1f; ((Component)HeldFlag).transform.SetPositionAndRotation(val, ((Component)Sosig).transform.rotation); } } } public enum CTF_Team { Red, Blue } public class PopupTarget : MonoBehaviour, IFVRDamageable { [Flags] public enum TargetRange { Near = 1, Mid = 2, Far = 4, All = 7 } public PopupTargetManager Manager; public TargetRange Range; public Transform Pivot; public Vector3 SetRotation; private Quaternion _startRotation; private Quaternion _endRotation; private bool _set; public bool Set { get { return _set; } set { //IL_003e: 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_0027: 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) if (_set != value) { _set = value; ((MonoBehaviour)this).StartCoroutine((!_set) ? RotateTo(_endRotation, _startRotation) : RotateTo(_startRotation, _endRotation)); } } } private void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_002e: Unknown result type (might be due to invalid IL or missing references) _startRotation = Pivot.rotation; _endRotation = Quaternion.Euler(SetRotation + ((Quaternion)(ref _startRotation)).eulerAngles); } void IFVRDamageable.Damage(Damage dam) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 if (Set && (int)dam.Class == 1) { Set = false; Manager.TargetHit(this); } } private IEnumerator RotateTo(Quaternion from, Quaternion to) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float elapsed = 0f; while (elapsed < 0.25f) { yield return null; elapsed += Time.deltaTime; Pivot.localRotation = Quaternion.Slerp(from, to, elapsed / 0.25f); } Pivot.rotation = to; } } public class PopupTargetManager : MonoBehaviour { public List Targets; private readonly List _setTargets = new List(); private void Awake() { ((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All)); } private IEnumerator StartSetAsync(float minDelay, float maxDelay, int numTargets, PopupTarget.TargetRange ranges) { yield return (object)new WaitForSeconds(Random.Range(minDelay, maxDelay)); IListExtensions.Shuffle((IList)Targets); _setTargets.Clear(); foreach (PopupTarget target in Targets) { if ((target.Range & ranges) != 0) { target.Set = true; _setTargets.Add(target); numTargets--; } if (numTargets == 0) { break; } } } public void TargetHit(PopupTarget target) { if (_setTargets.Contains(target)) { _setTargets.Remove(target); if (_setTargets.Count == 0) { ((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All)); } } } } namespace CustomScripts { public class RegenAmmoMod : MonoBehaviour { public FVRFireArmMagazine Magazine; public float rate = 2f; private float nextTime; public void Start() { ((MonoBehaviour)this).InvokeRepeating("regenrounds", 5.08f, rate); } public void regenrounds() { if (Magazine.m_numRounds < Magazine.m_capacity && Magazine.m_numRounds > 0) { FVRFireArmMagazine magazine = Magazine; magazine.m_numRounds++; Magazine.UpdateBulletDisplay(); } } private void Update() { } } public class PBNGSHeatingScript : MonoBehaviour { [Header("Firearm Heating Effect")] [Tooltip("Use this if you plan to use the script on a firearm.")] public FVRFireArm FireArm; [Tooltip("Use this if you plan to use the script on an attachment.")] public FVRFireArmAttachment Attachment; public bool OnModularPart = false; [Header("Heat Config")] [Tooltip("Heat added to the effect per shot fired. Heat caps out at 1.")] public float HeatPerShot = 0.01f; [Tooltip("Heat removed per second.")] public float CooldownRate = 0.01f; [Tooltip("This multiplier will affect the heat gain of all parts of the gun. It will act multiplicatively with other such multipliers.")] public float HeatMultiplier = 1f; [Tooltip("Adds a separate Multiplier for Round power. (None, Tiny, Pistol, Shotgun, Intermediate, FullPower, AntiMaterial, Ordnance, Exotic, Fire)")] public bool ChangesWithCartridgePower = false; [Tooltip("None, Tiny, Pistol, Shotgun, Intermediate, FullPower, AntiMaterial, Ordnance, Exotic, Fire")] public float[] RoundPowerMultipliers = new float[10] { 0f, 0.25f, 0.5f, 0.75f, 1f, 2f, 4f, 4f, 1f, 8f }; [Header("Emission modification config")] public SkinnedMeshRenderer SkinnedMeshRenderer; [Tooltip("Anton uses the squared value of the heat to determine the emission weight. If you wanna replicate that behavior, leave the value as is, but feel free to go crazy if you wanna mix things up.")] public float HeatExponent = 2f; public bool HeatAffectsEmissionWeight = true; public bool HeatAffectsEmissionScrollSpeed = false; [Tooltip("Maximum left/right emission scroll speed.")] public float MaxEmissionScrollSpeed_X = 0f; [Tooltip("Maximum up/down emission scroll speed.")] public float MaxEmissionScrollSpeed_Y = 0f; [Tooltip("Enables emission weight AnimationCurve system.")] public bool EmissionUsesAdvancedCurve = false; [Tooltip("Advanced emission weight control. Values from 0 to 1 only!")] [Header("Detail weight config")] public bool HeatAffectsDetailWeight = true; [Tooltip("Same as the normal HeatExponent, but for the detail weight.")] public float DetailExponent = 2f; [Tooltip("Enables emission weight AnimationCurve system.")] public bool DetailUsesAdvancedCurve = false; [Header("Debug Messages")] public bool DebugEnabled = false; [Range(0f, 1f)] public float Heat = 0f; private const string c_EmissionWeightPropertyString = "_EmissionWeight"; private const string c_IncandescenceScrollSpeedPropertyString = "_IncandescenceMapVelocity"; private const string c_DetailWeightPropertyString = "_DetailWeight"; public void Update() { if (Heat > 0f) { Heat -= Time.deltaTime * CooldownRate; } Heat = Mathf.Clamp(Heat, 0f, 1f); } } }