Decompiled source of LethalMin v0.2.9
NoteBoxz.LethalMin.dll
Decompiled 6 hours 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.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CleaningCompany; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalLib.Extras; using LethalLib.Modules; using LethalMin; using LethalMin.Library; using LethalMin.Patches; using LethalMinLibrary; using LethalModDataLib.Base; using LethalMon; using LethalMon.Behaviours; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using NoteBoxz.LethalMin.NetcodePatcher; using TMPro; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: AssemblyCompany("NoteBoxz.LethalMin")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.2.9.0")] [assembly: AssemblyInformationalVersion("0.2.9+1c4319e8224ef712cd284872511a328aacee0170")] [assembly: AssemblyProduct("LethalMin")] [assembly: AssemblyTitle("NoteBoxz.LethalMin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.9.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class InputClassWithUtils : LcInputActions { [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Throw { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Whistle { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Dismiss { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SwitchLeft { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SwitchRight { get; set; } } public class LethalMinSaveDataWithLib : ModDataContainer { public List<int> OnionsCollected { get; set; } public Dictionary<int, int[]> OnionsFused { get; set; } public List<OnionPikminStorage> PikminStored { get; set; } public int PikminLeftLastRound { get; set; } protected override void PostLoad() { ((ModDataContainer)this).PostLoad(); if (OnionsCollected == null) { global::LethalMin.LethalMin.Logger.LogInfo((object)"OnionsCollected is null, creating new list"); OnionsCollected = new List<int>(); } if (OnionsFused == null) { global::LethalMin.LethalMin.Logger.LogInfo((object)"OnionsFused is null, creating new dictionary"); OnionsFused = new Dictionary<int, int[]>(); } if (PikminStored == null) { global::LethalMin.LethalMin.Logger.LogInfo((object)"PikminStored is null, creating new list"); PikminStored = new List<OnionPikminStorage>(); } } protected override void PostSave() { ((ModDataContainer)this).PostSave(); global::LethalMin.LethalMin.Logger.LogInfo((object)$"collected onions: {OnionsCollected.Count}"); global::LethalMin.LethalMin.Logger.LogInfo((object)$"fused onions: {OnionsFused.Count}"); global::LethalMin.LethalMin.Logger.LogInfo((object)$"stored onions: {PikminStored.Count}"); } } [RequireComponent(typeof(MeshFilter))] [RequireComponent(typeof(MeshRenderer))] public class MeshGroundWrapper : MonoBehaviour { public enum UpdateMode { Manual, Update, LateUpdate, FixedUpdate } [Header("Wrapping Settings")] [Tooltip("Layer mask for ground detection")] public LayerMask groundLayer = LayerMask.op_Implicit(1375734017); [Tooltip("Maximum distance to check for ground")] public float maxGroundDistance = 100f; [Tooltip("Offset from the ground")] public float heightOffset = 0.2f; [Header("Performance Settings")] [Tooltip("Update method for the mesh wrapping")] public UpdateMode updateMode = UpdateMode.LateUpdate; [Tooltip("Number of vertices to process per frame")] [Range(1f, 100f)] public int verticesPerFrame = 50; [Tooltip("Only update vertices if they've moved more than this distance")] public float updateThreshold = 0.01f; private MeshFilter meshFilter; private Vector3[] originalVertices; private Vector3[] wrappedVertices; private Vector3[] lastWorldPositions; private Mesh deformedMesh; private int currentVertexIndex; private Vector3 lastPosition; private Quaternion lastRotation; private bool needsFullUpdate; private void Start() { Initialize(); needsFullUpdate = true; } private void Initialize() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //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_012f: 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_0160: 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) if ((Object)(object)meshFilter == (Object)null) { meshFilter = ((Component)this).GetComponent<MeshFilter>(); Mesh sharedMesh = meshFilter.sharedMesh; deformedMesh = new Mesh(); ((Object)deformedMesh).name = "Wrapped " + ((Object)sharedMesh).name; deformedMesh.vertices = sharedMesh.vertices; deformedMesh.triangles = sharedMesh.triangles; deformedMesh.uv = sharedMesh.uv; deformedMesh.normals = sharedMesh.normals; deformedMesh.tangents = sharedMesh.tangents; meshFilter.mesh = deformedMesh; originalVertices = sharedMesh.vertices; wrappedVertices = (Vector3[])(object)new Vector3[originalVertices.Length]; lastWorldPositions = (Vector3[])(object)new Vector3[originalVertices.Length]; Array.Copy(originalVertices, wrappedVertices, originalVertices.Length); for (int i = 0; i < originalVertices.Length; i++) { lastWorldPositions[i] = ((Component)this).transform.TransformPoint(originalVertices[i]); } lastPosition = ((Component)this).transform.position; lastRotation = ((Component)this).transform.rotation; } } private void Update() { if (updateMode == UpdateMode.Update) { UpdateWrapper(); } } private void LateUpdate() { if (updateMode == UpdateMode.LateUpdate) { UpdateWrapper(); } } private void FixedUpdate() { if (updateMode == UpdateMode.FixedUpdate) { UpdateWrapper(); } } private void UpdateWrapper() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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) if ((Object)(object)meshFilter == (Object)null) { return; } if (Vector3.Distance(lastPosition, ((Component)this).transform.position) > updateThreshold || Quaternion.Angle(lastRotation, ((Component)this).transform.rotation) > updateThreshold) { needsFullUpdate = true; } int i; for (i = 0; i < verticesPerFrame; i++) { if (!needsFullUpdate && currentVertexIndex >= originalVertices.Length) { break; } if (currentVertexIndex >= originalVertices.Length) { if (!needsFullUpdate) { break; } currentVertexIndex = 0; needsFullUpdate = false; } ProcessVertex(currentVertexIndex); currentVertexIndex++; } if (i > 0) { deformedMesh.vertices = wrappedVertices; deformedMesh.RecalculateNormals(); deformedMesh.RecalculateBounds(); } lastPosition = ((Component)this).transform.position; lastRotation = ((Component)this).transform.rotation; } private void ProcessVertex(int index) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_010a: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.TransformPoint(originalVertices[index]); if (needsFullUpdate || !(Vector3.Distance(val, lastWorldPositions[index]) < updateThreshold)) { Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(val + Vector3.up * maxGroundDistance, Vector3.down); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, ref val3, maxGroundDistance * 2f, LayerMask.op_Implicit(groundLayer))) { Vector3 val4 = ((Component)this).transform.InverseTransformPoint(((RaycastHit)(ref val3)).point); wrappedVertices[index] = new Vector3(originalVertices[index].x, val4.y + heightOffset, originalVertices[index].z); } else { wrappedVertices[index] = originalVertices[index]; } lastWorldPositions[index] = val; } } public void ForceFullUpdate() { needsFullUpdate = true; currentVertexIndex = 0; } private void OnValidate() { if (Application.isPlaying && (Object)(object)meshFilter != (Object)null) { ForceFullUpdate(); } } } public struct PikminData : INetworkSerializable { public int GrowStage; public ulong NetworkObjectId; public int PikminTypeID; public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter { //IL_000b: 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_0022: 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_0039: 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) ((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref GrowStage, default(ForPrimitives)); ((BufferSerializer<ulong>*)(&serializer))->SerializeValue<ulong>(ref NetworkObjectId, default(ForPrimitives)); ((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref PikminTypeID, default(ForPrimitives)); } } public class SporePoisonZone : MonoBehaviour { public List<PikminAI> pikminList; public void OnTriggerEnter(Collider other) { if (((Object)other).name == "PikminColision") { PikminAI componentInParent = ((Component)other).GetComponentInParent<PikminAI>(); if (!pikminList.Contains(componentInParent) && ((EnemyAI)componentInParent).currentBehaviourStateIndex != 7) { pikminList.Add(componentInParent); componentInParent.EnterPanicState(CanBeWhistled: true, HazardType.Poison, IsLethal: true, Random.Range(5f, 12f)); } } } } namespace LethalMin { public class AnimatedOnion : Onion { public GameObject RealMesh; public GameObject FunniMesh; public GameObject Beam; public bool FunniMode = false; private AudioSource Audio; private Animator onionAnimator; private bool IsDoingSpawning = false; private int SpawnCount = 0; public override void Start() { base.Start(); SetupMeshes(); SetupAnimator(); SetupBeam(); } private void SetupBeam() { Beam = ((Component)((Component)this).transform.Find("BeamZone")).gameObject; Beam.SetActive(false); ((MonoBehaviour)this).StartCoroutine(ShowBeam()); } private IEnumerator ShowBeam() { yield return (object)new WaitForSeconds(6.3f); Beam.SetActive(true); } private IEnumerator HideBeam() { yield return (object)new WaitForSeconds(1.1f); Beam.SetActive(false); } private void SetupMeshes() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) RealMesh = ((Component)((Component)this).transform.Find("mesh/RealMesh")).gameObject; FunniMesh = ((Component)((Component)this).transform.Find("mesh/TempMesh")).gameObject; AnimPos = ((Component)this).transform.Find("PikminAnimPos"); SucPoint = ((Component)this).transform.Find("mesh/SK_stg_Onyon/ObjectSucPoint"); SpiPoint = ((Component)this).transform.Find("mesh/SK_stg_Onyon/SproutSpiPoint"); Audio = ((Component)((Component)this).transform.Find("Sound")).GetComponent<AudioSource>(); ((Component)((Component)this).transform.Find("mesh")).transform.rotation = Quaternion.Euler(0f, (float)OnionRandom.Next(360), 0f); } private void SetupAnimator() { onionAnimator = ((Component)this).GetComponentInChildren<Animator>(); if ((Object)(object)onionAnimator == (Object)null) { LethalMin.Logger.LogError((object)"Animator component not found in children of Onion object."); } } [ClientRpc] public void SyncOnionTypeClientRpc(int newType) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2460038460u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, newType); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2460038460u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { type = LethalMin.GetOnionTypeById(newType); UpdateOnionVisuals(); } } } [ClientRpc] public void SyncOnionTypeClientRpc(int[] newTypes) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(756600624u, val, (RpcDelivery)0); bool flag = newTypes != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(newTypes, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 756600624u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { OnionType onionType = LethalMin.RegisteredOnionTypes[newTypes[0]]; OnionType onionType2 = ScriptableObject.CreateInstance(typeof(OnionType)) as OnionType; ((Object)onionType2).name = "Fusion of " + string.Join(", ", newTypes); onionType2.OnionTypeID = onionType.OnionTypeID; onionType2.TypeName = "Fused " + onionType.TypeName; onionType2.OnionPrefab = onionType.OnionPrefab; onionType2.OnionMaterial = onionType.OnionMaterial; onionType2.TypesCanHold = new PikminType[0]; List<PikminType> list = new List<PikminType>(); foreach (int id in newTypes) { OnionType onionTypeById = LethalMin.GetOnionTypeById(id); list.AddRange(onionTypeById.TypesCanHold); FusedTypes.Add(onionTypeById); LethalMin.Logger.LogInfo((object)("mixing onions " + onionTypeById.TypeName + " and " + onionType.TypeName)); } onionType2.TypesCanHold = list.ToArray(); type = onionType2; PikminAI[] array = Object.FindObjectsOfType<PikminAI>(); foreach (PikminAI pikminAI in array) { pikminAI.CheckForOnion(Object.FindObjectsOfType<Onion>()); } UpdateFusionOnionVisuals(); } } public void UpdateOnionVisuals() { //IL_00f7: 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) if ((Object)(object)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021") == (Object)null) { LethalMin.Logger.LogError((object)"Onion mesh not found. Make sure the hierarchy is correct."); return; } Renderer component = ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<Renderer>(); if ((Object)(object)component == (Object)null) { LethalMin.Logger.LogError((object)"Renderer component not found on Onion mesh."); return; } Material val = null; Texture2D val2 = null; if ((Object)(object)type.OnionMaterial != (Object)null) { val = type.OnionMaterial; } if ((Object)(object)type.OnionTexture != (Object)null) { val2 = type.OnionTexture; } if ((Object)(object)val != (Object)null) { component.material = val; } if ((Object)(object)val2 != (Object)null) { component.material.mainTexture = (Texture)(object)val2; } component.material.color = type.OnionColor; ((Component)((Component)this).transform.Find("mesh/SK_stg_Onyon/root/S_j000/S_j001/S_j030/MapDot")).GetComponent<Renderer>().material.color = LethalMin.GetColorFromPType(type); } public void UpdateFusionOnionVisuals() { //IL_01bb: 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_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) Renderer component = ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<Renderer>(); switch (FusedTypes.Count) { case 2: ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.TwoSideOnion; break; case 3: ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.ThreeSideOnion; break; case 4: ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.FourSideOnion; break; case 5: ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.FiveSideOnion; break; case 6: ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.SixSideOnion; break; case 7: ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.SevenSideOnion; break; case 8: ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.EightSideOnion; break; default: if (FusedTypes.Count > 2) { ((Component)((Component)this).transform.Find("mesh/RealMesh/SK_stg_Onyon.021")).GetComponent<SkinnedMeshRenderer>().sharedMesh = LethalMin.EightSideOnion; } LethalMin.Logger.LogWarning((object)$"Unsupported number of fused onions: {FusedTypes.Count}"); break; } List<Color> list = new List<Color>(); list.Add(FusedTypes[0].OnionColor); foreach (OnionType fusedType in FusedTypes) { list.Add(fusedType.OnionColor); } Texture2D val = GradientTextureGenerator.Generate90DegreeGradient(list, 0.1f); if (LethalMin.DebugMode) { byte[] bytes = ImageConversion.EncodeToPNG(val); File.WriteAllBytes(Path.Combine(Application.persistentDataPath, "graident.png"), bytes); } component.material.color = Color.white; component.material.SetTexture("_BaseColorMap", (Texture)(object)val); ((Component)((Component)this).transform.Find("mesh/SK_stg_Onyon/root/S_j000/S_j001/S_j030/MapDot")).GetComponent<Renderer>().material.color = Color.white; ((Component)((Component)this).transform.Find("mesh/SK_stg_Onyon/root/S_j000/S_j001/S_j030/MapDot")).GetComponent<Renderer>().material.SetTexture("_UnlitColorMap", (Texture)(object)val); } public override void LateUpdate() { base.LateUpdate(); UpdateMeshVisibility(); CheckForShipLeaving(); } private void UpdateMeshVisibility() { RealMesh.SetActive(!LethalMin.FunniOnion); FunniMesh.SetActive(LethalMin.FunniOnion); } private void CheckForShipLeaving() { if (StartOfRound.Instance.shipIsLeaving && !HasDecidedToLeave && PikminInField.Values.Count <= 0) { HasDecidedToLeave = true; onionAnimator.SetTrigger("Leave"); ((Component)((Component)this).transform.Find("BeamZone/Cone")).gameObject.GetComponent<Animator>().Play("HideCone"); ((MonoBehaviour)this).StartCoroutine(HideBeam()); } } public void DEBUG_SPAWNSEED() { SpawnPikminSeed(LethalMin.GetPikminTypeById(0)); } public override void SpawnPikminSeed(PikminType pikminType) { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) base.SpawnPikminSeed(pikminType); if (!((NetworkBehaviour)this).IsServer) { return; } if (PikminManager.GetPikminEnemies().Count >= LethalMin.MaxMinValue) { pikminInOnion.Add(new OnionPikmin(0, pikminType.PikminTypeID)); DoSpitClientRpc(); LethalMin.Logger.LogWarning((object)"Max Pikmin Reached"); return; } float num = 8f; float num2 = 30f; float num3 = Random.Range(0f, 360f); float num4 = num3 + (float)SpawnCount * num2 % 360f; float num5 = num4 * (MathF.PI / 180f); float num6 = Mathf.Sin(num5) * num; float num7 = Mathf.Cos(num5) * num; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(SpiPoint.position.x + num6, SpiPoint.position.y, SpiPoint.position.z + num7); RaycastHit val2 = default(RaycastHit); Vector3 point = default(Vector3); if (Physics.Raycast(val, Vector3.down, ref val2, float.PositiveInfinity, LayerMask.op_Implicit(LethalMin.Instance.PikminColideable))) { point = ((RaycastHit)(ref val2)).point; } else { ((Vector3)(ref point))..ctor(val.x, 0f, val.z); } GameObject val3 = Object.Instantiate<GameObject>(LethalMin.AnimSproutPrefab, SpiPoint.position, Quaternion.identity); ((NetworkBehaviour)val3.GetComponent<AnimatedSprout>()).NetworkObject.Spawn(false); val3.GetComponent<AnimatedSprout>().ColorAndSyncClientRpc(pikminType.PikminTypeID); DoSpitClientRpc(); DoSproutAnimationClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)val3.GetComponent<AnimatedSprout>()).NetworkObject), SpiPoint.position, point, pikminType.PikminTypeID); SpawnCount++; } [ClientRpc] public void DoSproutAnimationClientRpc(NetworkObjectReference sproutRef, Vector3 start, Vector3 end, int pikminTypeID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between Unknown and I4 //IL_005f: 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_007d: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2433520509u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref sproutRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref start); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref end); BytePacker.WriteValueBitPacked(val2, pikminTypeID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2433520509u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { GameObject val3 = null; NetworkObject val4 = default(NetworkObject); ((NetworkObjectReference)(ref sproutRef)).TryGet(ref val4, (NetworkManager)null); val3 = ((Component)val4).gameObject; ((MonoBehaviour)this).StartCoroutine(AnimateSproutScale(val3)); ((MonoBehaviour)this).StartCoroutine(AnimateSprout(val3, start, end, LethalMin.GetPikminTypeById(pikminTypeID))); } } } private IEnumerator AnimateSprout(GameObject sprout, Vector3 start, Vector3 end, PikminType pikminType) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) float duration = 1f; float elapsedTime = 0f; Vector3 midPoint = Vector3.Lerp(start, end, 0.5f) + Vector3.up * 5f; Quaternion startRotation = Quaternion.Euler(180f, 0f, 0f); Quaternion endRotation = Quaternion.Euler(0f, (float)Random.Range(-360, 360), 0f); _ = (float)Random.Range(-360, 360); while (elapsedTime < duration) { elapsedTime += Time.deltaTime; float t = elapsedTime / duration; Vector3 m1 = Vector3.Lerp(start, midPoint, t); Vector3 m2 = Vector3.Lerp(midPoint, end, t); sprout.transform.position = Vector3.Lerp(m1, m2, t); sprout.transform.rotation = Quaternion.Slerp(startRotation, endRotation, t); yield return null; } sprout.transform.position = end; sprout.transform.rotation = endRotation; yield return (object)new WaitForSeconds(0.5f); if (((NetworkBehaviour)this).IsServer) { sprout.GetComponent<NetworkObject>().Despawn(true); GameObject actualSprout = Object.Instantiate<GameObject>(LethalMin.sproutPrefab, sprout.transform.position, sprout.transform.rotation); Sprout sproutScript = actualSprout.GetComponent<Sprout>(); ((NetworkBehaviour)sproutScript).NetworkObject.Spawn(false); sproutScript.InitalizeTypeClientRpc(pikminType.PikminTypeID); } } private IEnumerator AnimateSproutScale(GameObject sprout) { Vector3 startScale = Vector3.zero; float val = LethalMin.SproutScale; Vector3 endScale = new Vector3(val, val, val); float scaleDuration = 0.2f; float scaleElapsedTime = 0f; while (scaleElapsedTime < scaleDuration) { scaleElapsedTime += Time.deltaTime; float scaleT = scaleElapsedTime / scaleDuration; sprout.transform.localScale = Vector3.Lerp(startScale, endScale, scaleT); yield return null; } sprout.transform.localScale = endScale; } [ServerRpc(RequireOwnership = false)] public override void AddToTypesToSpawnServerRpc(int TypeID, int Times) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3644684709u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, TypeID); BytePacker.WriteValueBitPacked(val2, Times); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3644684709u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.AddToTypesToSpawnServerRpc(TypeID, Times); DoSuctionClientRpc(); } } } [ClientRpc] public void DoVacumeClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3394971609u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3394971609u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Audio.PlayOneShot(LethalMin.OnionVac); onionAnimator.SetBool("Inhaleing", true); SpawnCount = 0; } } } [ClientRpc] public void DoSuctionClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4158924115u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4158924115u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Audio.PlayOneShot(LethalMin.OnionSuc); onionAnimator.SetBool("Inhaleing", false); onionAnimator.SetTrigger("Inhaled"); } } } [ClientRpc] public void DoSpitClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: 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_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3975730806u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3975730806u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Audio.PlayOneShot(LethalMin.OnionSpi); onionAnimator.SetTrigger("Exhaled"); } } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_AnimatedOnion() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2460038460u, new RpcReceiveHandler(__rpc_handler_2460038460)); NetworkManager.__rpc_func_table.Add(756600624u, new RpcReceiveHandler(__rpc_handler_756600624)); NetworkManager.__rpc_func_table.Add(2433520509u, new RpcReceiveHandler(__rpc_handler_2433520509)); NetworkManager.__rpc_func_table.Add(3644684709u, new RpcReceiveHandler(__rpc_handler_3644684709)); NetworkManager.__rpc_func_table.Add(3394971609u, new RpcReceiveHandler(__rpc_handler_3394971609)); NetworkManager.__rpc_func_table.Add(4158924115u, new RpcReceiveHandler(__rpc_handler_4158924115)); NetworkManager.__rpc_func_table.Add(3975730806u, new RpcReceiveHandler(__rpc_handler_3975730806)); } private static void __rpc_handler_2460038460(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int newType = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newType); target.__rpc_exec_stage = (__RpcExecStage)2; ((AnimatedOnion)(object)target).SyncOnionTypeClientRpc(newType); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_756600624(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] newTypes = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref newTypes, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)2; ((AnimatedOnion)(object)target).SyncOnionTypeClientRpc(newTypes); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2433520509(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0058: 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_0076: 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_007e: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference sproutRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref sproutRef, default(ForNetworkSerializable)); Vector3 start = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref start); Vector3 end = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref end); int pikminTypeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pikminTypeID); target.__rpc_exec_stage = (__RpcExecStage)2; ((AnimatedOnion)(object)target).DoSproutAnimationClientRpc(sproutRef, start, end, pikminTypeID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3644684709(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0043: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int typeID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref typeID); int times = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref times); target.__rpc_exec_stage = (__RpcExecStage)1; ((AnimatedOnion)(object)target).AddToTypesToSpawnServerRpc(typeID, times); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3394971609(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((AnimatedOnion)(object)target).DoVacumeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4158924115(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((AnimatedOnion)(object)target).DoSuctionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3975730806(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((AnimatedOnion)(object)target).DoSpitClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AnimatedOnion"; } } public class AnimatedSprout : NetworkBehaviour { [ClientRpc] public void ColorAndSyncClientRpc(int Type = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: 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_0071: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3264901352u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, Type); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3264901352u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Random random = new Random(StartOfRound.Instance.randomMapSeed + ((NetworkBehaviour)this).NetworkBehaviourId); PikminType pikminType = ((Type != -1) ? LethalMin.GetPikminTypeById(Type) : LethalMin.SproutTypes[random.Next(0, LethalMin.SproutTypes.Count)]); if ((Object)(object)pikminType.SproutMeshPrefab != (Object)null) { ((Component)((Component)this).transform.Find("mesh")).gameObject.SetActive(false); GameObject val3 = Object.Instantiate<GameObject>(pikminType.SproutMeshPrefab, ((Component)this).transform); } else if ((Object)(object)pikminType.SproutMaterial != (Object)null) { ((Component)((Component)this).transform.Find("mesh/_Pikmin_Yellow_00.00200.002")).GetComponent<Renderer>().material = pikminType.SproutMaterial; } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_AnimatedSprout() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3264901352u, new RpcReceiveHandler(__rpc_handler_3264901352)); } private static void __rpc_handler_3264901352(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int type = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref type); target.__rpc_exec_stage = (__RpcExecStage)2; ((AnimatedSprout)(object)target).ColorAndSyncClientRpc(type); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AnimatedSprout"; } } public class AssetBundleLoader : MonoBehaviour { public static AssetBundleLoader instance; private const string BUNDLE_EXTENSION = "*.lethalmin"; internal static DirectoryInfo lethalMinFile = new DirectoryInfo(Assembly.GetExecutingAssembly().Location); internal static DirectoryInfo? lethalMinFolder; internal static DirectoryInfo? pluginsFolder; private Dictionary<string, AssetBundle> loadedBundles = new Dictionary<string, AssetBundle>(); [RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)] private static void OnRuntimeMethodLoad() { SceneManager.sceneLoaded += OnSceneLoaded; } private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)instance == (Object)null) { GameObject val = new GameObject("LethalMin AssetBundleLoader"); instance = val.AddComponent<AssetBundleLoader>(); Object.DontDestroyOnLoad((Object)(object)val); instance.Initialize(); } SceneManager.sceneLoaded -= OnSceneLoaded; } private void Initialize() { LoadLethalMinBundles(); } private void LoadLethalMinBundles() { lethalMinFolder = lethalMinFile.Parent; pluginsFolder = lethalMinFolder?.Parent; if (pluginsFolder == null || !pluginsFolder.Exists) { LethalMin.Logger.LogError((object)("Plugins folder not found: " + pluginsFolder?.FullName)); return; } if (LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { ((Component)this).gameObject.AddComponent<LibAssetBundleLoader>(); } string[] files = Directory.GetFiles(pluginsFolder.FullName, "*.lethalmin", SearchOption.AllDirectories); string[] array = files; foreach (string bundlePath in array) { ((MonoBehaviour)this).StartCoroutine(LoadBundleCoroutine(bundlePath)); } switch (files.Length) { case 0: if (LethalMin.DebugMode) { LethalMin.Logger.LogInfo((object)"No LethalMin bundles found in the plugins folder"); } break; case 1: LethalMin.Logger.LogInfo((object)"Loaded 1 LethalMin bundle"); break; default: LethalMin.Logger.LogInfo((object)$"Loaded {files.Length} LethalMin bundles"); break; } } private IEnumerator LoadBundleCoroutine(string bundlePath) { AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(bundlePath); yield return request; if ((Object)(object)request.assetBundle != (Object)null) { string bundleName = Path.GetFileNameWithoutExtension(bundlePath); loadedBundles[bundleName] = request.assetBundle; LethalMin.Logger.LogInfo((object)("Loaded bundle: " + bundleName)); if (LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { ((Component)this).gameObject.GetComponent<LibAssetBundleLoader>().ProcessLoadedLibBundle(request.assetBundle); } ProcessLoadedBundle(request.assetBundle); } else { LethalMin.Logger.LogError((object)("Failed to load bundle: " + bundlePath)); } } private void ProcessLoadedBundle(AssetBundle bundle) { bool flag = false; PikminType[] array = bundle.LoadAllAssets<PikminType>(); PikminType[] array2 = array; foreach (PikminType type in array2) { LethalMin.RegisterPikminType(type); flag = true; } OnionType[] array3 = bundle.LoadAllAssets<OnionType>(); OnionType[] array4 = array3; foreach (OnionType type2 in array4) { LethalMin.RegisterOnionType(type2); flag = true; } OnionFuseRules[] array5 = bundle.LoadAllAssets<OnionFuseRules>(); OnionFuseRules[] array6 = array5; foreach (OnionFuseRules fuseRule in array6) { LethalMin.RegisterFuseRule(fuseRule); flag = true; } if (!flag) { } if (!flag && !LethalMin.IsDependencyLoaded("NoteBoxz.LethalMinLibrary")) { LethalMin.Logger.LogWarning((object)("Bundle does not contain any valid LethalMin assets: " + ((Object)bundle).name + " This could be because you are missing the LethalMinLibrary mod")); } } } public static class AssetLoader { private static AssetBundle? _assetBundle; public static AssetBundle LoadAssetBundle() { if ((Object)(object)_assetBundle == (Object)null) { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (directoryName == null) { throw new InvalidOperationException("Unable to determine assembly location."); } string text = Path.Combine(directoryName, "lethalminassets"); _assetBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)_assetBundle == (Object)null) { throw new InvalidOperationException("Failed to load LethalMin AssetBundle."); } } return _assetBundle; } public static T LoadAsset<T>(string assetName) where T : Object { if (!assetName.EndsWith(".asset") && !assetName.EndsWith(".prefab") && !assetName.EndsWith(".wav") && !assetName.EndsWith(".mat") && !assetName.EndsWith(".ogg") && !assetName.EndsWith(".mp3") && !assetName.EndsWith(".mp4") && !assetName.EndsWith(".anim") && !assetName.EndsWith(".png") && !assetName.EndsWith(".jpg") && !assetName.EndsWith(".mesh")) { assetName += ".asset"; } AssetBundle val = LoadAssetBundle(); T val2 = val.LoadAsset<T>(assetName); if (!val.Contains(assetName)) { throw new InvalidOperationException("Asset not found in bundle: " + assetName); } if ((Object)(object)val2 == (Object)null) { throw new InvalidOperationException("Failed to load asset: " + assetName + ". Asset exists in bundle but couldn't be loaded."); } if (LethalMin.DebugMode) { LethalMin.Logger.LogInfo((object)("ASSETLOADER: Loaded " + assetName)); } return val2; } } [RequireComponent(typeof(LineRenderer))] public class CircleRenderer : MonoBehaviour { public float radius = 5f; public int segments = 60; public float lineWidth = 0.1f; public Color lineColor = Color.white; private LineRenderer lineRenderer; private void Start() { lineRenderer = ((Component)this).GetComponent<LineRenderer>(); DrawCircle(); } private void DrawCircle() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0068: 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_00ca: Unknown result type (might be due to invalid IL or missing references) lineRenderer.useWorldSpace = false; lineRenderer.startWidth = lineWidth; lineRenderer.endWidth = lineWidth; lineRenderer.positionCount = segments + 1; ((Renderer)lineRenderer).material = new Material(Shader.Find("Sprites/Default")); lineRenderer.startColor = lineColor; lineRenderer.endColor = lineColor; float num = MathF.PI * 2f / (float)segments; float num2 = 0f; for (int i = 0; i <= segments; i++) { float num3 = radius * Mathf.Cos(num2); float num4 = radius * Mathf.Sin(num2); lineRenderer.SetPosition(i, new Vector3(num3, num4, 0f)); num2 += num; } } private void OnValidate() { if ((Object)(object)lineRenderer != (Object)null) { DrawCircle(); } } } public class CustomPikminScriptExample : NetworkBehaviour { public PikminAI BaseScript = null; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); ((MonoBehaviour)this).StartCoroutine(WaitToParent()); } private IEnumerator WaitToParent() { yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)((Component)this).transform.parent != (Object)null)); BaseScript = ((Component)this).GetComponentInParent<PikminAI>(); if ((Object)(object)BaseScript != (Object)null) { SubscribeToEvents(); } if (LethalMin.DebugMode) { LethalMin.Logger.LogInfo((object)("Custom Pikmin script attached to " + BaseScript?.uniqueDebugId)); } } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if ((Object)(object)BaseScript != (Object)null) { UnSubscribeToEvents(); } } private void SubscribeToEvents() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Expected O, but got Unknown //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Expected O, but got Unknown //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Expected O, but got Unknown //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Expected O, but got Unknown //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Expected O, but got Unknown //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Expected O, but got Unknown //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Expected O, but got Unknown //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Expected O, but got Unknown //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Expected O, but got Unknown //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Expected O, but got Unknown //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Expected O, but got Unknown //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Expected O, but got Unknown //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Expected O, but got Unknown //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Expected O, but got Unknown //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Expected O, but got Unknown //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Expected O, but got Unknown //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Expected O, but got Unknown //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Expected O, but got Unknown //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Expected O, but got Unknown //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Expected O, but got Unknown //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Expected O, but got Unknown //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Expected O, but got Unknown //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Expected O, but got Unknown //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Expected O, but got Unknown //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Expected O, but got Unknown //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Expected O, but got Unknown //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Expected O, but got Unknown BaseScript.OnDoAIInterval.AddListener(new UnityAction(OnDoAIIntervalHandler)); BaseScript.OnHandleIdleState.AddListener(new UnityAction(OnHandleIdleStateHandler)); BaseScript.OnHandleFollowingState.AddListener(new UnityAction(OnHandleFollowingStateHandler)); BaseScript.OnHandleAirbornState.AddListener(new UnityAction(OnHandleAirbornStateHandler)); BaseScript.OnHandleDrowningState.AddListener(new UnityAction(OnHandleDrowningStateHandler)); BaseScript.OnHandleWorkingState.AddListener(new UnityAction(OnHandleWorkingStateHandler)); BaseScript.OnHandleAttackingState.AddListener(new UnityAction(OnHandleAttackingStateHandler)); BaseScript.OnHandleLeavingState.AddListener(new UnityAction(OnHandleLeavingStateHandler)); BaseScript.OnHandleLeaderLost.AddListener(new UnityAction(OnHandleLeaderLostHandler)); BaseScript.OnCheckForNearbyPlayers.AddListener(new UnityAction(OnCheckForNearbyPlayersHandler)); BaseScript.OnAssignLeader.AddListener(new UnityAction(OnAssignLeaderHandler)); BaseScript.OnAssignLeaderServerRpc.AddListener(new UnityAction(OnAssignLeaderServerRpcHandler)); BaseScript.OnAssignLeaderResponseClientRpc.AddListener(new UnityAction(OnAssignLeaderResponseClientRpcHandler)); BaseScript.OnFindLeaderManagerForPlayer.AddListener(new UnityAction(OnFindLeaderManagerForPlayerHandler)); BaseScript.OnSetDrowningClientRpc.AddListener(new UnityAction(OnSetDrowningClientRpcHandler)); BaseScript.OnStopDrowningClientRpc.AddListener(new UnityAction(OnStopDrowningClientRpcHandler)); BaseScript.OnIsNearDestination.AddListener(new UnityAction(OnIsNearDestinationHandler)); BaseScript.OnRemoveFromItemServerRpc.AddListener(new UnityAction(OnRemoveFromItemServerRpcHandler)); BaseScript.OnSetTargetItemServerRpc.AddListener(new UnityAction(OnSetTargetItemServerRpcHandler)); BaseScript.OnSetTargetItemClientRpc.AddListener(new UnityAction(OnSetTargetItemClientRpcHandler)); BaseScript.OnDetectNearbyItems.AddListener(new UnityAction(OnDetectNearbyItemsHandler)); BaseScript.OnMoveTowardsItem.AddListener(new UnityAction(OnMoveTowardsItemHandler)); BaseScript.OnCheckLineOfSightForItem.AddListener(new UnityAction(OnCheckLineOfSightForItemHandler)); BaseScript.OnLandPikminClientRpc.AddListener(new UnityAction(OnLandPikminClientRpcHandler)); BaseScript.OnLatchOntoEnemyClientRpc.AddListener(new UnityAction(OnLatchOntoEnemyClientRpcHandler)); BaseScript.OnOnCollideWithEnemy.AddListener(new UnityAction(OnCollideWithEnemyHandler)); BaseScript.OnDoAIIntervalEnd.AddListener(new UnityAction(OnDoAIIntervalEndHandler)); BaseScript.OnHandleIdleStateEnd.AddListener(new UnityAction(OnHandleIdleStateEndHandler)); BaseScript.OnHandleFollowingStateEnd.AddListener(new UnityAction(OnHandleFollowingStateEndHandler)); BaseScript.OnHandleAirbornStateEnd.AddListener(new UnityAction(OnHandleAirbornStateEndHandler)); BaseScript.OnHandleDrowningStateEnd.AddListener(new UnityAction(OnHandleDrowningStateEndHandler)); BaseScript.OnHandleWorkingStateEnd.AddListener(new UnityAction(OnHandleWorkingStateEndHandler)); BaseScript.OnHandleAttackingStateEnd.AddListener(new UnityAction(OnHandleAttackingStateEndHandler)); BaseScript.OnHandleLeavingStateEnd.AddListener(new UnityAction(OnHandleLeavingStateEndHandler)); BaseScript.OnHandleLeaderLostEnd.AddListener(new UnityAction(OnHandleLeaderLostEndHandler)); BaseScript.OnCheckForNearbyPlayersEnd.AddListener(new UnityAction(OnCheckForNearbyPlayersEndHandler)); BaseScript.OnAssignLeaderEnd.AddListener(new UnityAction(OnAssignLeaderEndHandler)); BaseScript.OnAssignLeaderServerRpcEnd.AddListener(new UnityAction(OnAssignLeaderServerRpcEndHandler)); BaseScript.OnAssignLeaderResponseClientRpcEnd.AddListener(new UnityAction(OnAssignLeaderResponseClientRpcEndHandler)); BaseScript.OnFindLeaderManagerForPlayerEnd.AddListener(new UnityAction(OnFindLeaderManagerForPlayerEndHandler)); BaseScript.OnSetDrowningClientRpcEnd.AddListener(new UnityAction(OnSetDrowningClientRpcEndHandler)); BaseScript.OnStopDrowningClientRpcEnd.AddListener(new UnityAction(OnStopDrowningClientRpcEndHandler)); BaseScript.OnIsNearDestinationEnd.AddListener(new UnityAction(OnIsNearDestinationEndHandler)); BaseScript.OnRemoveFromItemServerRpcEnd.AddListener(new UnityAction(OnRemoveFromItemServerRpcEndHandler)); BaseScript.OnSetTargetItemServerRpcEnd.AddListener(new UnityAction(OnSetTargetItemServerRpcEndHandler)); BaseScript.OnSetTargetItemClientRpcEnd.AddListener(new UnityAction(OnSetTargetItemClientRpcEndHandler)); BaseScript.OnDetectNearbyItemsEnd.AddListener(new UnityAction(OnDetectNearbyItemsEndHandler)); BaseScript.OnMoveTowardsItemEnd.AddListener(new UnityAction(OnMoveTowardsItemEndHandler)); BaseScript.OnCheckLineOfSightForItemEnd.AddListener(new UnityAction(OnCheckLineOfSightForItemEndHandler)); BaseScript.OnLandPikminEnd.AddListener(new UnityAction(OnLandPikminClientRpcEndHandler)); BaseScript.OnLatchOntoEnemyEnd.AddListener(new UnityAction(OnLatchOntoEnemyClientRpcEndHandler)); BaseScript.OnOnCollideWithEnemyEnd.AddListener(new UnityAction(OnCollideWithEnemyEndHandler)); } private void UnSubscribeToEvents() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Expected O, but got Unknown //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Expected O, but got Unknown //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Expected O, but got Unknown //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Expected O, but got Unknown //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Expected O, but got Unknown //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Expected O, but got Unknown //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Expected O, but got Unknown //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Expected O, but got Unknown //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Expected O, but got Unknown //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Expected O, but got Unknown //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Expected O, but got Unknown //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Expected O, but got Unknown //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Expected O, but got Unknown //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Expected O, but got Unknown //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Expected O, but got Unknown //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Expected O, but got Unknown //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Expected O, but got Unknown //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Expected O, but got Unknown //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Expected O, but got Unknown //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Expected O, but got Unknown //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Expected O, but got Unknown //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Expected O, but got Unknown //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Expected O, but got Unknown //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Expected O, but got Unknown //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Expected O, but got Unknown //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Expected O, but got Unknown //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Expected O, but got Unknown BaseScript.OnDoAIInterval.RemoveListener(new UnityAction(OnDoAIIntervalHandler)); BaseScript.OnHandleIdleState.RemoveListener(new UnityAction(OnHandleIdleStateHandler)); BaseScript.OnHandleFollowingState.RemoveListener(new UnityAction(OnHandleFollowingStateHandler)); BaseScript.OnHandleAirbornState.RemoveListener(new UnityAction(OnHandleAirbornStateHandler)); BaseScript.OnHandleDrowningState.RemoveListener(new UnityAction(OnHandleDrowningStateHandler)); BaseScript.OnHandleWorkingState.RemoveListener(new UnityAction(OnHandleWorkingStateHandler)); BaseScript.OnHandleAttackingState.RemoveListener(new UnityAction(OnHandleAttackingStateHandler)); BaseScript.OnHandleLeavingState.RemoveListener(new UnityAction(OnHandleLeavingStateHandler)); BaseScript.OnHandleLeaderLost.RemoveListener(new UnityAction(OnHandleLeaderLostHandler)); BaseScript.OnCheckForNearbyPlayers.RemoveListener(new UnityAction(OnCheckForNearbyPlayersHandler)); BaseScript.OnAssignLeader.RemoveListener(new UnityAction(OnAssignLeaderHandler)); BaseScript.OnAssignLeaderServerRpc.RemoveListener(new UnityAction(OnAssignLeaderServerRpcHandler)); BaseScript.OnAssignLeaderResponseClientRpc.RemoveListener(new UnityAction(OnAssignLeaderResponseClientRpcHandler)); BaseScript.OnFindLeaderManagerForPlayer.RemoveListener(new UnityAction(OnFindLeaderManagerForPlayerHandler)); BaseScript.OnSetDrowningClientRpc.RemoveListener(new UnityAction(OnSetDrowningClientRpcHandler)); BaseScript.OnStopDrowningClientRpc.RemoveListener(new UnityAction(OnStopDrowningClientRpcHandler)); BaseScript.OnIsNearDestination.RemoveListener(new UnityAction(OnIsNearDestinationHandler)); BaseScript.OnRemoveFromItemServerRpc.RemoveListener(new UnityAction(OnRemoveFromItemServerRpcHandler)); BaseScript.OnSetTargetItemServerRpc.RemoveListener(new UnityAction(OnSetTargetItemServerRpcHandler)); BaseScript.OnSetTargetItemClientRpc.RemoveListener(new UnityAction(OnSetTargetItemClientRpcHandler)); BaseScript.OnDetectNearbyItems.RemoveListener(new UnityAction(OnDetectNearbyItemsHandler)); BaseScript.OnMoveTowardsItem.RemoveListener(new UnityAction(OnMoveTowardsItemHandler)); BaseScript.OnCheckLineOfSightForItem.RemoveListener(new UnityAction(OnCheckLineOfSightForItemHandler)); BaseScript.OnLandPikminClientRpc.RemoveListener(new UnityAction(OnLandPikminClientRpcHandler)); BaseScript.OnLatchOntoEnemyClientRpc.RemoveListener(new UnityAction(OnLatchOntoEnemyClientRpcHandler)); BaseScript.OnOnCollideWithEnemy.RemoveListener(new UnityAction(OnCollideWithEnemyHandler)); BaseScript.OnDoAIIntervalEnd.RemoveListener(new UnityAction(OnDoAIIntervalEndHandler)); BaseScript.OnHandleIdleStateEnd.RemoveListener(new UnityAction(OnHandleIdleStateEndHandler)); BaseScript.OnHandleFollowingStateEnd.RemoveListener(new UnityAction(OnHandleFollowingStateEndHandler)); BaseScript.OnHandleAirbornStateEnd.RemoveListener(new UnityAction(OnHandleAirbornStateEndHandler)); BaseScript.OnHandleDrowningStateEnd.RemoveListener(new UnityAction(OnHandleDrowningStateEndHandler)); BaseScript.OnHandleWorkingStateEnd.RemoveListener(new UnityAction(OnHandleWorkingStateEndHandler)); BaseScript.OnHandleAttackingStateEnd.RemoveListener(new UnityAction(OnHandleAttackingStateEndHandler)); BaseScript.OnHandleLeavingStateEnd.RemoveListener(new UnityAction(OnHandleLeavingStateEndHandler)); BaseScript.OnHandleLeaderLostEnd.RemoveListener(new UnityAction(OnHandleLeaderLostEndHandler)); BaseScript.OnCheckForNearbyPlayersEnd.RemoveListener(new UnityAction(OnCheckForNearbyPlayersEndHandler)); BaseScript.OnAssignLeaderEnd.RemoveListener(new UnityAction(OnAssignLeaderEndHandler)); BaseScript.OnAssignLeaderServerRpcEnd.RemoveListener(new UnityAction(OnAssignLeaderServerRpcEndHandler)); BaseScript.OnAssignLeaderResponseClientRpcEnd.RemoveListener(new UnityAction(OnAssignLeaderResponseClientRpcEndHandler)); BaseScript.OnFindLeaderManagerForPlayerEnd.RemoveListener(new UnityAction(OnFindLeaderManagerForPlayerEndHandler)); BaseScript.OnSetDrowningClientRpcEnd.RemoveListener(new UnityAction(OnSetDrowningClientRpcEndHandler)); BaseScript.OnStopDrowningClientRpcEnd.RemoveListener(new UnityAction(OnStopDrowningClientRpcEndHandler)); BaseScript.OnIsNearDestinationEnd.RemoveListener(new UnityAction(OnIsNearDestinationEndHandler)); BaseScript.OnRemoveFromItemServerRpcEnd.RemoveListener(new UnityAction(OnRemoveFromItemServerRpcEndHandler)); BaseScript.OnSetTargetItemServerRpcEnd.RemoveListener(new UnityAction(OnSetTargetItemServerRpcEndHandler)); BaseScript.OnSetTargetItemClientRpcEnd.RemoveListener(new UnityAction(OnSetTargetItemClientRpcEndHandler)); BaseScript.OnDetectNearbyItemsEnd.RemoveListener(new UnityAction(OnDetectNearbyItemsEndHandler)); BaseScript.OnMoveTowardsItemEnd.RemoveListener(new UnityAction(OnMoveTowardsItemEndHandler)); BaseScript.OnCheckLineOfSightForItemEnd.RemoveListener(new UnityAction(OnCheckLineOfSightForItemEndHandler)); BaseScript.OnLandPikminEnd.RemoveListener(new UnityAction(OnLandPikminClientRpcEndHandler)); BaseScript.OnLatchOntoEnemyEnd.RemoveListener(new UnityAction(OnLatchOntoEnemyClientRpcEndHandler)); BaseScript.OnOnCollideWithEnemyEnd.RemoveListener(new UnityAction(OnCollideWithEnemyEndHandler)); } private void OnDoAIIntervalHandler() { } private void OnHandleIdleStateHandler() { } private void OnHandleFollowingStateHandler() { } private void OnHandleAirbornStateHandler() { } private void OnHandleDrowningStateHandler() { } private void OnHandleWorkingStateHandler() { } private void OnHandleAttackingStateHandler() { } private void OnHandleLeavingStateHandler() { } private void OnHandleLeaderLostHandler() { } private void OnCheckForNearbyPlayersHandler() { } private void OnAssignLeaderHandler() { } private void OnAssignLeaderServerRpcHandler() { } private void OnAssignLeaderResponseClientRpcHandler() { } private void OnFindLeaderManagerForPlayerHandler() { } private void OnSetDrowningClientRpcHandler() { } private void OnStopDrowningClientRpcHandler() { } private void OnIsNearDestinationHandler() { } private void OnRemoveFromItemServerRpcHandler() { } private void OnSetTargetItemServerRpcHandler() { } private void OnSetTargetItemClientRpcHandler() { } private void OnDetectNearbyItemsHandler() { } private void OnMoveTowardsItemHandler() { } private void OnCheckLineOfSightForItemHandler() { } private void OnLandPikminClientRpcHandler() { } private void OnLatchOntoEnemyClientRpcHandler() { } private void OnDoAIIntervalEndHandler() { } private void OnHandleIdleStateEndHandler() { } private void OnHandleFollowingStateEndHandler() { } private void OnHandleAirbornStateEndHandler() { } private void OnHandleDrowningStateEndHandler() { } private void OnHandleWorkingStateEndHandler() { } private void OnHandleAttackingStateEndHandler() { } private void OnHandleLeavingStateEndHandler() { } private void OnHandleLeaderLostEndHandler() { } private void OnCheckForNearbyPlayersEndHandler() { } private void OnAssignLeaderEndHandler() { } private void OnAssignLeaderServerRpcEndHandler() { } private void OnAssignLeaderResponseClientRpcEndHandler() { } private void OnFindLeaderManagerForPlayerEndHandler() { } private void OnSetDrowningClientRpcEndHandler() { } private void OnStopDrowningClientRpcEndHandler() { } private void OnIsNearDestinationEndHandler() { } private void OnRemoveFromItemServerRpcEndHandler() { } private void OnSetTargetItemServerRpcEndHandler() { } private void OnSetTargetItemClientRpcEndHandler() { } private void OnDetectNearbyItemsEndHandler() { } private void OnMoveTowardsItemEndHandler() { } private void OnCheckLineOfSightForItemEndHandler() { } private void OnLandPikminClientRpcEndHandler() { } private void OnLatchOntoEnemyClientRpcEndHandler() { } private void OnCollideWithEnemyEndHandler() { } private void OnCollideWithEnemyHandler() { } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "CustomPikminScriptExample"; } } public interface IDebuggable { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true, AllowMultiple = false)] public class DebugAttribute : Attribute { } } public class DebugMenu : MonoBehaviour { private Dictionary<string, List<(GameObject gameObject, List<(string name, FieldInfo field, PropertyInfo property, object target)> items)>> debugItems = new Dictionary<string, List<(GameObject, List<(string, FieldInfo, PropertyInfo, object)>)>>(); private Vector2 mainScrollPosition; private Dictionary<string, Vector2> classScrollPositions = new Dictionary<string, Vector2>(); private bool showDebugMenu = false; private string selectedClassName = null; private float classContentHeight = 0f; private const float MenuWidth = 400f; private const float MenuHeight = 600f; private const float ClassViewHeight = 400f; private void Start() { CollectDebuggableItems(); } private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 pos = Vector3.zero; if ((Object)(object)StartOfRound.Instance.localPlayerController != (Object)null) { pos = ((Component)StartOfRound.Instance.localPlayerController).transform.position; } foreach (string item in debugItems.Keys.ToList()) { if (debugItems[item].Count == 0) { debugItems.Remove(item); continue; } debugItems[item] = (from item in debugItems[item] where (Object)(object)item.gameObject != (Object)null orderby Vector3.Distance(item.gameObject.transform.position, pos) select item).ToList(); } if (!showDebugMenu) { } } private void CollectDebuggableItems() { debugItems.Clear(); IDebuggable[] array = Object.FindObjectsOfType<MonoBehaviour>().OfType<IDebuggable>().ToArray(); IDebuggable[] array2 = array; foreach (IDebuggable debuggable in array2) { if (debuggable == null) { continue; } MonoBehaviour val = (MonoBehaviour)((debuggable is MonoBehaviour) ? debuggable : null); if ((Object)(object)val == (Object)null) { continue; } string name = ((object)val).GetType().Name; if (!debugItems.ContainsKey(name)) { debugItems[name] = new List<(GameObject, List<(string, FieldInfo, PropertyInfo, object)>)>(); } List<(string, FieldInfo, PropertyInfo, object)> list = new List<(string, FieldInfo, PropertyInfo, object)>(); list.Add(("Position", null, ((object)((Component)val).transform).GetType().GetProperty("position"), ((Component)val).transform)); FieldInfo[] fields = ((object)val).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); PropertyInfo[] properties = ((object)val).GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array3 = fields; foreach (FieldInfo fieldInfo in array3) { if (Attribute.GetCustomAttribute(fieldInfo, typeof(IDebuggable.DebugAttribute)) != null) { list.Add((fieldInfo.Name, fieldInfo, null, val)); } } PropertyInfo[] array4 = properties; foreach (PropertyInfo propertyInfo in array4) { if (Attribute.GetCustomAttribute(propertyInfo, typeof(IDebuggable.DebugAttribute)) != null) { list.Add((propertyInfo.Name, null, propertyInfo, val)); } } debugItems[name].Add((((Component)val).gameObject, list)); } using Dictionary<string, List<(GameObject, List<(string, FieldInfo, PropertyInfo, object)>)>>.KeyCollection.Enumerator enumerator = debugItems.Keys.GetEnumerator(); if (enumerator.MoveNext()) { string current = enumerator.Current; } } private void OnGUI() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0349: 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_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_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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: 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_0200: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) if (GUI.Button(new Rect(10f, 10f, 100f, 30f), "Debug Menu")) { showDebugMenu = !showDebugMenu; if (showDebugMenu) { CollectDebuggableItems(); } } if (!showDebugMenu) { return; } GUI.Box(new Rect(10f, 50f, 400f, 600f), "Debug Menu"); mainScrollPosition = GUI.BeginScrollView(new Rect(10f, 80f, 400f, 570f), mainScrollPosition, new Rect(0f, 0f, 370f, classContentHeight)); float num = 0f; classContentHeight = 0f; Rect val = default(Rect); Rect val2 = default(Rect); foreach (string key in debugItems.Keys) { if (GUI.Button(new Rect(10f, num, 360f, 30f), $"{key} ({debugItems[key].Count})")) { selectedClassName = ((selectedClassName == key) ? null : key); } num += 35f; classContentHeight += 35f; if (!(selectedClassName == key)) { continue; } if (!classScrollPositions.ContainsKey(key)) { classScrollPositions[key] = Vector2.zero; } float num2 = CalculateClassContentHeight(key); ((Rect)(ref val))..ctor(20f, num, 340f, 400f); ((Rect)(ref val2))..ctor(0f, 0f, 320f, num2); classScrollPositions[key] = GUI.BeginScrollView(val, classScrollPositions[key], val2); float num3 = 0f; foreach (var item in debugItems[key]) { if ((Object)(object)item.gameObject == (Object)null) { continue; } GUI.Label(new Rect(0f, num3, 320f, 25f), ((Object)item.gameObject).name, GUI.skin.button); num3 += 30f; foreach (var item2 in item.items) { string text = "N/A"; object obj = null; try { obj = ((item2.field != null) ? item2.field.GetValue(item2.target) : item2.property.GetValue(item2.target)); text = obj?.ToString() ?? "null"; } catch (Exception ex) { LethalMin.Logger.LogError((object)("Error getting value for " + item2.name + ": " + ex.Message)); } GUI.Label(new Rect(10f, num3, 310f, 20f), item2.name + ": " + text); num3 += 25f; if (obj != null && obj is IEnumerable && !(obj is string)) { RenderListOrArray(obj, ref num3, 310f); } } num3 += 10f; } GUI.EndScrollView(); num += 410f; num2 += 410f; } GUI.EndScrollView(); } private float CalculateClassContentHeight(string className) { float num = 0f; foreach (var item in debugItems[className]) { if (!((Object)(object)item.gameObject == (Object)null)) { num += (float)(30 + item.items.Count * 25 + 10); } } return num; } private void RenderListOrArray(object value, ref float classYOffset, float width) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (value == null || !(value is IEnumerable enumerable)) { return; } int num = 0; foreach (object item in enumerable) { GUI.Label(new Rect(20f, classYOffset, width - 100f, 20f), string.Format("[{0}]: {1}", num, item?.ToString() ?? "null")); classYOffset += 25f; num++; if (num >= 10) { GUI.Label(new Rect(20f, classYOffset, width - 100f, 20f), "..."); classYOffset += 25f; break; } } } } public class DictionaryIntArrayConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Dictionary<int, int[]> dictionary = (Dictionary<int, int[]>)value; writer.WriteStartObject(); foreach (KeyValuePair<int, int[]> item in dictionary) { writer.WritePropertyName(item.Key.ToString()); serializer.Serialize(writer, (object)item.Value); } writer.WriteEndObject(); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 Dictionary<int, int[]> dictionary = new Dictionary<int, int[]>(); while (reader.Read() && (int)reader.TokenType != 13) { if ((int)reader.TokenType == 4) { int key = int.Parse((string)reader.Value); reader.Read(); int[] value = serializer.Deserialize<int[]>(reader); dictionary.Add(key, value); } } return dictionary; } public override bool CanConvert(Type objectType) { return objectType == typeof(Dictionary<int, int[]>); } } public class DualOnion : Onion { public GameObject MainMesh; public GameObject Beam; public GameObject Cone; public bool IsBeamOut; public bool InteractionSetup; public override void Start() { AnimPos = ((Component)this).transform.Find("PikminAnimPos"); SetupMesh(); SetupBeam(); Cone = ((Component)((Component)this).transform.Find("BeamZone/Cone")).gameObject; HideCone(); Beam.SetActive(false); base.Start(); } protected override void SetupInteractTrigger() { base.SetupInteractTrigger(); Interaction