Decompiled source of CDZ x redmoon dependency pack v2.0.1
CDZVanilla.dll
Decompiled 3 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.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<MeshFilter>(); CartridgeMeshRendererList[0] = firstCartridge.GetComponent<MeshRenderer>(); 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<GameObject>(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<MeshFilter>(); CartridgeMeshRendererList[i - 1] = val3.GetComponent<MeshRenderer>(); } 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<GameObject>(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<MeshRenderer>(); if ((Object)(object)val2 == (Object)null) { val2 = val.GetComponentInChildren<MeshRenderer>(); } Object.DestroyImmediate((Object)(object)val2); MeshFilter val3 = val.GetComponent<MeshFilter>(); if ((Object)(object)val3 == (Object)null) { val3 = val.GetComponentInChildren<MeshFilter>(); } 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<MagazineGizmos>(); } 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<Animation>(); ((Behaviour)componentInChildren).enabled = GUI.Toggle(new Rect(50f, 70f, 200f, 24f), ((Behaviour)componentInChildren).enabled, "Play Animation"); DynamicBone[] components = m_Player.GetComponents<DynamicBone>(); 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<DynamicBoneColliderBase> m_Colliders = null; [Tooltip("Bones exclude from physics simulation.")] public List<Transform> 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<Particle> m_Particles = new List<Particle>(); 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<PinnedGrenadeRing> m_rings = new List<PinnedGrenadeRing>(); [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<float> FuseTimings = new List<float> { 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<GameObject> 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<GameObject>(SpawnOnSplode[i], ((Component)this).transform.position, Quaternion.identity); Explosion component = val.GetComponent<Explosion>(); if ((Object)(object)component != (Object)null) { component.IFF = IFF; } ExplosionSound component2 = val.GetComponent<ExplosionSound>(); if ((Object)(object)component2 != (Object)null) { component2.IFF = IFF; } GrenadeExplosion component3 = val.GetComponent<GrenadeExplosion>(); 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
zozigweapons.dll
Decompiled 3 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using Atlas.MappingComponents.Sandbox; using BepInEx; using BepInEx.Logging; using CustomScripts; using CustomScripts.Gamemode; using CustomScripts.Gamemode.GMDebug; using CustomScripts.Managers; using CustomScripts.Objects; using CustomScripts.Objects.Weapons; using CustomScripts.Objects.Windows; using CustomScripts.Player; using CustomScripts.Powerups; using CustomScripts.Zombie; using FistVR; using GunGame.Scripts; using GunGame.Scripts.Options; using GunGame.Scripts.Weapons; using HarmonyLib; using LuxWater; using OtherLoader; using Sodalite.Api; using UnityEditor; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.Serialization; using UnityEngine.UI; using Valve.VR; [assembly: AssemblyTitle("CustomScripts")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CustomScripts")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7ac675fa-8ffe-4c1b-8787-a764e1845c24")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] public class PlaySoundOnEnter : MonoBehaviour { public AudioClip SoundToPlay; public float Volume; private AudioSource audio; public bool alreadyPlayed = false; private void Start() { audio = ((Component)this).GetComponent<AudioSource>(); } private void OnTriggerEnter() { if (!alreadyPlayed) { audio.PlayOneShot(SoundToPlay, Volume); alreadyPlayed = true; } } } namespace CustomScripts { [RequireComponent(typeof(IPurchasable))] public class CanPurchaseTextChanger : MonoBehaviour { private IPurchasable _purchasable; private IRequiresPower _requiresPower; [SerializeField] private List<Text> _texts; private void Start() { _purchasable = ((Component)this).GetComponent<IPurchasable>(); _requiresPower = ((Component)this).GetComponent<IRequiresPower>(); GameManager.OnPointsChanged = (Action)Delegate.Combine(GameManager.OnPointsChanged, new Action(UpdateTexts)); GameManager.OnPowerEnabled = (Action)Delegate.Combine(GameManager.OnPowerEnabled, new Action(UpdateTexts)); UpdateTexts(); } private void UpdateTexts() { //IL_004d: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (_requiresPower != null && !_requiresPower.IsPowered) { for (int i = 0; i < _texts.Count; i++) { _texts[i].text = "No power"; ((Graphic)_texts[i]).color = MonoBehaviourSingleton<GameReferences>.Instance.CannotBuyColor; } } else if (_purchasable.IsOneTimeOnly && _purchasable.AlreadyBought) { for (int j = 0; j < _texts.Count; j++) { _texts[j].text = "Out of stock"; ((Graphic)_texts[j]).color = MonoBehaviourSingleton<GameReferences>.Instance.CannotBuyColor; } } else if (MonoBehaviourSingleton<GameManager>.Instance.Points >= _purchasable.PurchaseCost) { for (int k = 0; k < _texts.Count; k++) { Text obj = _texts[k]; string text = _purchasable.PurchaseCost.ToString(); _texts[k].text = text; obj.text = text; ((Graphic)_texts[k]).color = MonoBehaviourSingleton<GameReferences>.Instance.CanBuyColor; } } else { for (int l = 0; l < _texts.Count; l++) { Text obj2 = _texts[l]; string text = _purchasable.PurchaseCost.ToString(); _texts[l].text = text; obj2.text = text; ((Graphic)_texts[l]).color = MonoBehaviourSingleton<GameReferences>.Instance.CannotBuyColor; } } } private void OnDestroy() { GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(UpdateTexts)); GameManager.OnPowerEnabled = (Action)Delegate.Remove(GameManager.OnPowerEnabled, new Action(UpdateTexts)); } } } namespace CustomScripts.Gamemode.GMDebug { public class CheatItemSpawner : MonoBehaviour { private void Awake() { RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(TrySpawning)); } private void OnDrawGizmos() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0.4f, 0.4f, 0.9f, 0.5f); Gizmos.matrix = ((Component)this).transform.localToWorldMatrix; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0.7f, 0.25f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(2.3f, 1.2f, 0.5f); Vector3 forward = Vector3.forward; Gizmos.DrawCube(val, val2); Gizmos.DrawLine(val, val + forward * 0.5f); } public void TrySpawning() { if (GameSettings.ItemSpawnerEnabled) { ((MonoBehaviour)this).StartCoroutine(InitializeAsync()); } } private IEnumerator InitializeAsync() { yield return null; Scene sceneByName = SceneManager.GetSceneByName("ModBlank_Simple"); GameObject[] rootGameObjects = ((Scene)(ref sceneByName)).GetRootGameObjects(); GameObject itemSpawner = rootGameObjects.First((GameObject x) => ((Object)x).name == "ItemSpawner"); Object.Instantiate<GameObject>(itemSpawner, ((Component)this).transform.position, ((Component)this).transform.rotation).SetActive(true); Object.Destroy((Object)(object)this); } private void OnDestroy() { RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(TrySpawning)); } } } namespace CustomScripts { public static class Delegates { public delegate void VoidDelegate(); } public static class Extensions { public static void Shuffle<T>(this IList<T> list) { Random random = new Random(); int num = list.Count; while (num > 1) { num--; int index = random.Next(num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } } public interface IModifier { void ApplyModifier(); } public interface IPowerUp : IModifier { void Spawn(Vector3 pos); } public abstract class PowerUp : MonoBehaviour, IPowerUp, IModifier { public AudioClip ApplyAudio; public abstract void ApplyModifier(); public abstract void Spawn(Vector3 pos); } public interface IPurchasable { int PurchaseCost { get; } bool IsOneTimeOnly { get; } bool AlreadyBought { get; } } public interface IRequiresPower { bool IsPowered { get; } } public interface ITrap { void OnEnemyEntered(ZombieController controller); } public class MonoBehaviourSingleton<T> : MonoBehaviour where T : Component { public static T Instance { get; private set; } public virtual void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = (T)(object)((this is T) ? this : null); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class StartSpawner : MonoBehaviour { public ItemSpawner WeaponSpawner; public ItemSpawner AmmoSpawner; public void Spawn() { WeaponSpawner.SpawnItem(); AmmoSpawner.SpawnItem(); if (GameSettings.LimitedAmmo) { AmmoSpawner.SpawnItem(); AmmoSpawner.SpawnItem(); } } } } public class CustomDebug : GunGame.Scripts.MonoBehaviourSingleton<CustomDebug> { public Text DebugWeaponText; public Text DebugAmmoText; } namespace CustomScripts.Gamemode.GMDebug { public class CustomItemSpawner : MonoBehaviour { public string ObjectId; [HideInInspector] public GameObject SpawnedObject; private void OnDrawGizmos() { //IL_0015: 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_002f: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0f, 0f, 0.6f, 0.5f); Gizmos.matrix = ((Component)this).transform.localToWorldMatrix; Gizmos.DrawSphere(Vector3.zero, 0.1f); } public void Spawn() { //IL_0020: 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) FVRObject val = IM.OD[ObjectId]; GameObject gameObject = ((AnvilAsset)val).GetGameObject(); GameObject val2 = Object.Instantiate<GameObject>(gameObject, ((Component)this).transform.position, ((Component)this).transform.rotation); val2.SetActive(true); SpawnedObject = val2; } } } namespace GunGame.Scripts { public class CustomSosigSpawner : MonoBehaviour { public SosigEnemyID SosigType; public SosigOrder SpawnState; public int IFF; public Sosig Spawn() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0010: 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_004c: 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_0076: 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) SpawnOptions val = new SpawnOptions(); val.SpawnActivated = true; val.SpawnState = SpawnState; val.IFF = IFF; val.SpawnWithFullAmmo = true; val.EquipmentMode = (EquipmentSlots)7; val.SosigTargetPosition = ((Component)this).transform.position; val.SosigTargetRotation = ((Component)this).transform.eulerAngles; SpawnOptions val2 = val; SosigEnemyTemplate val3 = ManagerSingleton<IM>.Instance.odicSosigObjsByID[SosigType]; return SosigAPI.Spawn(val3, val2, ((Component)this).transform.position, ((Component)this).transform.rotation); } private void OnDrawGizmos() { //IL_0015: 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_003a: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = new Color(0.8f, 0.2f, 0.2f, 0.5f); Gizmos.DrawSphere(((Component)this).transform.position, 0.1f); Gizmos.DrawLine(((Component)this).transform.position, ((Component)this).transform.position + ((Component)this).transform.forward * 0.25f); } } } public class DisableOnAwake : MonoBehaviour { private void Awake() { ((Component)this).gameObject.SetActive(false); } } public class DoorBanging : MonoBehaviour { public AudioSource BangingSound; private float _timer; private bool _activated; private void Awake() { if (Random.Range(0, 20) != 0) { Object.Destroy((Object)(object)this); return; } RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(OnGameStart)); _timer = Time.time; } private void Update() { if (!_activated && _timer + 120f <= Time.time) { BangingSound.Play(); _activated = true; } } public void OnGameStart() { Object.Destroy((Object)(object)this); } private void OnDestroy() { RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(OnGameStart)); } } namespace GunGame.Scripts { public class EndArea : MonoBehaviour { public Text TimeText; public Text KillsText; public Text DeathsText; public Transform EndPos; public void EndGame() { //IL_000c: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) GM.CurrentMovementManager.TeleportToPoint(EndPos.position, true, ((Component)this).transform.position + ((Component)this).transform.forward); foreach (Transform playerSpawner in MonoBehaviourSingleton<GameManager>.Instance.PlayerSpawners) { ((Component)playerSpawner).transform.position = EndPos.position; } KillsText.text = "Kills: " + MonoBehaviourSingleton<GameManager>.Instance.Kills; DeathsText.text = "Deaths: " + MonoBehaviourSingleton<GameManager>.Instance.Deaths; TimeSpan timeSpan = TimeSpan.FromSeconds(MonoBehaviourSingleton<GameManager>.Instance.GameTime); TimeText.text = "Time: " + timeSpan.Hours.ToString("00") + ":" + timeSpan.Minutes.ToString("00") + ":" + timeSpan.Seconds.ToString("00"); } } } namespace CustomScripts.Gamemode.GMDebug { public class ErrorShower : MonoBehaviourSingleton<ErrorShower> { public Text ErrorText; public void Show(string message) { ErrorText.text = message; ((Component)ErrorText).gameObject.SetActive(true); } } } namespace GunGame.Scripts { public class GameManager : MonoBehaviourSingleton<GameManager> { [HideInInspector] public int Kills; [HideInInspector] public int Deaths; [HideInInspector] public bool GameEnded; public EndArea EndArea; public static Action BeforeGameStartedEvent; public static Action GameStartedEvent; public PlayerSpawner PlayerSpawner; public List<Transform> PlayerSpawners; private Progression _progression; private Harmony _harmony; private float _timer; public float GameTime => Time.time - _timer; public override void Awake() { base.Awake(); _progression = ((Component)this).GetComponent<Progression>(); _harmony = Harmony.CreateAndPatchAll(typeof(PlayerSpawner), (string)null); _harmony.PatchAll(typeof(SosigBehavior)); _harmony.PatchAll(typeof(Progression)); } public void StartGame() { GameEnded = false; if (BeforeGameStartedEvent != null) { BeforeGameStartedEvent(); } _progression.SpawnAndEquip(); PlayerSpawner.MovePlayerToRandomSpawn(); if (GameStartedEvent != null) { GameStartedEvent(); } _timer = Time.time; } public void RemovePausedTime(float timePaused) { _timer += timePaused; } public void EndGame() { EndArea.EndGame(); GameEnded = true; } public void DebugAdvanceWeapon() { _progression.Promote(); } public void DebugPreviousWeapon() { _progression.Demote(); } public void DebugTeleport() { PlayerSpawner.MovePlayerToRandomSpawn(); } public void DebugStart() { if (BeforeGameStartedEvent != null) { BeforeGameStartedEvent(); } _progression.SpawnAndEquip(); if (GameStartedEvent != null) { GameStartedEvent(); } _timer = Time.time; } private void OnDestroy() { _harmony.UnpatchSelf(); } } } namespace CustomScripts { public class EndPanel : MonoBehaviourSingleton<EndPanel> { public Text TotalPointsText; public Text BestPointsText; public Text KillsText; public Text DifficultyText; public Text EnemiesTypeText; public Text LimitedAmmoText; public Text SpecialRoundsText; public Text LessZombieHPText; public void UpdatePanel() { TotalPointsText.text = "Total Points:\n" + MonoBehaviourSingleton<GameManager>.Instance.TotalPoints; BestPointsText.text = "High Score:\n" + MonoBehaviourSingleton<SaveSystem>.Instance.GetHighscore(); KillsText.text = "Kills:\n" + MonoBehaviourSingleton<GameManager>.Instance.Kills; DifficultyText.text = ((!GameSettings.HardMode) ? "Normal" : "Hard"); EnemiesTypeText.text = ((!GameSettings.UseCustomEnemies) ? "Normal" : "Custom"); LimitedAmmoText.text = ((!GameSettings.LimitedAmmo) ? "No" : "Yes"); SpecialRoundsText.text = ((!GameSettings.SpecialRoundDisabled) ? "Yes" : "No"); LessZombieHPText.text = ((!GameSettings.WeakerEnemiesEnabled) ? "No" : "Yes"); } } } namespace CustomScripts.Gamemode.GMDebug { public class CustomDebug : MonoBehaviour { public Transform Point; public PowerUpCarpenter Carpenter; public PowerUpInstaKill InstaKill; public PowerUpDeathMachine DeathMachine; public PowerUpMaxAmmo MaxAmmo; public PowerUpDoublePoints DoublePoints; public PowerUpNuke Nuke; public Blockade TrapBlockade; public ElectroTrap ElectroTrap; public Teleport TeleportToSecondArea; public Teleport TeleportToMainArea; public DeadShotPerkBottle DeadShotPerkBottle; public LootPoolChoice newLootPool; private ZombieBodyPart part; public LootPoolChoice Choice1; public LootPoolChoice Choice2; private bool _forcingSpecialEnemy; private void Update() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown((KeyCode)97)) { MonoBehaviourSingleton<GameSettings>.Instance.EnableCustomEnemiesClicked(); MonoBehaviourSingleton<RoundManager>.Instance.StartGame(); } if (Input.GetKeyDown((KeyCode)98) && MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count > 0) { Damage val = new Damage(); val.Class = (DamageClass)1; val.Dam_Piercing += 1f; val.Dam_TotalKinetic = 60000f; val.hitNormal = Vector3.back; ((Component)MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[0]).GetComponentInChildren<ZombieBodyPart>().Damage(val); part = ((Component)MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[0]).GetComponentInChildren<ZombieBodyPart>(); } if (Input.GetKeyDown((KeyCode)99)) { Damage val2 = new Damage(); val2.Class = (DamageClass)1; val2.Dam_Piercing += 1f; val2.Dam_TotalKinetic = 60000f; val2.hitNormal = Vector3.back; part.Damage(val2); } if (Input.GetKeyDown((KeyCode)100)) { DeadShotPerkBottle.ApplyModifier(); } if (Input.GetKeyDown((KeyCode)101)) { ((MonoBehaviour)this).StartCoroutine(MonoBehaviourSingleton<PlayerData>.Instance.ActivateStun()); } if (Input.GetKeyDown((KeyCode)109)) { MonoBehaviourSingleton<GameManager>.Instance.AddPoints(300); } if (Input.GetKeyDown((KeyCode)107)) { TrapBlockade.Buy(); } if (Input.GetKeyDown((KeyCode)108)) { ElectroTrap.OnLeverPull(); } if (Input.GetKeyDown((KeyCode)47)) { MonoBehaviourSingleton<GameManager>.Instance.TurnOnPower(); } if (Input.GetKeyDown((KeyCode)105)) { TeleportToSecondArea.OnLeverPull(); } if (Input.GetKeyDown((KeyCode)111)) { TeleportToMainArea.OnLeverPull(); } if (Input.GetKeyDown((KeyCode)109)) { MonoBehaviourSingleton<GameSettings>.Instance.ToggleBackgroundMusic(); } if (Input.GetKeyDown((KeyCode)91)) { Choice1.ChangePoolToThis(); } if (Input.GetKeyDown((KeyCode)93)) { Choice2.ChangePoolToThis(); } } public void SpawnCarpenter() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) Carpenter.Spawn(Point.position); } public void SpawnInstaKill() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) InstaKill.Spawn(Point.position); } public void SpawnDeathMachine() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) DeathMachine.Spawn(Point.position); } public void SpawnMaxAmmo() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) MaxAmmo.Spawn(Point.position); } public void SpawnDoublePoints() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) DoublePoints.Spawn(Point.position); } public void SpawnNuke() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) Nuke.Spawn(Point.position); } public void KillRandom() { if (MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count > 0) { MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[0].OnHit(99999f); } } public void ToggleForceSpecialRound() { if (_forcingSpecialEnemy) { MonoBehaviourSingleton<RoundManager>.Instance.SpecialRoundInterval = 8; _forcingSpecialEnemy = false; } else { MonoBehaviourSingleton<RoundManager>.Instance.SpecialRoundInterval = 1; _forcingSpecialEnemy = true; } } } public class DebugDamagableShower : MonoBehaviour, IFVRDamageable { public Text Text; public Text LowestText; public Text HighestText; public float DamageSum; public float LowestDam; public float HighestDam; public void Damage(Damage dam) { DamageSum += dam.Dam_TotalKinetic; if (LowestDam < dam.Dam_TotalKinetic) { LowestDam = dam.Dam_TotalKinetic; } if (HighestDam > dam.Dam_TotalKinetic) { HighestDam = dam.Dam_TotalKinetic; } Text.text = "Kinetic: " + DamageSum; LowestText.text = "Lowest: " + LowestDam; HighestText.text = "Highest: " + HighestDam; } public void ResetData() { DamageSum = 0f; LowestDam = float.MaxValue; HighestDam = float.MinValue; Text.text = "Kinetic: " + 0; LowestText.text = "Lowest: " + 0; HighestText.text = "Highest: " + 0; } } public class MoveTest : MonoBehaviour { [FormerlySerializedAs("isMoving")] public bool IsMoving; public float Speed; private void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) if (IsMoving) { Transform transform = ((Component)this).transform; transform.position += Vector3.forward * (Speed * Time.deltaTime); Transform transform2 = ((Component)MonoBehaviourSingleton<GameReferences>.Instance.Player).transform; transform2.position += Vector3.forward * (Speed * Time.deltaTime); } } public void StartMoving() { IsMoving = true; } } } namespace CustomScripts { public class GameReferences : MonoBehaviourSingleton<GameReferences> { public Color CanBuyColor; public Color CannotBuyColor; [HideInInspector] public List<Window> Windows; [HideInInspector] public Transform Player; [SerializeField] private Transform DebugPlayer; [HideInInspector] public Transform PlayerHead; [SerializeField] private Transform DebugPlayerHead; public override void Awake() { base.Awake(); Player = DebugPlayer; PlayerHead = DebugPlayerHead; Windows = Object.FindObjectsOfType<Window>().ToList(); } private IEnumerator Start() { while ((Object)(object)GM.CurrentPlayerBody == (Object)null) { yield return null; } Player = ((Component)GM.CurrentPlayerBody).transform; PlayerHead = ((Component)GM.CurrentPlayerBody.Head).transform; } public bool IsPlayerClose(Transform pos, float dist) { //IL_0002: 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) return Vector3.Distance(pos.position, Player.position) <= dist; } } public class GameSettings : MonoBehaviourSingleton<GameSettings> { public static Action OnSettingsChanged; public static Action OnMusicSettingChanged; public LootPool DefaultLootPool; [HideInInspector] public LootPool CurrentLootPool; [HideInInspector] public List<LootPoolChoice> LootPoolChoices; public static bool HardMode; public static bool UseCustomEnemies; public static bool LimitedAmmo; public static bool SpecialRoundDisabled; public static bool ItemSpawnerEnabled; public static bool WeakerEnemiesEnabled; public static bool BackgroundMusic; public Text OptionDescriptionText; private void Start() { LootPoolChoices = Object.FindObjectsOfType<LootPoolChoice>().ToList(); if (LootPoolChoices.Count == 0) { Debug.LogError((object)"No LootPoolChoices in the scene, At least one component has to be present"); } if (Object.op_Implicit((Object)(object)DefaultLootPool)) { CurrentLootPool = DefaultLootPool; } else { CurrentLootPool = LootPoolChoices[0].LootPool; } if (Object.op_Implicit((Object)(object)CurrentLootPool)) { foreach (LootPoolChoice lootPoolChoice in LootPoolChoices) { if ((Object)(object)lootPoolChoice.LootPool == (Object)(object)CurrentLootPool) { lootPoolChoice.IsEnabled = true; } } } OptionDescriptionText.text = "Call of Duty\nZOMBIES"; if (Random.Range(0, 500) == 0) { switch (Random.Range(0, 7)) { case 0: OptionDescriptionText.text = "You are my sunshine,\nMy only sunshine"; break; case 1: OptionDescriptionText.text = "I missed you"; break; case 2: OptionDescriptionText.text = "Play with me"; break; case 3: OptionDescriptionText.text = "It's just a game, mostly"; break; case 4: OptionDescriptionText.text = "I have granted kids to hell"; break; case 5: OptionDescriptionText.text = "It's only partially your fault"; break; } } } public void RestoreDefaultSettings() { HardMode = false; LimitedAmmo = false; UseCustomEnemies = false; ItemSpawnerEnabled = false; SpecialRoundDisabled = false; WeakerEnemiesEnabled = false; OptionDescriptionText.text = "Default settings restored."; if (OnSettingsChanged != null) { OnSettingsChanged(); } } public void DifficultyNormalClicked() { HardMode = false; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Normal mode: Normal Enemy speed, HP and numbers."; } public void DifficultyHardClicked() { HardMode = true; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Hard mode: Increased Enemy speed, HP and numbers."; } public void EnableCustomEnemiesClicked() { UseCustomEnemies = true; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Custom humanoid enemies\n(Instead of Sosigs)."; } public void DisableCustomEnemiesClicked() { UseCustomEnemies = false; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Default Sosig zombies."; } public void EnableLimitedAmmoClicked() { LimitedAmmo = true; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Cannot use Spawnlock. Restore ammunition from Max Ammo power ups or buy it from a wall."; } public void DisableLimitedAmmoClicked() { LimitedAmmo = false; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Spawnlock enabled."; } public void EnableSpecialRoundClicked() { SpecialRoundDisabled = false; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Special round inspired by Hellhounds, occurs every 8 rounds."; } public void DisableSpecialRoundClicked() { SpecialRoundDisabled = true; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Special round disabled."; } public void EnableItemSpawnerClicked() { ItemSpawnerEnabled = true; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Item Spawner will appear at the starting location. Scoring will be disabled for that game."; } public void DisableItemSpawnerClicked() { ItemSpawnerEnabled = false; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "No Item Spawner. Scoring enabled"; } public void EnableWeakerEnemiesClicked() { WeakerEnemiesEnabled = true; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Enemies have reduced HP"; } public void DisableWeakerEnemiesClicked() { WeakerEnemiesEnabled = false; if (OnSettingsChanged != null) { OnSettingsChanged(); } OptionDescriptionText.text = "Enemies have normal HP"; } public void ToggleBackgroundMusic() { BackgroundMusic = !BackgroundMusic; if (OnMusicSettingChanged != null) { OnMusicSettingChanged(); } if (OnSettingsChanged != null) { OnSettingsChanged(); } } public void ChangeLootPool(LootPoolChoice newLootPool) { foreach (LootPoolChoice lootPoolChoice in LootPoolChoices) { lootPoolChoice.IsEnabled = false; } newLootPool.IsEnabled = true; CurrentLootPool = newLootPool.LootPool; if (OnSettingsChanged != null) { OnSettingsChanged(); } } } public class GameSettingsPanel : MonoBehaviour { public Text BackgroundMusic; public Text DifficultyNormalText; public Text DifficultyHardText; public Text CustomEnemiesEnabledText; public Text CustomEnemiesDisabledText; public Text LimitedAmmoEnabledText; public Text LimitedAmmoDisabledText; public Text SpecialRoundEnabledText; public Text SpecialRoundDisabledText; public Text ItemSpawnerEnabledText; public Text ItemSpawnerDisabledText; public Text WeakerZombiesEnabledText; public Text WeakerZombiesDisabledText; public Color EnabledColor; public Color DisabledColor; private void Awake() { GameSettings.OnSettingsChanged = (Action)Delegate.Combine(GameSettings.OnSettingsChanged, new Action(UpdateText)); } private void Start() { UpdateText(); } private void OnDestroy() { GameSettings.OnSettingsChanged = (Action)Delegate.Remove(GameSettings.OnSettingsChanged, new Action(UpdateText)); } private void UpdateText() { //IL_0041: 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_0067: 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_008d: 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_00b3: 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_00d9: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0171: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_021e: Unknown result type (might be due to invalid IL or missing references) BackgroundMusic.text = ((!GameSettings.BackgroundMusic) ? "Disabled" : "Enabled"); ((Graphic)DifficultyNormalText).color = ((!GameSettings.HardMode) ? EnabledColor : DisabledColor); ((Graphic)DifficultyHardText).color = ((!GameSettings.HardMode) ? DisabledColor : EnabledColor); ((Graphic)CustomEnemiesEnabledText).color = ((!GameSettings.UseCustomEnemies) ? DisabledColor : EnabledColor); ((Graphic)CustomEnemiesDisabledText).color = ((!GameSettings.UseCustomEnemies) ? EnabledColor : DisabledColor); ((Graphic)LimitedAmmoEnabledText).color = ((!GameSettings.LimitedAmmo) ? DisabledColor : EnabledColor); ((Graphic)LimitedAmmoDisabledText).color = ((!GameSettings.LimitedAmmo) ? EnabledColor : DisabledColor); ((Graphic)SpecialRoundEnabledText).color = ((!GameSettings.SpecialRoundDisabled) ? EnabledColor : DisabledColor); ((Graphic)SpecialRoundDisabledText).color = ((!GameSettings.SpecialRoundDisabled) ? DisabledColor : EnabledColor); ((Graphic)ItemSpawnerEnabledText).color = ((!GameSettings.ItemSpawnerEnabled) ? DisabledColor : EnabledColor); ((Graphic)ItemSpawnerDisabledText).color = ((!GameSettings.ItemSpawnerEnabled) ? EnabledColor : DisabledColor); ((Graphic)WeakerZombiesEnabledText).color = ((!GameSettings.WeakerEnemiesEnabled) ? DisabledColor : EnabledColor); ((Graphic)WeakerZombiesDisabledText).color = ((!GameSettings.WeakerEnemiesEnabled) ? EnabledColor : DisabledColor); foreach (LootPoolChoice lootPoolChoice in MonoBehaviourSingleton<GameSettings>.Instance.LootPoolChoices) { ((Graphic)lootPoolChoice.LootChoiceText).color = ((!lootPoolChoice.IsEnabled) ? DisabledColor : EnabledColor); } } } public class GameStart : MonoBehaviourSingleton<GameStart> { private 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.red; Gizmos.DrawSphere(((Component)this).transform.position, 0.5f); } } public class HighscoreShower : MonoBehaviour { public Text HighscoreText; private void Start() { HighscoreText.text = "Highscore:\n" + MonoBehaviourSingleton<SaveSystem>.Instance.GetHighscore(); } } public class LeverWrapper : MonoBehaviour { public UnityEvent LeverToggleEvent; public UnityEvent LeverOnEvent; public UnityEvent LeverOffEvent; public UnityEvent LeverHoldStartEvent; public UnityEvent LeverHoldEndEvent; private TrapLever _lever; private bool _isOn; private bool _isHeld; private void Awake() { _lever = ((Component)this).GetComponentInChildren<TrapLever>(); _lever.MessageTargets.Add(((Component)this).gameObject); } private void Update() { if (!_isHeld && ((FVRInteractiveObject)_lever).IsHeld) { OnHoldStart(); } else if (_isHeld && !((FVRInteractiveObject)_lever).IsHeld) { OnHoldEnd(); } } private void OnHoldStart() { _isHeld = true; if (LeverHoldStartEvent != null) { LeverHoldStartEvent.Invoke(); } } private void OnHoldEnd() { _isHeld = false; if (LeverHoldEndEvent != null) { LeverHoldEndEvent.Invoke(); } } public void ON() { if (!_isOn) { _isOn = true; if (LeverToggleEvent != null) { LeverToggleEvent.Invoke(); } if (LeverOnEvent != null) { LeverOnEvent.Invoke(); } } } public void OFF() { if (_isOn) { _isOn = false; if (LeverToggleEvent != null) { LeverToggleEvent.Invoke(); } if (LeverOffEvent != null) { LeverOffEvent.Invoke(); } } } } } namespace CustomScripts.Gamemode { public class PointsView : MonoBehaviour { public Text PointsText; private void Awake() { GameManager.OnPointsChanged = (Action)Delegate.Combine(GameManager.OnPointsChanged, new Action(OnPointsChanged)); } private void OnDestroy() { GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(OnPointsChanged)); } private void OnPointsChanged() { PointsText.text = "Points:\n" + MonoBehaviourSingleton<GameManager>.Instance.Points; } } } public class GunsLeftUI : MonoBehaviour { private Text _gunsLeftText; private void Awake() { _gunsLeftText = ((Component)this).GetComponent<Text>(); Progression.WeaponChangedEvent = (Action)Delegate.Combine(Progression.WeaponChangedEvent, new Action(UpdateUI)); } private void UpdateUI() { int num = Mathf.Min(GunGame.Scripts.Options.GameSettings.CurrentPool.Guns.Count, WeaponCountOption.WeaponCount); int num2 = GunGame.Scripts.MonoBehaviourSingleton<Progression>.Instance.CurrentWeaponId + 1; int num3 = num - num2; _gunsLeftText.text = "Guns left: " + num3; } private void OnDestroy() { Progression.WeaponChangedEvent = (Action)Delegate.Remove(Progression.WeaponChangedEvent, new Action(UpdateUI)); } } public class Location : MonoBehaviour { public List<Transform> ZombieSpawnPoints; public List<Transform> SpecialZombieSpawnPoints; private void Start() { if (ZombieSpawnPoints.Count == 0) { Debug.LogError((object)"ZombieSpawnPoints is empty, zombies don't have a place to spawn"); } if (SpecialZombieSpawnPoints.Count == 0) { Debug.LogError((object)"SpecialZombieSpawnPoints is empty, special zombies don't have a place to spawn"); } } } [CreateAssetMenu] public class LootPool : ScriptableObject { public string LootPoolTitle; [Header("Elements in the list corresponds to the ID of the Wallshops.")] public List<WeaponData> WallShopsPool; public List<WeaponData> MysteryBoxPool; public List<WeaponData> LimitedAmmoMysteryBoxPool; public HashSet<WeaponData> PackAPunchPool => GetPackAPunchPool(); public HashSet<WeaponData> GetPackAPunchPool() { HashSet<WeaponData> hashSet = new HashSet<WeaponData>(); foreach (WeaponData item in WallShopsPool) { hashSet.Add(item); } foreach (WeaponData item2 in MysteryBoxPool) { hashSet.Add(item2); } foreach (WeaponData item3 in LimitedAmmoMysteryBoxPool) { hashSet.Add(item3); } return hashSet; } } public class LootPoolChoice : MonoBehaviour { public LootPool LootPool; public Text LootChoiceText; [HideInInspector] public bool IsEnabled; private void Awake() { LootChoiceText.text = LootPool.LootPoolTitle; } public void ChangePoolToThis() { CustomScripts.MonoBehaviourSingleton<CustomScripts.GameSettings>.Instance.ChangeLootPool(this); IsEnabled = true; } } namespace CustomScripts.Gamemode { public class MagazineWrapper : MonoBehaviour { private FVRFireArmMagazine _magazine; private FVRFireArmClip _clip; private Speedloader _speedloader; public FireArmRoundClass RoundClass; public void Initialize(FVRFireArmMagazine magazine) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) _magazine = magazine; RoundClass = magazine.DefaultLoadingPattern.Classes[0]; } public void InitialzieWithAmmo(FVRFireArmMagazine magazine, FireArmRoundClass roundClass) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) _magazine = magazine; RoundClass = roundClass; } public void InitialzieWithAmmo(FVRFireArmClip clip, FireArmRoundClass roundClass) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) _clip = clip; RoundClass = roundClass; } public void InitialzieWithAmmo(Speedloader speedloader, FireArmRoundClass roundClass) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) _speedloader = speedloader; RoundClass = roundClass; } } } namespace CustomScripts { public class GameManager : MonoBehaviourSingleton<GameManager> { public static Action OnPointsChanged; public static Action OnPowerEnabled; [HideInInspector] public int Points; [HideInInspector] public int TotalPoints; [HideInInspector] public bool GameStarted = false; [HideInInspector] public bool GameEnded = false; public Transform StartGameWaypoint; public WallShop FirstShop; public bool PowerEnabled; [HideInInspector] public int Kills; private Harmony _harmony; public override void Awake() { base.Awake(); _harmony = Harmony.CreateAndPatchAll(typeof(PlayerData), (string)null); _harmony.PatchAll(typeof(PlayerSpawner)); _harmony.PatchAll(typeof(ZombieManager)); } public void TurnOnPower() { if (!PowerEnabled) { PowerEnabled = true; MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.PowerOnSound, 0.8f); if (OnPowerEnabled != null) { OnPowerEnabled(); } } } public void AddPoints(int amount) { float num = (float)amount * MonoBehaviourSingleton<PlayerData>.Instance.MoneyModifier; MonoBehaviourSingleton<PlayerData>.Instance.MoneyModifier.ToString(); amount = (int)num; Points += amount; TotalPoints += amount; if (OnPointsChanged != null) { OnPointsChanged(); } } public bool TryRemovePoints(int amount) { if (Points >= amount) { Points -= amount; if (OnPointsChanged != null) { OnPointsChanged(); } return true; } return false; } public void KillPlayer() { if (!GameEnded) { GM.CurrentPlayerBody.KillPlayer(false); } } public void EndGame() { if (!GameEnded) { GameEnded = true; MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(MonoBehaviourSingleton<AudioManager>.Instance.EndMusic, 0.25f, 1f); MonoBehaviourSingleton<EndPanel>.Instance.UpdatePanel(); if (!GameSettings.ItemSpawnerEnabled) { MonoBehaviourSingleton<SaveSystem>.Instance.SaveHighscore(TotalPoints); } } } private void OnDestroy() { _harmony.UnpatchSelf(); } } public class PowerUpManager : MonoBehaviourSingleton<PowerUpManager> { public float ChanceForAmmo = 2.5f; public float ChanceForPowerUp = 6f; public float AmmoCooldownTime; public float PowerUpCooldownTime; public PowerUpMaxAmmo MaxAmmo; public List<PowerUp> PowerUps; private readonly List<int> _randomIndexes = new List<int>(); private bool _isPowerUpCooldown; private bool _isMaxAmmoCooldown; public override void Awake() { base.Awake(); RoundManager.OnZombieKilled = (Action<GameObject>)Delegate.Remove(RoundManager.OnZombieKilled, new Action<GameObject>(RollForPowerUp)); RoundManager.OnZombieKilled = (Action<GameObject>)Delegate.Combine(RoundManager.OnZombieKilled, new Action<GameObject>(RollForPowerUp)); ShuffleIndexes(); } private void OnDestroy() { RoundManager.OnZombieKilled = (Action<GameObject>)Delegate.Remove(RoundManager.OnZombieKilled, new Action<GameObject>(RollForPowerUp)); } public void RollForPowerUp(GameObject spawnPos) { //IL_004e: 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) float num = Random.Range(0f, 100f); if (GameSettings.LimitedAmmo && !_isMaxAmmoCooldown && num < ChanceForAmmo) { ((MonoBehaviour)this).StartCoroutine(PowerUpMaxAmmoCooldown()); SpawnPowerUp(MaxAmmo, spawnPos.transform.position); } else { if (_isPowerUpCooldown) { return; } num = Random.Range(0f, 100f); if (num < ChanceForPowerUp) { if (_randomIndexes.Count == 0) { ShuffleIndexes(); } ((MonoBehaviour)this).StartCoroutine(PowerUpMaxAmmoCooldown()); SpawnPowerUp(PowerUps[_randomIndexes[0]], spawnPos.transform.position); _randomIndexes.RemoveAt(0); } } } private void ShuffleIndexes() { _randomIndexes.Clear(); for (int i = 0; i < PowerUps.Count; i++) { _randomIndexes.Add(i); } _randomIndexes.Shuffle(); } public void SpawnPowerUp(PowerUp powerUp, Vector3 pos) { //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) if ((Object)(object)powerUp == (Object)null) { Debug.LogWarning((object)"PowerUp spawn failed! PowerUp == null"); return; } ((MonoBehaviour)this).StartCoroutine(PowerUpCooldown()); powerUp.Spawn(pos + Vector3.up); } private IEnumerator PowerUpCooldown() { _isPowerUpCooldown = true; yield return (object)new WaitForSeconds(PowerUpCooldownTime); _isPowerUpCooldown = false; } private IEnumerator PowerUpMaxAmmoCooldown() { _isMaxAmmoCooldown = true; yield return (object)new WaitForSeconds(AmmoCooldownTime); _isMaxAmmoCooldown = false; } } public class RoundManager : MonoBehaviourSingleton<RoundManager> { public static Action RoundStarted; public static Action RoundEnded; public static Action OnRoundChanged; public static Action OnZombiesLeftChanged; public static Action<GameObject> OnZombieKilled; public static Action OnGameStarted; public int ZombieFastWalkRound = 2; public int ZombieRunRound = 6; public int HardModeFastWalkRound = 0; public int HardModeRunRound = 3; public int SpecialRoundInterval; [HideInInspector] public int RoundNumber = 0; private Coroutine _roundDelayCoroutine; public bool IsRoundSpecial { get { if (GameSettings.SpecialRoundDisabled) { return false; } return RoundNumber % SpecialRoundInterval == 0; } } public bool IsFastWalking { get { if (GameSettings.HardMode) { return RoundNumber >= HardModeFastWalkRound; } return RoundNumber >= ZombieFastWalkRound; } } public bool IsRunning { get { if (GameSettings.HardMode) { return RoundNumber >= HardModeRunRound; } return RoundNumber >= ZombieRunRound; } } public void StartGame() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!Application.isEditor) { GM.CurrentMovementManager.TeleportToPoint(MonoBehaviourSingleton<GameManager>.Instance.StartGameWaypoint.position, true); GM.CurrentSceneSettings.IsSpawnLockingEnabled = !GameSettings.LimitedAmmo; } MonoBehaviourSingleton<GameManager>.Instance.GameStarted = true; RoundNumber = 0; AdvanceRound(); if (OnGameStarted != null) { OnGameStarted(); } if (Object.op_Implicit((Object)(object)MonoBehaviourSingleton<GameManager>.Instance.FirstShop)) { MonoBehaviourSingleton<GameManager>.Instance.FirstShop.IsFree = true; MonoBehaviourSingleton<GameManager>.Instance.FirstShop.TryBuying(); } } public void AdvanceRound() { if (!MonoBehaviourSingleton<GameManager>.Instance.GameEnded) { RoundNumber++; MonoBehaviourSingleton<ZombieManager>.Instance.BeginSpawningEnemies(); if (OnZombiesLeftChanged != null) { OnZombiesLeftChanged(); } if (OnRoundChanged != null) { OnRoundChanged(); } } } public void EndRound() { MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.RoundEndSound, 0.2f, 1f); if (RoundEnded != null) { RoundEnded(); } if (GameSettings.LimitedAmmo) { _roundDelayCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedAdvanceRound(20f)); } else { _roundDelayCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedAdvanceRound(17f)); } } private IEnumerator DelayedAdvanceRound(float delay) { yield return (object)new WaitForSeconds(delay); AdvanceRound(); if (RoundStarted != null) { RoundStarted(); } } public void PauseGame() { ((MonoBehaviour)this).StopCoroutine(_roundDelayCoroutine); } public void ResumeGame() { _roundDelayCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedAdvanceRound(0f)); } } public class AudioManager : MonoBehaviourSingleton<AudioManager> { public List<AudioClip> FarZombieSounds; public List<AudioClip> CloseZombieSounds; public List<AudioClip> HellHoundsSounds; public AudioSource MainAudioSource; public AudioSource MusicAudioSource; [Space(20f)] public AudioClip Music; public AudioClip BuySound; public AudioClip DrinkSound; public AudioClip ZombieHitSound; public AudioClip ZombieDeathSound; public AudioClip HellHoundSpawnSound; public AudioClip HellHoundDeathSound; public AudioClip RoundStartSound; public AudioClip RoundEndSound; public AudioClip HellHoundRoundStartSound; public AudioClip PowerOnSound; public AudioClip EndMusic; public AudioClip TeleportingSound; public AudioClip PlayerHitSound; public AudioClip BarricadeRepairSound; private Coroutine _musicRepetition; public override void Awake() { base.Awake(); GameSettings.OnMusicSettingChanged = (Action)Delegate.Combine(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingChanged)); } private void OnMusicSettingChanged() { if (GameSettings.BackgroundMusic) { PlayMusic(Music, 0.08f, 0f, repeat: true); } else { MusicAudioSource.Stop(); } } public void Play(AudioClip audioClip, float volume = 1f, float delay = 0f) { if (delay != 0f) { ((MonoBehaviour)this).StartCoroutine(PlayDelayed(audioClip, volume, delay)); } else { MainAudioSource.PlayOneShot(audioClip, volume); } } private IEnumerator PlayDelayed(AudioClip audioClip, float volume, float delay) { yield return (object)new WaitForSeconds(delay); MainAudioSource.PlayOneShot(audioClip, volume); } public void PlayMusic(AudioClip audioClip, float volume = 1f, float delay = 0f, bool repeat = false) { if (_musicRepetition != null) { ((MonoBehaviour)this).StopCoroutine(_musicRepetition); _musicRepetition = null; } MusicAudioSource.clip = audioClip; MusicAudioSource.volume = volume; MusicAudioSource.PlayDelayed(delay); if (repeat) { _musicRepetition = ((MonoBehaviour)this).StartCoroutine(RepeatMusic(audioClip.length, volume)); } } private IEnumerator RepeatMusic(float endTimer, float volume) { yield return (object)new WaitForSeconds(endTimer); if (GameSettings.BackgroundMusic) { PlayMusic(Music, 0.08f, 0f, repeat: true); } } private void OnDestroy() { GameSettings.OnMusicSettingChanged = (Action)Delegate.Remove(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingChanged)); } } } namespace CustomScripts.Managers.Sound { public class MusicManager : MonoBehaviourSingleton<MusicManager> { } } namespace CustomScripts { public class SoundPool : MonoBehaviour { public List<SoundPoolableObject> PooledAudioSources; public static SoundPool Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } } public SoundPoolableObject Spawn() { if (PooledAudioSources.Count <= 0) { return null; } SoundPoolableObject result = PooledAudioSources[0]; PooledAudioSources.RemoveAt(0); return result; } public void Despawn(SoundPoolableObject soundPoolable) { PooledAudioSources.Add(soundPoolable); } } public class SoundPoolableObject : MonoBehaviour { public AudioSource AudioSource; public float DespawnTime = 4f; public void Initialize() { AudioSource.Play(); ((MonoBehaviour)this).StartCoroutine(DespawnDelay()); } private IEnumerator DespawnDelay() { yield return (object)new WaitForSeconds(DespawnTime); SoundPool.Instance.Despawn(this); } } } namespace CustomScripts.Managers { public class ZombieManager : MonoBehaviourSingleton<ZombieManager> { public static Action LocationChangedEvent; public Location CurrentLocation; public ZombiePool NormalZombiePool; public ZombiePool SpecialZombiePool; public AnimationCurve ZombieCountCurve; public AnimationCurve CustomZombieHPCurve; public AnimationCurve ZosigHPCurve; public AnimationCurve ZosigLinkIntegrityCurve; public AnimationCurve ZosigPerRoundSpeed; public int CustomZombieDamage = 2000; public int PointsOnHit = 10; public int PointsOnKill = 100; public List<ZombieController> AllCustomZombies; [HideInInspector] public List<ZombieController> ExistingZombies; private Transform _zombieTarget; public ParticleSystem HellhoundExplosionPS; public int ZombieAtOnceLimit = 20; [HideInInspector] public int ZombiesRemaining; private Coroutine _spawningCoroutine; private int ZombiesToSpawnThisRound { get { if (GameSettings.HardMode) { return Mathf.CeilToInt(ZombieCountCurve.Evaluate((float)MonoBehaviourSingleton<RoundManager>.Instance.RoundNumber) + 1f); } return Mathf.CeilToInt(ZombieCountCurve.Evaluate((float)MonoBehaviourSingleton<RoundManager>.Instance.RoundNumber)); } } public void BeginSpawningEnemies() { ZombiesRemaining = ZombiesToSpawnThisRound; if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { StartSpawningZombies(6f); MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.HellHoundRoundStartSound, 0.35f); } else { StartSpawningZombies(2f); MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.RoundStartSound, 0.2f, 1f); } } public void StartSpawningZombies(float initialDelay) { _spawningCoroutine = ((MonoBehaviour)this).StartCoroutine(DelayedZombieSpawn(initialDelay)); } public void OnZombieSpawned(ZombieController controller) { ((MonoBehaviour)this).StartCoroutine(DelayedCustomZombieSpawn(controller)); } private IEnumerator DelayedZombieSpawn(float delay) { yield return (object)new WaitForSeconds(delay); while (ZombiesRemaining > ExistingZombies.Count) { if (ExistingZombies.Count >= ZombieAtOnceLimit) { yield return (object)new WaitForSeconds(5f); continue; } _zombieTarget = MonoBehaviourSingleton<GameReferences>.Instance.Player; if (!GameSettings.UseCustomEnemies) { SpawnZosig(); } else if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { SpecialZombiePool.Spawn(); } else { NormalZombiePool.Spawn(); } yield return (object)new WaitForSeconds(2f); } } private IEnumerator DelayedCustomZombieSpawn(ZombieController controller) { yield return null; Transform spawnPoint2 = null; spawnPoint2 = ((!MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) ? CurrentLocation.ZombieSpawnPoints[Random.Range(0, CurrentLocation.ZombieSpawnPoints.Count)] : ((Component)CurrentLocation.SpecialZombieSpawnPoints[Random.Range(0, CurrentLocation.SpecialZombieSpawnPoints.Count)]).transform); if ((Object)(object)((Component)spawnPoint2).GetComponent<ZombieSpawner>() != (Object)null) { Window windowWaypoint = ((Component)spawnPoint2).GetComponent<ZombieSpawner>().WindowWaypoint; if ((Object)(object)windowWaypoint != (Object)null) { _zombieTarget = windowWaypoint.ZombieWaypoint; } } ExistingZombies.Add(controller); if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { ((Component)spawnPoint2).GetComponent<CustomSosigSpawnPoint>().SpawnPS.Play(true); if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.HellHoundSpawnSound, 0.4f, 0.25f); } yield return (object)new WaitForSeconds(2f); } if (ExistingZombies.Contains(controller)) { ((Component)controller).transform.position = spawnPoint2.position; controller.Initialize(_zombieTarget); if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { controller.InitializeSpecialType(); } } } public void SpawnZosig() { if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { CustomSosigSpawnPoint component = ((Component)CurrentLocation.SpecialZombieSpawnPoints[Random.Range(0, CurrentLocation.SpecialZombieSpawnPoints.Count)]).GetComponent<CustomSosigSpawnPoint>(); component.Spawn(); return; } CustomSosigSpawnPoint component2 = ((Component)CurrentLocation.ZombieSpawnPoints[Random.Range(0, CurrentLocation.ZombieSpawnPoints.Count)]).GetComponent<CustomSosigSpawnPoint>(); Window windowWaypoint = ((Component)component2).GetComponent<ZombieSpawner>().WindowWaypoint; if ((Object)(object)windowWaypoint != (Object)null) { _zombieTarget = windowWaypoint.ZombieWaypoint; } component2.Spawn(); } public void OnZosigSpawned(Sosig zosig) { ZombieController zombieController = ((Component)zosig).gameObject.AddComponent<ZosigZombieController>(); zombieController.Initialize(_zombieTarget); ExistingZombies.Add(zombieController); if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { zombieController.InitializeSpecialType(); } } public void ChangeLocation(Location newLocation) { if (_spawningCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_spawningCoroutine); } CurrentLocation = newLocation; for (int num = ExistingZombies.Count - 1; num >= 0; num--) { ExistingZombies[num].OnKill(awardPoints: false); } StartSpawningZombies(5f); if (LocationChangedEvent != null) { LocationChangedEvent(); } } public void OnZombieDied(ZombieController controller, bool awardKill = true) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) MonoBehaviourSingleton<GameManager>.Instance.Kills++; if (GameSettings.UseCustomEnemies) { ((MonoBehaviour)this).StartCoroutine(DelayedCustomZombieDespawn(((Component)controller).GetComponent<CustomZombieController>())); } ExistingZombies.Remove(controller); if (!awardKill) { return; } ZombiesRemaining--; if (ZombiesRemaining <= 0) { if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial && GameSettings.LimitedAmmo) { MonoBehaviourSingleton<PowerUpManager>.Instance.SpawnPowerUp(MonoBehaviourSingleton<PowerUpManager>.Instance.MaxAmmo, ((Component)controller).transform.position); } MonoBehaviourSingleton<RoundManager>.Instance.EndRound(); } if (RoundManager.OnZombiesLeftChanged != null) { RoundManager.OnZombiesLeftChanged(); } if (RoundManager.OnZombieKilled != null) { RoundManager.OnZombieKilled(((Component)controller).gameObject); } } private IEnumerator DelayedCustomZombieDespawn(CustomZombieController controller) { if (MonoBehaviourSingleton<RoundManager>.Instance.IsRoundSpecial) { yield return (object)new WaitForSeconds(0f); SpecialZombiePool.Despawn(controller); } else { yield return (object)new WaitForSeconds(5f); NormalZombiePool.Despawn(controller); } } [HarmonyPatch(typeof(Sosig), "SosigDies")] [HarmonyPostfix] private static void OnSosigDied(Sosig __instance, DamageClass damClass, SosigDeathType deathType) { ((Component)__instance).GetComponent<ZosigZombieController>().OnKill(); } [HarmonyPatch(typeof(Sosig), "ProcessDamage", new Type[] { typeof(Damage), typeof(SosigLink) })] [HarmonyPrefix] private static void BeforeZombieHit(Damage d, SosigLink link) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)d.Class == 3 && d.Source_IFF != GM.CurrentSceneSettings.DefaultPlayerIFF) { d.Dam_Blinding = 0f; d.Dam_TotalKinetic = 0f; d.Dam_TotalEnergetic = 0f; d.Dam_Blunt = 0f; d.Dam_Chilling = 0f; d.Dam_Cutting = 0f; d.Dam_Thermal = 0f; d.Dam_EMP = 0f; d.Dam_Piercing = 0f; d.Dam_Stunning = 0f; } } [HarmonyPatch(typeof(Sosig), "ProcessDamage", new Type[] { typeof(Damage), typeof(SosigLink) })] [HarmonyPostfix] private static void AfterZombieHit(Sosig __instance, Damage d, SosigLink link) { ((Component)__instance).GetComponent<ZosigZombieController>().OnHit(d); } } } namespace GunGame.Scripts { public class MonoBehaviourSingleton<T> : MonoBehaviour where T : Component { public static T Instance { get; private set; } public virtual void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = (T)(object)((this is T) ? this : null); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } namespace CustomScripts { public class Blockade : MonoBehaviour, IPurchasable { public Action OnPurchase; public List<Transform> UnlockableZombieSpawnPoints; public List<Transform> UnlockableSpecialZombieSpawnPoints; public List<Text> CostTexts; public int Cost; [SerializeField] private bool _isOneTimeOnly = true; private bool _alreadyBought; private bool _alreadyUsed; public int PurchaseCost => Cost; public bool IsOneTimeOnly => _isOneTimeOnly; public bool AlreadyBought => _alreadyBought; private void OnValidate() { foreach (Text costText in CostTexts) { costText.text = Cost.ToString(); } } public void Buy() { if (_alreadyUsed || !MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost)) { return; } _alreadyUsed = true; foreach (Transform unlockableZombieSpawnPoint in UnlockableZombieSpawnPoints) { if (!MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.ZombieSpawnPoints.Contains(unlockableZombieSpawnPoint)) { MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.ZombieSpawnPoints.Add(unlockableZombieSpawnPoint); } } foreach (Transform unlockableSpecialZombieSpawnPoint in UnlockableSpecialZombieSpawnPoints) { if (!MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.SpecialZombieSpawnPoints.Contains(unlockableSpecialZombieSpawnPoint)) { MonoBehaviourSingleton<ZombieManager>.Instance.CurrentLocation.SpecialZombieSpawnPoints.Add(unlockableSpecialZombieSpawnPoint); } } MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BuySound, 0.5f); ((Component)this).gameObject.SetActive(false); if (OnPurchase != null) { OnPurchase(); } } } public class MysteryBox : MonoBehaviour, IPurchasable { public static Action<WeaponData> WeaponSpawnedEvent; public int Cost = 950; [SerializeField] private bool _isOneTimeOnly; private bool _alreadyBought; [HideInInspector] public List<WeaponData> LootId; [HideInInspector] public List<WeaponData> LimitedAmmoLootId; public ObjectSpawnPoint WeaponSpawner; public ObjectSpawnPoint AmmoSpawner; public AudioClip RollSound; [HideInInspector] public bool InUse = false; private MysteryBoxMover _mysteryBoxMover; public int PurchaseCost => Cost; public bool IsOneTimeOnly => _isOneTimeOnly; public bool AlreadyBought => _alreadyBought; private void Awake() { _mysteryBoxMover = ((Component)this).GetComponent<MysteryBoxMover>(); RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(LoadWeaponPool)); } private void LoadWeaponPool() { LootId = MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.MysteryBoxPool; LimitedAmmoLootId = MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.LimitedAmmoMysteryBoxPool; } public void SpawnWeapon() { if (!InUse && MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost)) { InUse = true; MonoBehaviourSingleton<AudioManager>.Instance.Play(RollSound, 0.25f); ((MonoBehaviour)this).StartCoroutine(DelayedSpawn()); } } private IEnumerator DelayedSpawn() { yield return (object)new WaitForSeconds(5.5f); if (_mysteryBoxMover.TryTeleport()) { _mysteryBoxMover.StartTeleportAnim(); MonoBehaviourSingleton<GameManager>.Instance.AddPoints(Cost); yield break; } if (GameSettings.LimitedAmmo) { int index = Random.Range(0, LimitedAmmoLootId.Count); WeaponData weaponData = LimitedAmmoLootId[index]; WeaponSpawner.ObjectId = weaponData.DefaultSpawners[0]; WeaponSpawner.Spawn(); AmmoSpawner.ObjectId = weaponData.DefaultSpawners[1]; for (int i = 0; i < weaponData.LimitedAmmoMagazineCount; i++) { AmmoSpawner.Spawn(); } if (WeaponSpawnedEvent != null) { WeaponSpawnedEvent(weaponData); } } else { int index2 = Random.Range(0, LootId.Count); WeaponData weaponData2 = LootId[index2]; WeaponSpawner.ObjectId = weaponData2.DefaultSpawners[0]; AmmoSpawner.ObjectId = weaponData2.DefaultSpawners[1]; WeaponSpawner.Spawn(); AmmoSpawner.Spawn(); if (WeaponSpawnedEvent != null) { WeaponSpawnedEvent(weaponData2); } } InUse = false; _mysteryBoxMover.CurrentRoll++; } private void OnDestroy() { RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(LoadWeaponPool)); } } public class MysteryBoxMover : MonoBehaviour { public List<Transform> SpawnPoints; [Range(0f, 100f)] public float TeleportChance = 20f; public int SafeRollsProvided = 3; public AudioClip TeddyBearSound; public AudioClip SecretTeddyBearSound; public Transform TeddyBear; [HideInInspector] public Transform CurrentPos; [HideInInspector] public int CurrentRoll = 0; private Animator _animator; private MysteryBox _mysteryBox; private Transform _parent; private void Awake() { _parent = ((Component)this).transform.parent; _animator = ((Component)_parent).GetComponent<Animator>(); _mysteryBox = ((Component)this).GetComponent<MysteryBox>(); } private void Start() { Teleport(firstTime: true); } public void Teleport(bool firstTime = false) { //IL_0057: 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) Transform val = SpawnPoints[Random.Range(0, SpawnPoints.Count)]; if (!firstTime) { SpawnPoints.Add(CurrentPos); } CurrentPos = val; SpawnPoints.Remove(val); ((Component)_parent).transform.position = val.position; ((Component)_parent).transform.rotation = val.rotation; CurrentRoll = 0; _mysteryBox.InUse = false; } public bool TryTeleport() { if (CurrentRoll <= SafeRollsProvided) { return false; } return (float)Random.Range(0, 100) <= TeleportChance; } private void Update() { if (Input.GetKeyDown((KeyCode)104)) { StartTeleportAnim(); } } public void StartTeleportAnim() { GameObject gameObject; if (Random.Range(0, 5801) == 0) { gameObject = ((Component)TeddyBear.GetChild(1)).gameObject; MonoBehaviourSingleton<AudioManager>.Instance.Play(SecretTeddyBearSound); } else { gameObject = ((Component)TeddyBear.GetChild(0)).gameObject; MonoBehaviourSingleton<AudioManager>.Instance.Play(TeddyBearSound); } ((Component)TeddyBear).GetComponent<Animator>().Play("Activation"); gameObject.SetActive(true); ((MonoBehaviour)this).StartCoroutine(DelayedAnimation(gameObject)); } private IEnumerator DelayedAnimation(GameObject teddy) { yield return (object)new WaitForSeconds(3f); teddy.SetActive(false); yield return (object)new WaitForSeconds(1.2f); _animator.Play("Teleport"); ((MonoBehaviour)this).StartCoroutine(DelayedTeleport()); } private IEnumerator DelayedTeleport() { yield return (object)new WaitForSeconds(4.2f); Teleport(); } } public class QuestionMarkBlinking : MonoBehaviour { public Renderer QuestionMark1; public Renderer QuestionMark2; private float _emissionValue; private int _emissionWeight; private bool _emit; private float _time; private void Awake() { _emissionWeight = Shader.PropertyToID("_EmissionWeight"); } private void Update() { if (_emit) { if (_time >= 1.5f) { _emit = false; ((MonoBehaviour)this).StartCoroutine(SmoothEmissionChange(0f, 1f, 1f)); _time = 0f; } } else if (_time >= 3f) { _emit = true; ((MonoBehaviour)this).StartCoroutine(SmoothEmissionChange(1f, 0f, 1f)); _time = 0f; } _time += Time.deltaTime; } private IEnumerator SmoothEmissionChange(float startValue, float endValue, float duration) { float elapsed = 0f; while (elapsed < duration) { _emissionValue = Mathf.Lerp(startValue, endValue, elapsed / duration); elapsed += Time.deltaTime; QuestionMark1.sharedMaterial.SetFloat(_emissionWeight, _emissionValue); QuestionMark2.sharedMaterial.SetFloat(_emissionWeight, _emissionValue); yield return null; } _emissionValue = endValue; QuestionMark1.sharedMaterial.SetFloat(_emissionWeight, _emissionValue); QuestionMark2.sharedMaterial.SetFloat(_emissionWeight, _emissionValue); } } } namespace CustomScripts.Objects { public class Radio : MonoBehaviour, IFVRDamageable { public AudioClip Song; private bool _isThrottled; private bool _isPlaying; private Coroutine _musicEndCoroutine; private void Awake() { GameSettings.OnMusicSettingChanged = (Action)Delegate.Combine(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingsChanged)); } private void OnMusicSettingsChanged() { _isPlaying = false; if (_musicEndCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_musicEndCoroutine); } } private void Update() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown if (Input.GetKeyDown((KeyCode)99)) { Damage dam = new Damage(); Damage(dam); } if (Input.GetKeyDown((KeyCode)118)) { MonoBehaviourSingleton<GameSettings>.Instance.ToggleBackgroundMusic(); } } public void Damage(Damage dam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)dam.Class == 2 || _isThrottled) { return; } if (_isPlaying) { _isPlaying = false; MonoBehaviourSingleton<AudioManager>.Instance.MusicAudioSource.Stop(); if (GameSettings.BackgroundMusic) { MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(MonoBehaviourSingleton<AudioManager>.Instance.Music, 0.08f); } if (_musicEndCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_musicEndCoroutine); } } else { _isPlaying = true; float length = Song.length; _musicEndCoroutine = ((MonoBehaviour)this).StartCoroutine(OnMusicEnd(length)); MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(Song, 0.095f); } ((MonoBehaviour)this).StartCoroutine(Throttle()); } private IEnumerator Throttle() { _isThrottled = true; yield return (object)new WaitForSeconds(0.5f); _isThrottled = false; } private IEnumerator OnMusicEnd(float endTimer) { yield return (object)new WaitForSeconds(endTimer); _isPlaying = false; if (GameSettings.BackgroundMusic) { MonoBehaviourSingleton<AudioManager>.Instance.PlayMusic(MonoBehaviourSingleton<AudioManager>.Instance.Music, 0.08f); } } private void OnDestroy() { GameSettings.OnMusicSettingChanged = (Action)Delegate.Remove(GameSettings.OnMusicSettingChanged, new Action(OnMusicSettingsChanged)); } } } namespace CustomScripts { public class StatPanel : MonoBehaviour { public Text RoundText; public Text PointsText; public Text LeftText; private void Start() { GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(UpdatePointsText)); GameManager.OnPointsChanged = (Action)Delegate.Combine(GameManager.OnPointsChanged, new Action(UpdatePointsText)); RoundManager.OnRoundChanged = (Action)Delegate.Remove(RoundManager.OnRoundChanged, new Action(UpdateRoundText)); RoundManager.OnRoundChanged = (Action)Delegate.Combine(RoundManager.OnRoundChanged, new Action(UpdateRoundText)); RoundManager.OnZombiesLeftChanged = (Action)Delegate.Remove(RoundManager.OnZombiesLeftChanged, new Action(UpdateLeftText)); RoundManager.OnZombiesLeftChanged = (Action)Delegate.Combine(RoundManager.OnZombiesLeftChanged, new Action(UpdateLeftText)); UpdateRoundText(); UpdatePointsText(); } private void OnDestroy() { GameManager.OnPointsChanged = (Action)Delegate.Remove(GameManager.OnPointsChanged, new Action(UpdatePointsText)); RoundManager.OnRoundChanged = (Action)Delegate.Remove(RoundManager.OnRoundChanged, new Action(UpdateRoundText)); RoundManager.OnZombiesLeftChanged = (Action)Delegate.Remove(RoundManager.OnZombiesLeftChanged, new Action(UpdateLeftText)); } private void UpdateRoundText() { RoundText.text = "Round:\n" + MonoBehaviourSingleton<RoundManager>.Instance.RoundNumber; } private void UpdatePointsText() { PointsText.text = "Points:\n" + MonoBehaviourSingleton<GameManager>.Instance.Points; } private void UpdateLeftText() { LeftText.text = "Left:\n" + MonoBehaviourSingleton<ZombieManager>.Instance.ZombiesRemaining; } } } namespace CustomScripts.Objects { public class WallShop : MonoBehaviour, IPurchasable { [Header("LootPool asset defines which weapon can be purchased")] public int ID; private const int AMMO_SPAWNER_ID = 1; public bool ExistsInLimitedAmmo = true; public bool ExistsInSpawnlock = true; [HideInInspector] public int Cost; [SerializeField] private bool _isOneTimeOnly; private bool _alreadyBought; public Text NameText; public Text CostText; public List<ObjectSpawnPoint> ItemSpawners; [HideInInspector] public WeaponData Weapon; public bool SameRebuy = false; [HideInInspector] public bool IsFree; public int PurchaseCost => Cost; public bool IsOneTimeOnly => _isOneTimeOnly; public bool AlreadyBought => _alreadyBought; private void Awake() { RoundManager.OnGameStarted = (Action)Delegate.Combine(RoundManager.OnGameStarted, new Action(OnRoundStarted)); } private void OnDestroy() { RoundManager.OnGameStarted = (Action)Delegate.Remove(RoundManager.OnGameStarted, new Action(OnRoundStarted)); } private void LoadWeapon() { if (ID >= MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.WallShopsPool.Count) { ((Component)this).gameObject.SetActive(false); return; } Weapon = MonoBehaviourSingleton<GameSettings>.Instance.CurrentLootPool.WallShopsPool[ID]; Cost = Weapon.Price; NameText.text = Weapon.DisplayName; CostText.text = Cost.ToString(); } private void OnRoundStarted() { if (GameSettings.LimitedAmmo && !ExistsInLimitedAmmo) { ((Component)this).gameObject.SetActive(false); } if (!GameSettings.LimitedAmmo && !ExistsInSpawnlock) { ((Component)this).gameObject.SetActive(false); } LoadWeapon(); } public void TryBuying() { if (!IsFree && !MonoBehaviourSingleton<GameManager>.Instance.TryRemovePoints(Cost)) { return; } IsFree = false; if (GameSettings.LimitedAmmo && !SameRebuy) { if (!_alreadyBought) { for (int i = 0; i < Weapon.DefaultSpawners.Count; i++) { if (i != 1) { ItemSpawners[i].ObjectId = Weapon.DefaultSpawners[i]; ItemSpawners[i].Spawn(); } } } if (SameRebuy) { for (int j = 0; j < Weapon.DefaultSpawners.Count; j++) { ItemSpawners[j].ObjectId = Weapon.DefaultSpawners[j]; ItemSpawners[j].Spawn(); } } else { ItemSpawners[1].ObjectId = Weapon.DefaultSpawners[1]; ((MonoBehaviour)this).StartCoroutine(DelayedAmmoSpawn()); } Cost = Weapon.AmmoBuyCost; CostText.text = Weapon.AmmoBuyCost.ToString(); } else { for (int k = 0; k < Weapon.DefaultSpawners.Count; k++) { ItemSpawners[k].ObjectId = Weapon.DefaultSpawners[k]; ItemSpawners[k].Spawn(); } } if (!_alreadyBought) { _alreadyBought = true; } MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BuySound, 0.5f); } private IEnumerator DelayedAmmoSpawn() { for (int i = 0; i < Weapon.LimitedAmmoMagazineCount; i++) { ItemSpawners[1].Spawn(); yield return (object)new WaitForSeconds(0.15f); } } } } namespace CustomScripts.Objects.Weapons { [CreateAssetMenu(fileName = "WeaponData")] public class WeaponData : ScriptableObject { [Tooltip("Used by WallShop")] public string DisplayName; [Tooltip("No real use in the code btw")] public string Description; [Tooltip("First is always weapon, second is always ammo (if exists)")] public List<string> DefaultSpawners; [Tooltip("Result of pack a punching")] public WeaponData UpgradedWeapon; [Tooltip("How many magazines spawn in the limited ammo mode")] public int LimitedAmmoMagazineCount = 0; [Tooltip("How much does the weapon cost in the Wallshop")] public int Price; [Tooltip("How much does ammo cost in the limited ammo mode (Wall rebuy)")] public int AmmoBuyCost = 0; public string Id => DefaultSpawners[0]; } } namespace CustomScripts { public class DropPlankZone : MonoBehaviour { private void OnTriggerExit(Collider other) { Plank component = ((Component)other).GetComponent<Plank>(); if (Object.op_Implicit((Object)(object)component)) { ((FVRInteractiveObject)component.PhysicalObject).ForceBreakInteraction(); component.ReturnToRest(); } } } public class Plank : MonoBehaviour { [HideInInspector] public FVRPhysicalObject PhysicalObject; public Transform RestTransform; private void Awake() { PhysicalObject = ((Component)this).GetComponent<FVRPhysicalObject>(); } public void ReturnToRest() { ((MonoBehaviour)this).StartCoroutine(MoveTo(RestTransform, 0.5f)); } public void OnRepairDrop(Transform destination) { ((MonoBehaviour)this).StartCoroutine(MoveTo(destination, 0.2f)); MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BarricadeRepairSound, 0.5f); } public IEnumerator MoveTo(Transform destination, float time) { Vector3 startingPos = ((Component)this).transform.position; Vector3 finalPos = destination.position; Quaternion startingRot = ((Component)this).transform.rotation; Quaternion finalRot = destination.rotation; float elapsedTime = 0f; while (elapsedTime < time) { ((Component)this).transform.position = Vector3.Lerp(startingPos, finalPos, elapsedTime / time); ((Component)this).transform.rotation = Quaternion.Lerp(startingRot, finalRot, elapsedTime / time); elapsedTime += Time.deltaTime; yield return null; } ((Component)this).transform.position = finalPos; ((Component)this).transform.rotation = finalRot; } } public class Window : MonoBehaviour { public static Action BarricadedEvent; public Transform ZombieWaypoint; public List<WindowPlank> PlankSlots; public List<Plank> AllPlanks; private AudioSource _tearPlankAudio; public int PlanksRemain { get; set; } public bool IsOpen => PlanksRemain == 0; private void Start() { _tearPlankAudio = ((Component)this).GetComponent<AudioSource>(); RepairAll(); } private void OnTriggerEnter(Collider other) { if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<Plank>())) { OnPlankTouch(((Component)other).GetComponent<Plank>()); } } public void RepairAll(bool playSound = false) { //IL_0048: 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) for (int i = 0; i < PlankSlots.Count; i++) { PlankSlots[i].Plank = AllPlanks[i]; ((Component)AllPlanks[i]).transform.position = ((Component)PlankSlots[i]).transform.position; ((Component)AllPlanks[i]).transform.rotation = ((Component)PlankSlots[i]).transform.rotation; ((FVRInteractiveObject)AllPlanks[i].PhysicalObject).ForceBreakInteraction(); AllPlanks[i].PhysicalObject.IsPickUpLocked = true; } PlanksRemain = PlankSlots.Count; if (playSound) { MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.BarricadeRepairSound, 0.5f); } } public void OnPlankTouch(Plank plank) { if (BarricadedEvent != null && MonoBehaviourSingleton<GameManager>.Instance.GameStarted) { BarricadedEvent(); } if (MonoBehaviourSingleton<PlayerData>.Instance.SpeedColaPerkActivated) { RepairAll(playSound: true); return; } WindowPlank windowPlank = PlankSlots.FirstOrDefault((WindowPlank x) => (Object)(object)x.Plank == (Object)null); if (!Object.op_Implicit((Object)(object)windowPlank)) { RepairAll(); return; } windowPlank.Plank = plank; ((FVRInteractiveObject)plank.PhysicalObject).ForceBreakInteraction(); plank.PhysicalObject.IsPickUpLocked = true; plank.OnRepairDrop(((Component)windowPlank).transform); PlanksRemain++; } public void OnPlankRipped() { WindowPlank windowPlank = PlankSlots.LastOrDefault((WindowPlank x) => (Object)(object)x.Plank != (Object)null); if (Object.op_Implicit((Object)(object)windowPlank)) { Plank plank = windowPlank.Plank; plank.ReturnToRest(); FVRPhysicalObject component = ((Component)plank).GetComponent<FVRPhysicalObject>(); component.IsPickUpLocked = false; windowPlank.Plank = null; _tearPlankAudio.Play(); PlanksRemain--; } } } } namespace CustomScripts.Objects.Windows { public class WindowPlank : MonoBehaviour { public Plank Plank; } } namespace CustomScripts { public class WindowTrigger : MonoBehaviour { public Window Window; } } namespace GunGame.Scripts.Options { public class GameSettings : MonoBehaviourSingleton<GameSettings> { public static Action SettingsChanged; public static Action WeaponPoolChanged; public static bool DisabledAutoLoading; public static bool AlwaysChamberRounds; public static bool HealOnPromotion; [SerializeField] private Image DisabledAutoLoadingImage; [SerializeField] private Image AlwaysChamberRoundsImage; [SerializeField] private Image HealOnPromotionImage; [SerializeField] private Text MaxSosigCountText; public static int MaxSosigCount; public static WeaponPool CurrentPool { get; private set; } private void Start() { DisabledAutoLoading = false; AlwaysChamberRounds = false; HealOnPromotion = false; ResetMaxSosigCount(); } public void IncreaseMaxSosigCount() { MaxSosigCount++; MaxSosigCountText.text = MaxSosigCount.ToString(); if (SettingsChanged != null) { SettingsChanged(); } } public void DecreaseMaxSosigCount() { MaxSosigCount--; if (MaxSosigCount < 1) { MaxSosigCount = 1; } MaxSosigCountText.text = MaxSosigCount.ToString(); if (SettingsChanged != null) { SettingsChanged(); } } public void ResetMaxSosigCount() { MaxSosigCount = MonoBehaviourSingleton<SosigBehavior>.Instance.MaxSosigCount; MaxSosigCountText.text = MaxSosigCount.ToString(); if (SettingsChanged != null) { SettingsChanged(); } } public void ToggleAutoLoading() { DisabledAutoLoading = !DisabledAutoLoading; ((Behaviour)DisabledAutoLoadingImage).enabled = DisabledAutoLoading; if (SettingsChanged != null) { SettingsChanged(); } } public void ToggleAlwaysChamberRounds() { AlwaysChamberRounds = !AlwaysChamberRounds; ((Behaviour)AlwaysChamberRoundsImage).enabled = AlwaysChamberRounds; if (SettingsChanged != null) { SettingsChanged(); } } public void ToggleHealOnPromotion() { HealOnPromotion = !HealOnPromotion; ((Behaviour)HealOnPromotionImage).enabled = HealOnPromotion; if (SettingsChanged != null) { SettingsChanged(); } } public static void ChangeCurrentPool(WeaponPool newPool) { CurrentPool = newPool; CurrentPool.Initialize(); if (WeaponPoolChanged != null) { WeaponPoolChanged(); } if (SettingsChanged != null) { SettingsChanged(); } } } public class KillsPerWeaponOption : MonoBehaviour { public Action OptionChanged; public int DefaultCount; public static int KillsPerWeaponCount; [SerializeField] private Text _counterText; private void Awake() { OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI)); } private void Start() { ResetClicked(); } public void ArrowLeftClicked() { KillsPerWeaponCount--; if (KillsPerWeaponCount <= 1) { KillsPerWeaponCount = 1; } if (OptionChanged != null) { OptionChanged(); } } public void ArrowRightClicked() { KillsPerWeaponCount++; if (OptionChanged != null) { OptionChanged(); } } public void ResetClicked() { KillsPerWeaponCount = DefaultCount; if (OptionChanged != null) { OptionChanged(); } } private void UpdateUI() { _counterText.text = KillsPerWeaponCount.ToString(); } private void OnDestroy() { OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI)); } } public class LeftHandOption : MonoBehaviour { public Action OptionChanged; public static bool LeftHandModeEnabled; [SerializeField] private Image EnabledImage; private void Awake() { OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI)); LeftHandModeEnabled = false; ((Behaviour)EnabledImage).enabled = false; } public void ToggleClicked() { LeftHandModeEnabled = !LeftHandModeEnabled; if (OptionChanged != null) { OptionChanged(); } } private void UpdateUI() { ((Behaviour)EnabledImage).enabled = LeftHandModeEnabled; } private void OnDestroy() { OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI)); } } public class MusicToggleOption : MonoBehaviour { public Action OptionChanged; public static bool MusicEnabled; public AudioSource MusicAudioSource; public bool MusicEnabledAtStart = false; [SerializeField] private Image EnabledImage; private void Awake() { OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(OnToggleMusic)); MusicEnabled = MusicEnabledAtStart; ((Behaviour)EnabledImage).enabled = MusicEnabled; OnToggleMusic(); } public void ToggleClicked() { MusicEnabled = !MusicEnabled; if (OptionChanged != null) { OptionChanged(); } } private void OnToggleMusic() { if (MusicEnabled) { MusicAudioSource.Play(); } else { MusicAudioSource.Stop(); } ((Behaviour)EnabledImage).enabled = MusicEnabled; } private void OnDestroy() { OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(OnToggleMusic)); } } public class QuickbeltOption : MonoBehaviour { public static FVRQuickBeltSlot AmmoQuickbeltSlot; private FVRPhysicalObject MagObject; public Transform MagSpawnPos; private string _magName = "MagazineStanag5rnd"; private void Awake() { GameManager.BeforeGameStartedEvent = (Action)Delegate.Combine(GameManager.BeforeGameStartedEvent, new Action(OnGameStart)); } private IEnumerator Start() { yield return (object)new WaitForSeconds(0.2f); AmmoQuickbeltSlot = GM.CurrentPlayerBody.QBSlots_Internal[0]; SpawnMag(); } private void OnGameStart() { if (Object.op_Implicit((Object)(object)MagObject.QuickbeltSlot)) { AmmoQuickbeltSlot = MagObject.QuickbeltSlot; } } private void SpawnMag() { //IL_0048: 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) FVRObject value = null; if (!IM.OD.TryGetValue(_magName, out value)) { Debug.LogError((object)("No object found with id: " + _magName)); return; } GameObject gameObject = ((AnvilAsset)value).GetGameObject(); GameObject val = Object.Instantiate<GameObject>(gameObject, ((Component)MagSpawnPos).transform.position, ((Component)this).transform.rotation); val.SetActive(true); MagObject = val.GetComponent<FVRPhysicalObject>(); } private void OnDestroy() { GameManager.BeforeGameStartedEvent = (Action)Delegate.Remove(GameManager.BeforeGameStartedEvent, new Action(OnGameStart)); } } public class SelectedPoolUI : MonoBehaviour { public Text TitleText; public Text DescriptionText; private void Awake() { GameSettings.SettingsChanged = (Action)Delegate.Combine(GameSettings.SettingsChanged, new Action(OnSettingsChanged)); } private void OnSettingsChanged() { TitleText.text = GameSettings.CurrentPool.Name; DescriptionText.text = GameSettings.CurrentPool.Description; } private void OnDestroy() { GameSettings.SettingsChanged = (Action)Delegate.Remove(GameSettings.SettingsChanged, new Action(OnSettingsChanged)); } } public class StartingHealthOption : MonoBehaviour { public Action OptionChanged; public int[] PossibleHealth; private int _optionIndex = 1; public static int CurrentHealth = 1000; [SerializeField] private Text _healthText; private void Awake() { PossibleHealth = new int[5] { 100, 1000, 2000, 5000, 10000 }; OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI)); OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateHealth)); } private IEnumerator Start() { yield return (object)new WaitForSeconds(0.1f); ResetClicked(); } public void ArrowLeftClicked() { _optionIndex--; if (_optionIndex < 0) { _optionIndex = 0; } CurrentHealth = PossibleHealth[_optionIndex]; if (OptionChanged != null) { OptionChanged(); } } public void ArrowRightClicked() { _optionIndex++; if (_optionIndex >= PossibleHealth.Length) { _optionIndex = PossibleHealth.Length - 1; } CurrentHealth = PossibleHealth[_optionIndex]; if (OptionChanged != null) { OptionChanged(); } } public void ResetClicked() { _optionIndex = 1; CurrentHealth = PossibleHealth[_optionIndex]; if (OptionChanged != null) { OptionChanged(); } } private void UpdateHealth() { GM.CurrentPlayerBody.SetHealthThreshold((float)CurrentHealth); GM.CurrentPlayerBody.ResetHealth(); } private void UpdateUI() { _healthText.text = CurrentHealth.ToString(); } private void OnDestroy() { OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI)); OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateHealth)); } } public class WeaponCountOption : MonoBehaviour { public Action OptionChanged; public static int WeaponCount; [SerializeField] private Text _counterText; private void Awake() { OptionChanged = (Action)Delegate.Combine(OptionChanged, new Action(UpdateUI)); GameSettings.WeaponPoolChanged = (Action)Delegate.Combine(GameSettings.WeaponPoolChanged, new Action(ResetClicked)); } public void ArrowLeftClicked() { WeaponCount--; if (WeaponCount <= 1) { WeaponCount = 1; } if (OptionChanged != null) { OptionChanged(); } } public void ArrowRightClicked() { WeaponCount++; if (WeaponCount > GameSettings.CurrentPool.Guns.Count) { WeaponCount = GameSettings.CurrentPool.Guns.Count; } if (OptionChanged != null) { OptionChanged(); } } public void ArrowRight10Clicked() { WeaponCount += 20; if (WeaponCount > GameSettings.CurrentPool.Guns.Count) { WeaponCount = GameSettings.CurrentPool.Guns.Count; } if (OptionChanged != null) { OptionChanged(); } } public void ArrowLeft10Clicked() { WeaponCount -= 20; if (WeaponCount <= 1) { WeaponCount = 1; } if (OptionChanged != null) { OptionChanged(); } } public void ResetClicked() { WeaponCount = GameSettings.CurrentPool.Guns.Count; if (OptionChanged != null) { OptionChanged(); } } private void UpdateUI() { _counterText.text = WeaponCount.ToString(); } private void OnDestroy() { OptionChanged = (Action)Delegate.Remove(OptionChanged, new Action(UpdateUI)); GameSettings.WeaponPoolChanged = (Action)Delegate.Remove(GameSettings.WeaponPoolChanged, new Action(ResetClicked)); } } } public class Pause : MonoBehaviour { [SerializeField] private Transform PauseWaypoint; [SerializeField] private Transform UnPauseWaypoint; [SerializeField] private Text TimeText; [SerializeField] private Text KillsText; [SerializeField] private Text DeathsText; private float _pauseTimer; public void PauseTheGame() { //IL_000c: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) GM.CurrentMovementManager.TeleportToPoint(PauseWaypoint.position, true, ((Component)this).transform.position + ((Component)this).transform.forward); KillsText.text = "Kills: " + GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.Kills; DeathsText.text = "Deaths: " + GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.Deaths; TimeSpan timeSpan = TimeSpan.FromSeconds(GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.GameTime); TimeText.text = "Time: " + timeSpan.Hours.ToString("00") + ":" + timeSpan.Minutes.ToString("00") + ":" + timeSpan.Seconds.ToString("00"); _pauseTimer = Time.time; } public void UnpauseTheGame() { //IL_000c: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) GM.CurrentMovementManager.TeleportToPoint(UnPauseWaypoint.position, true, ((Component)this).transform.position + ((Component)this).transform.forward); float timePaused = Time.time - _pauseTimer; GunGame.Scripts.MonoBehaviourSingleton<GunGame.Scripts.GameManager>.Instance.RemovePausedTime(timePaused); } } namespace CustomScripts { public class DeadShotPerkBottle : MonoBehaviour, IModifier { public void ApplyModifier() { MonoBehaviourSingleton<PlayerData>.Instance.DeadShotPerkActivated = true; if (!GameSettings.UseCustomEnemies) { for (int i = 0; i < MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count; i++) { (MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[i] as ZosigZombieController).CheckPerks(); } } else { for (int j = 0; j < MonoBehaviourSingleton<ZombieManager>.Instance.AllCustomZombies.Count; j++) { CapsuleCollider component = (MonoBehaviourSingleton<ZombieManager>.Instance.AllCustomZombies[j] as CustomZombieController).HeadObject.GetComponent<CapsuleCollider>(); component.radius *= 1.375f; } } MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound); Object.Destroy((Object)(object)((Component)this).gameObject); } } public class DoubleTapPerkBottle : MonoBehaviour, IModifier { public float DamageMultiplier = 1.5f; public void ApplyModifier() { MonoBehaviourSingleton<PlayerData>.Instance.DoubleTapPerkActivated = true; if (!GameSettings.UseCustomEnemies) { for (int i = 0; i < MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies.Count; i++) { (MonoBehaviourSingleton<ZombieManager>.Instance.ExistingZombies[i] as ZosigZombieController).CheckPerks(); } } FVRInteractiveObject currentInteractable = MonoBehaviourSingleton<PlayerData>.Instance.LeftHand.CurrentInteractable; FVRFireArm val = (FVRFireArm)(object)((currentInteractable is FVRFireArm) ? currentInteractable : null); if ((Object)(object)val != (Object)null) { ((Component)val).GetComponent<WeaponWrapper>().OnWeaponGrabbed(); } FVRInteractiveObject currentInteractable2 = MonoBehaviourSingleton<PlayerData>.Instance.RightHand.CurrentInteractable; val = (FVRFireArm)(object)((currentInteractable2 is FVRFireArm) ? currentInteractable2 : null); if ((Object)(object)val != (Object)null) { ((Component)val).GetComponent<WeaponWrapper>().OnWeaponGrabbed(); } MonoBehaviourSingleton<PlayerData>.Instance.DamageModifier *= DamageMultiplier; MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound); Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class ElectricCherryPerkBottle : MonoBehaviour, IModifier { public void ApplyModifier() { CustomScripts.MonoBehaviourSingleton<PlayerData>.Instance.ElectricCherryPerkActivated = true; CustomScripts.MonoBehaviourSingleton<AudioManager>.Instance.Play(CustomScripts.MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound); Object.Destroy((Object)(object)((Component)this).gameObject); } } namespace CustomScripts { public class JuggerNogPerkBottle : MonoBehaviour, IModifier { public static Action ConsumedEvent; public float NewHealth = 10000f; public void ApplyModifier() { GM.CurrentPlayerBody.SetHealthThreshold(NewHealth); GM.CurrentPlayerBody.ResetHealth(); if (ConsumedEvent != null) { ConsumedEvent(); } MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound); Object.Destroy((Object)(object)((Component)this).gameObject); } } } namespace CustomScripts.Powerups.Perks { public class MuleKickPerkBottle : MonoBehaviour, IModifier { public ObjectSpawnPoint Spawner; public string ObjectID; public GameObject Model; public void ApplyModifier() { Spawner.ObjectId = ObjectID; Spawner.Spawn(); ((Component)this).GetComponent<FVRPhysicalObject>().IsPickUpLocked = true; ((FVRInteractiveObject)((Component)this).GetComponent<FVRPhysicalObject>()).ForceBreakInteraction(); ((Component)this).GetComponent<Collider>().enabled = false; Model.SetActive(false); MonoBehaviourSingleton<AudioManager>.Instance.Play(MonoBehaviourSingleton<AudioManager>.Instance.DrinkSound); Object.Destroy((Object)(object)((Component)this).gameObject, 1f); } } public class PHDFlopperPerkBottle : MonoBehaviour, IModifier { public void ApplyModifier() { MonoBehaviourSingleton<PlayerData>.Inst