using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; 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.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using ScrapSack.Content; using ScrapSack.Networking; using ScrapSack.Patches; using ScrapSack.Utils; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [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.Components")] [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("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Iron.ScrapSack")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ScrapSack")] [assembly: AssemblyTitle("Iron.ScrapSack")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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; } } } namespace ScrapSack { [BepInPlugin("Iron.ScrapSack", "ScrapSack", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PLUGIN_GUID = "Iron.ScrapSack"; public const string PLUGIN_NAME = "ScrapSack"; public const string PLUGIN_VERSION = "1.0.0"; private const string LethalLibGuid = "evaisa.lethallib"; private Harmony _harmony; internal static Plugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } private void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; try { PluginConfig.Init(((BaseUnityPlugin)this).Config); SackRules.UseLocal(); _harmony = new Harmony("Iron.ScrapSack"); _harmony.PatchAll(typeof(Plugin).Assembly); Log.LogInfo((object)"ScrapSack v1.0.0 loaded."); } catch (Exception arg) { Log.LogError((object)$"Failed to initialize; the mod is inactive: {arg}"); } } } internal static class PluginConfig { internal static ConfigEntry Enabled; internal static ConfigEntry Price; internal static ConfigEntry ItemName; internal static ConfigEntry Capacity; internal static ConfigEntry ResizeSlotUI; internal static ConfigEntry SlotsPerRow; internal static ConfigEntry AllowTwoHanded; internal static ConfigEntry DeniedItems; internal static ConfigEntry WeightEnabled; internal static ConfigEntry WeightMultiplier; internal static ConfigEntry RecolorMode; internal static ConfigEntry TintColor; internal static ConfigEntry GrabRange; internal static ConfigEntry Tooltip; internal static ConfigEntry DropAll; internal static ConfigEntry EnforceCapacity; internal static ConfigEntry EnforceRestrictions; internal static ConfigEntry EnforceRange; private static HashSet _denied = new HashSet(StringComparer.OrdinalIgnoreCase); internal static void Init(ConfigFile cfg) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown Enabled = cfg.Bind("General", "Enabled", true, "Master switch for the whole mod."); Price = cfg.Bind("Shop", "Price", 60, new ConfigDescription("Terminal price of the scrap sack. Needs a game restart.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 1000), Array.Empty())); ItemName = cfg.Bind("Shop", "Item Name", "Scrap sack", "Name shown in the terminal and in the HUD. Needs a game restart."); Capacity = cfg.Bind("Slots", "Capacity", 4, new ConfigDescription("How many items the sack can hold.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ResizeSlotUI = cfg.Bind("Slots", "Resize Inventory UI", true, "Rebuild the bag inventory grid so the number of visible slot squares matches Capacity. The vanilla belt bag's own grid is restored whenever you open a vanilla bag."); SlotsPerRow = cfg.Bind("Slots", "Slots Per Row", 4, new ConfigDescription("How many slot squares per row when the UI is rebuilt.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 20), Array.Empty())); AllowTwoHanded = cfg.Bind("Items", "Allow Two-Handed Scrap", false, "Allow bulky two-handed scrap (paintings, large loot) into the sack. OFF keeps it to one-handed scrap only."); DeniedItems = cfg.Bind("Items", "Denied Items", "Apparatus, Body", "Comma-separated item names that never fit, even though they count as scrap. The Apparatus is excluded by default because bagging it interferes with leaving the facility."); RebuildDenied(); DeniedItems.SettingChanged += delegate { RebuildDenied(); }; WeightEnabled = cfg.Bind("Weight", "Enabled", true, "Make the sack weigh you down by the weight of its contents (vanilla bags are weightless). This is the whole point of the sack: it carries scrap, but you feel it. In multiplayer the host's setting is used, so turning this off only affects lobbies you host."); WeightMultiplier = cfg.Bind("Weight", "Multiplier", 1f, new ConfigDescription("Fraction of each stored item's weight that is applied while you carry the sack. In multiplayer the host's value is used.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); RecolorMode = cfg.Bind("Appearance", "Recolor Mode", Recoloring.SwapRedBlue, "How the vanilla blue bag is turned red. Needs a game restart.\nSwapRedBlue - swap the red and blue channels: blue becomes a clean red and every texture detail and shading survives. Recommended.\nTint - flatly force the base colour to 'Tint Color'. Simpler, but tinting red over a blue texture tends to look muddy.\nOff - leave it looking like the vanilla bag."); TintColor = cfg.Bind("Appearance", "Tint Color", "#C81E1E", "Hex colour used by Recolor Mode = Tint. Needs a game restart."); GrabRange = cfg.Bind("Misc", "Grab Range", 4f, new ConfigDescription("Max range to grab items into the sack.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 20f), Array.Empty())); Tooltip = cfg.Bind("Misc", "Tooltips", true, "Show a HUD tip when an item can't be stored (full / not scrap / too bulky)."); DropAll = cfg.Bind("Misc", "Empty Bag Action", true, "Right-interact while holding the sack empties it onto the ground."); EnforceCapacity = cfg.Bind("Host", "Enforce Capacity", true, "Server-side capacity check (prevents clients exceeding the host's Capacity)."); EnforceRestrictions = cfg.Bind("Host", "Enforce Restrictions", true, "Server-side scrap-only check (prevents clients bagging what the host disallows)."); EnforceRange = cfg.Bind("Host", "Enforce Range", true, "Server-side grab-range check."); ((Dictionary)(typeof(ConfigFile).GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(cfg)))?.Clear(); cfg.Save(); } private static void RebuildDenied() { HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); string[] array = DeniedItems.Value.Split(','); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); if (text.Length > 0) { hashSet.Add(text); } } _denied = hashSet; } internal static bool IsDenied(string itemName) { if (itemName != null) { return _denied.Contains(itemName); } return false; } } } namespace ScrapSack.Utils { internal static class NgoUtils { internal static bool IsRpcServerStage(this NetworkBehaviour self) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 NetworkManager networkManager = self.NetworkManager; if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening) { return false; } if ((int)self.__rpc_exec_stage != 1) { return false; } if (!networkManager.IsServer) { return networkManager.IsHost; } return true; } } } namespace ScrapSack.Patches { [HarmonyPatch] internal static class BagUiPatch { private static string _iconPath; private static bool _captured; private static int _vanillaCount; private static Vector2[] _vanillaPositions; private static Vector2 _cellSize; private static float _xStep; private static float _yStep; private static Vector2 _center; private static bool _layoutIsOurs; [HarmonyPrefix] [HarmonyPriority(800)] [HarmonyPatch(typeof(BeltBagInventoryUI), "FillSlots")] private static void BeforeFillSlots(BeltBagInventoryUI __instance, BeltBagItem __0) { if (!PluginConfig.Enabled.Value || !PluginConfig.ResizeSlotUI.Value) { return; } try { EnsureSlots(__instance, __0); } catch (Exception arg) { Plugin.Log.LogError((object)$"Bag UI resize failed (harmless): {arg}"); } } private static void EnsureSlots(BeltBagInventoryUI ui, BeltBagItem bag) { GameObject[] inventorySlots = ui.inventorySlots; Image[] inventorySlotIcons = ui.inventorySlotIcons; if (inventorySlots == null || inventorySlots.Length == 0 || inventorySlotIcons == null || inventorySlotIcons.Length == 0) { return; } CaptureMetrics(inventorySlots); bool flag = ScrapSackPatch.Enabled && ScrapSackContent.IsScrapSack((GrabbableObject)(object)bag); if (!flag && !_layoutIsOurs) { return; } int num = (flag ? Mathf.Clamp(SackRules.Capacity, 1, 100) : _vanillaCount); int num2 = inventorySlots.Length; if (num2 == num && _layoutIsOurs == flag) { return; } GameObject val = inventorySlots[0]; Transform parent = val.transform.parent; if (_iconPath == null) { _iconPath = RelativePath(inventorySlots[0].transform, ((Component)inventorySlotIcons[0]).transform); } DisableLayoutGroups(parent); GameObject[] array = (GameObject[])(object)new GameObject[num]; Image[] array2 = (Image[])(object)new Image[num]; for (int i = 0; i < num; i++) { GameObject val2; Image val3; if (i < num2 && (Object)(object)inventorySlots[i] != (Object)null) { val2 = inventorySlots[i]; val3 = inventorySlotIcons[i]; } else { val2 = Object.Instantiate(val, parent); ((Object)val2).name = $"BeltBagSlot({i})"; val3 = ResolveIcon(val2); RewireClick(ui, val2, i); } val2.SetActive(true); if ((Object)(object)val3 != (Object)null) { ((Behaviour)val3).enabled = false; } array[i] = val2; array2[i] = val3; } for (int j = num; j < num2; j++) { if ((Object)(object)inventorySlots[j] != (Object)null) { inventorySlots[j].SetActive(false); } } ui.inventorySlots = array; ui.inventorySlotIcons = array2; if (flag) { LayoutSlots(array); } else { RestoreVanillaLayout(array); } _layoutIsOurs = flag; } private static void CaptureMetrics(GameObject[] slots) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) if (_captured) { return; } _vanillaCount = slots.Length; _vanillaPositions = (Vector2[])(object)new Vector2[slots.Length]; RectTransform component = slots[0].GetComponent(); Rect rect = component.rect; _cellSize = ((Rect)(ref rect)).size; float y = component.anchoredPosition.y; float num = float.MaxValue; float num2 = float.MinValue; float num3 = float.MaxValue; float num4 = float.MinValue; RectTransform val = null; RectTransform val2 = null; for (int i = 0; i < slots.Length; i++) { RectTransform component2 = slots[i].GetComponent(); Vector2 anchoredPosition = component2.anchoredPosition; _vanillaPositions[i] = anchoredPosition; if (Mathf.Abs(anchoredPosition.y - y) < 1f) { if ((Object)(object)val == (Object)null && anchoredPosition.x > component.anchoredPosition.x + 1f) { val = component2; } } else if ((Object)(object)val2 == (Object)null) { val2 = component2; } num = Mathf.Min(num, anchoredPosition.x); num2 = Mathf.Max(num2, anchoredPosition.x); num3 = Mathf.Min(num3, anchoredPosition.y); num4 = Mathf.Max(num4, anchoredPosition.y); } _xStep = (((Object)(object)val != (Object)null) ? Mathf.Abs(val.anchoredPosition.x - component.anchoredPosition.x) : Mathf.Max(1f, _cellSize.x * 1.15f)); _yStep = (((Object)(object)val2 != (Object)null) ? Mathf.Abs(val2.anchoredPosition.y - y) : Mathf.Max(1f, _cellSize.y * 1.15f)); _center = new Vector2((num + num2) * 0.5f, (num3 + num4) * 0.5f); _captured = true; } private static void LayoutSlots(GameObject[] slots) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (!_captured) { return; } int num = slots.Length; int num2 = Mathf.Max(1, PluginConfig.SlotsPerRow.Value); float num3 = (float)(Mathf.CeilToInt((float)num / (float)num2) - 1) * _yStep; for (int i = 0; i < num; i++) { int num4 = i / num2; int num5 = i % num2; float num6 = (float)(Mathf.Min(num2, num - num4 * num2) - 1) * _xStep; float num7 = _center.x - num6 * 0.5f + (float)num5 * _xStep; float num8 = _center.y + num3 * 0.5f - (float)num4 * _yStep; RectTransform component = slots[i].GetComponent(); if ((Object)(object)component != (Object)null) { component.anchoredPosition = new Vector2(num7, num8); if (((Vector2)(ref _cellSize)).sqrMagnitude > 0.01f) { component.sizeDelta = _cellSize; } } } } private static void RestoreVanillaLayout(GameObject[] slots) { //IL_003c: 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) if (!_captured || _vanillaPositions == null) { return; } int num = Mathf.Min(slots.Length, _vanillaPositions.Length); for (int i = 0; i < num; i++) { RectTransform component = slots[i].GetComponent(); if (!((Object)(object)component == (Object)null)) { component.anchoredPosition = _vanillaPositions[i]; if (((Vector2)(ref _cellSize)).sqrMagnitude > 0.01f) { component.sizeDelta = _cellSize; } } } } private static void DisableLayoutGroups(Transform container) { LayoutGroup[] components = ((Component)container).GetComponents(); for (int i = 0; i < components.Length; i++) { ((Behaviour)components[i]).enabled = false; } ContentSizeFitter[] components2 = ((Component)container).GetComponents(); for (int i = 0; i < components2.Length; i++) { ((Behaviour)components2[i]).enabled = false; } } private static Image ResolveIcon(GameObject slotClone) { if (string.IsNullOrEmpty(_iconPath)) { return slotClone.GetComponent(); } Transform val = slotClone.transform.Find(_iconPath); if (!((Object)(object)val != (Object)null)) { return slotClone.GetComponentInChildren(true); } return ((Component)val).GetComponent(); } private static void RewireClick(BeltBagInventoryUI ui, GameObject slot, int index) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown Button componentInChildren = slot.GetComponentInChildren