using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using ArcadeTrophyVault.UI; using ArcadeTrophyVault.Visuals; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering; 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: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.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 ArcadeTrophyVault { [BepInPlugin("arcade.valheim.arcadetrophyvault", "ArcadeTrophyVault", "1.2.0")] [BepInProcess("valheim.exe")] [BepInProcess("valheim_server.exe")] public class ArcadeTrophyVaultPlugin : BaseUnityPlugin { public const string PluginGuid = "arcade.valheim.arcadetrophyvault"; public const string PluginName = "ArcadeTrophyVault"; public const string PluginVersion = "1.2.0"; private Harmony _harmony; internal static ManualLogSource Log { get; private set; } private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; _harmony = new Harmony("arcade.valheim.arcadetrophyvault"); try { ModConfig.Init(((BaseUnityPlugin)this).Config); _harmony.PatchAll(typeof(ArcadeTrophyVaultPlugin).Assembly); Log.LogInfo((object)"ArcadeTrophyVault v1.2.0 loaded and patches applied!"); } catch (Exception arg) { Log.LogError((object)$"ArcadeTrophyVault failed to patch: {arg}"); } } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } public static class ModConfig { public static ConfigEntry CraftFromVault; public static ConfigEntry CraftRange; public static ConfigEntry PickupEnabled; public static ConfigEntry PickupRange; public static ConfigEntry PickupInterval; public static ConfigEntry PickupNotify; public static ConfigFile Config { get; private set; } public static void Init(ConfigFile config) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown Config = config; CraftFromVault = config.Bind("1 - Crafting", "CraftFromVault", true, "Workbenches, forges, cauldrons and the hammer automatically craft using trophies stored in nearby Trophy Vaults."); CraftRange = config.Bind("1 - Crafting", "Range", 20f, new ConfigDescription("Distance in meters from the player to nearby Trophy Vaults for crafting stations and hammer.", (AcceptableValueBase)(object)new AcceptableValueRange(2f, 500f), Array.Empty())); PickupEnabled = config.Bind("2 - Ground Pickup", "Enabled", true, "Trophies lying or dropped on the ground near a Trophy Vault are automatically pulled into the vault."); PickupRange = config.Bind("2 - Ground Pickup", "Range", 20f, new ConfigDescription("Distance in meters from a Trophy Vault to pull in dropped trophies on the ground.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 100f), Array.Empty())); PickupInterval = config.Bind("2 - Ground Pickup", "Interval", 1f, new ConfigDescription("Seconds between scans for trophies lying on the ground.", (AcceptableValueBase)(object)new AcceptableValueRange(0.25f, 10f), Array.Empty())); PickupNotify = config.Bind("2 - Ground Pickup", "ShowNotification", true, "Show a top-left HUD message when a dropped trophy is absorbed into the vault."); } } public class TrophyEntry { public string PrefabName; public string SharedName; public string LocalizedName; public Sprite Icon; public ItemDrop Drop; public int BiomeOrder = 9999; public string BiomeName = "Modded"; } public static class TrophyDatabase { private static readonly List _allTrophies = new List(); private static readonly Dictionary _aliasToCanonical = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary> _canonicalToAliases = new Dictionary>(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary _byPrefab = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary OfficialWikiOrder = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "TrophyBoar", 1 }, { "TrophyDeer", 2 }, { "TrophyNeck", 3 }, { "TrophyEikthyr", 4 }, { "TrophyGreyling", 10 }, { "TrophyGreydwarf", 11 }, { "TrophyGreydwarfBrute", 12 }, { "TrophyGreydwarfShaman", 13 }, { "TrophySkeletonPoison", 14 }, { "TrophySkeleton", 15 }, { "TrophyGhost", 16 }, { "TrophyFrostTroll", 17 }, { "TrophyTroll", 17 }, { "TrophyForestTroll", 17 }, { "TrophyBjorn", 18 }, { "TrophyBear", 18 }, { "Trophy_Bear", 18 }, { "TrophySkeletonHildir", 19 }, { "TrophyBrenna", 19 }, { "TrophyTheElder", 20 }, { "TrophyWrithan", 21 }, { "TrophyAbomination", 22 }, { "TrophyBlob", 23 }, { "TrophyDraugr", 24 }, { "TrophyDraugrFem", 24 }, { "TrophyDraugrElite", 25 }, { "TrophyLeech", 26 }, { "TrophySurtling", 27 }, { "TrophyWraith", 28 }, { "TrophyKvastur", 29 }, { "TrophyBonemass", 30 }, { "TrophyCultist", 31 }, { "TrophyHatchling", 32 }, { "TrophyFenring", 33 }, { "TrophySGolem", 34 }, { "TrophyUlv", 35 }, { "TrophyWolf", 36 }, { "TrophyBat", 37 }, { "TrophyCultist_Hildir", 38 }, { "TrophyGeirrhafa", 38 }, { "TrophyDragonQueen", 39 }, { "TrophyDeathsquito", 40 }, { "TrophyGoblin", 41 }, { "TrophyGoblinBrute", 42 }, { "TrophyGoblinShaman", 43 }, { "TrophyGrowth", 44 }, { "TrophyLox", 45 }, { "TrophyBjornUndead", 46 }, { "TrophyVile", 46 }, { "TrophyGoblinBruteBrosShaman", 47 }, { "TrophyZil", 47 }, { "TrophyGoblinBruteBrosBrute", 48 }, { "TrophyThungr", 48 }, { "TrophyGoblinKing", 49 }, { "TrophySerpent", 50 }, { "TrophyDvergr", 60 }, { "TrophyHare", 61 }, { "TrophyGjall", 62 }, { "TrophySeeker", 63 }, { "TrophySeekerBrute", 64 }, { "TrophyTick", 65 }, { "TrophySeekerQueen", 69 }, { "TrophyAsksvin", 70 }, { "TrophyBonemawSerpent", 71 }, { "TrophyBonemaw", 71 }, { "TrophyFallenValkyrie", 72 }, { "TrophyCharredArcher", 73 }, { "TrophyMorgen", 74 }, { "TrophyVolture", 75 }, { "TrophyCharredMage", 76 }, { "TrophyCharredMelee", 77 }, { "TrophyFader", 79 }, { "TrophyBarka", 90 }, { "TrophyElaking", 91 }, { "TrophyEyeless", 92 }, { "TrophyPolarBear", 93 }, { "TrophyMammoth", 94 } }; public static IReadOnlyList AllTrophies { get { if (_allTrophies.Count == 0) { Refresh(); } return _allTrophies; } } public static void Refresh() { //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Invalid comparison between Unknown and I4 if ((Object)(object)ObjectDB.instance == (Object)null || ObjectDB.instance.m_items == null || ObjectDB.instance.m_items.Count == 0) { return; } _allTrophies.Clear(); _aliasToCanonical.Clear(); _canonicalToAliases.Clear(); _byPrefab.Clear(); RegisterAlias("TrophyBear", "TrophyBjorn"); RegisterAlias("Trophy_Bear", "TrophyBjorn"); RegisterAlias("TrophyBlackBear", "TrophyBjorn"); RegisterAlias("TrophyGrizzlyBear", "TrophyBjorn"); RegisterAlias("TrophyBrownBear", "TrophyBjorn"); RegisterAlias("TrophyVile", "TrophyBjornUndead"); RegisterAlias("TrophyBrenna", "TrophySkeletonHildir"); RegisterAlias("TrophyGeirrhafa", "TrophyCultist_Hildir"); RegisterAlias("TrophyZil", "TrophyGoblinBruteBrosShaman"); RegisterAlias("TrophyThungr", "TrophyGoblinBruteBrosBrute"); RegisterAlias("TrophyBonemaw", "TrophyBonemawSerpent"); RegisterAlias("TrophyTroll", "TrophyFrostTroll"); RegisterAlias("TrophyForestTroll", "TrophyFrostTroll"); RegisterAlias("TrophyDraugrFem", "TrophyDraugr"); RegisterAlias("trophy_horse", "trophy_horse"); RegisterAlias("TrophyHorse", "trophy_horse"); HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); HashSet hashSet2 = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (GameObject item in ObjectDB.instance.m_items) { if ((Object)(object)item == (Object)null) { continue; } ItemDrop component = item.GetComponent(); if ((Object)(object)component == (Object)null || component.m_itemData == null || component.m_itemData.m_shared == null) { continue; } SharedData shared = component.m_itemData.m_shared; if ((int)shared.m_itemType != 13 && ((Object)item).name.IndexOf("trophy", StringComparison.OrdinalIgnoreCase) < 0 && (shared.m_name == null || shared.m_name.IndexOf("trophy", StringComparison.OrdinalIgnoreCase) < 0)) { continue; } Sprite icon = component.m_itemData.GetIcon(); if ((Object)(object)icon == (Object)null) { continue; } string name = ((Object)item).name; if (hashSet2.Contains(name)) { continue; } hashSet2.Add(name); string text = ((Localization.instance != null) ? Localization.instance.Localize(shared.m_name) : shared.m_name); if (string.IsNullOrEmpty(text) || text.Trim().Length == 0 || text.StartsWith("[") || text.EndsWith("]") || text.Contains("item_trophy_")) { continue; } string text2 = shared.m_name; if (string.IsNullOrEmpty(text2)) { text2 = text; } if (hashSet.Contains(text2)) { foreach (TrophyEntry allTrophy in _allTrophies) { if (string.Equals(allTrophy.SharedName, text2, StringComparison.OrdinalIgnoreCase)) { RegisterAlias(name, allTrophy.PrefabName); break; } } continue; } hashSet.Add(text2); int officialWikiOrder = GetOfficialWikiOrder(name, shared.m_name, text); string biomeName = GetBiomeName(officialWikiOrder); TrophyEntry trophyEntry = new TrophyEntry { PrefabName = name, SharedName = shared.m_name, LocalizedName = text, Icon = icon, Drop = component, BiomeOrder = officialWikiOrder, BiomeName = biomeName }; _allTrophies.Add(trophyEntry); _byPrefab[name] = trophyEntry; RegisterAlias(name, name); if (!string.IsNullOrEmpty(shared.m_name)) { RegisterAlias(shared.m_name, name); } if (!string.IsNullOrEmpty(text)) { RegisterAlias(text, name); } } _allTrophies.Sort((TrophyEntry a, TrophyEntry b) => (a.BiomeOrder != b.BiomeOrder) ? a.BiomeOrder.CompareTo(b.BiomeOrder) : string.Compare(a.LocalizedName, b.LocalizedName, StringComparison.CurrentCultureIgnoreCase)); ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogInfo((object)$"TrophyDatabase refreshed: {_allTrophies.Count} trophies strictly ordered by official Wiki Biome progression."); } } public static void RegisterAlias(string alias, string canonical) { if (!string.IsNullOrEmpty(alias) && !string.IsNullOrEmpty(canonical)) { _aliasToCanonical[alias] = canonical; if (!_canonicalToAliases.TryGetValue(canonical, out var value)) { value = new List(); _canonicalToAliases[canonical] = value; } if (!value.Exists((string x) => string.Equals(x, alias, StringComparison.OrdinalIgnoreCase))) { value.Add(alias); } } } public static string GetBiomeName(int order) { if (order >= 1 && order <= 9) { return "Meadows"; } if (order >= 10 && order <= 20) { return "Black Forest"; } if (order >= 21 && order <= 30) { return "Swamp"; } if (order >= 31 && order <= 39) { return "Mountain"; } if (order >= 40 && order <= 49) { return "Plains"; } if (order >= 50 && order <= 59) { return "Ocean"; } if (order >= 60 && order <= 69) { return "Mistlands"; } if (order >= 70 && order <= 79) { return "Ashlands"; } if (order >= 90 && order <= 99) { return "Deep North"; } return "Modded"; } public static int GetOfficialWikiOrder(string prefab, string sharedName = null, string locName = null) { if (!string.IsNullOrEmpty(prefab) && OfficialWikiOrder.TryGetValue(prefab, out var value)) { return value; } string text = (prefab + " " + sharedName + " " + locName).ToLowerInvariant(); if (text.Contains("eikthyr")) { return 4; } if (text.Contains("boar")) { return 1; } if (text.Contains("deer")) { return 2; } if (text.Contains("neck")) { return 3; } if (text.Contains("elder")) { return 20; } if (text.Contains("greyling")) { return 10; } if (text.Contains("greydwarfbrute")) { return 12; } if (text.Contains("greydwarfshaman")) { return 13; } if (text.Contains("greydwarf")) { return 11; } if (text.Contains("skeletonpoison") || text.Contains("rancid")) { return 14; } if (text.Contains("skeletonhildir") || text.Contains("brenna")) { return 19; } if (text.Contains("skeleton")) { return 15; } if (text.Contains("troll")) { return 17; } if (text.Contains("ghost")) { return 16; } if (text.Contains("bjornundead") || text.Contains("vile")) { return 46; } if (text.Contains("bjorn") || text.Contains("bear") || text.Contains("grizzly") || text.Contains("ursus")) { return 18; } if (text.Contains("bonemass")) { return 30; } if (text.Contains("writhan")) { return 21; } if (text.Contains("abomination")) { return 22; } if (text.Contains("blob")) { return 23; } if (text.Contains("draugrelite")) { return 25; } if (text.Contains("draugr")) { return 24; } if (text.Contains("leech")) { return 26; } if (text.Contains("surtling")) { return 27; } if (text.Contains("wraith")) { return 28; } if (text.Contains("kvastur")) { return 29; } if (text.Contains("dragonqueen") || text.Contains("moder")) { return 39; } if (text.Contains("wolf")) { return 36; } if (text.Contains("hatchling") || text.Contains("drake")) { return 32; } if (text.Contains("fenring")) { return 33; } if (text.Contains("cultist_hildir") || text.Contains("geirrhafa")) { return 38; } if (text.Contains("cultist")) { return 34; } if (text.Contains("ulv")) { return 35; } if (text.Contains("bat")) { return 37; } if (text.Contains("sgolem") || text.Contains("stonegolem") || text.Contains("golem")) { return 34; } if (text.Contains("goblinking") || text.Contains("yagluth")) { return 49; } if (text.Contains("deathsquito")) { return 40; } if (text.Contains("lox")) { return 45; } if (text.Contains("goblinbrutebrosshaman") || text.Contains("zil")) { return 47; } if (text.Contains("goblinbrutebrosbrute") || text.Contains("thungr")) { return 48; } if (text.Contains("goblinbrute") || text.Contains("berserker")) { return 42; } if (text.Contains("goblinshaman")) { return 43; } if (text.Contains("goblin") || text.Contains("fuling")) { return 41; } if (text.Contains("growth")) { return 44; } if (text.Contains("serpent")) { return 50; } if (text.Contains("seekerqueen")) { return 69; } if (text.Contains("seekerbrute") || text.Contains("soldiers")) { return 64; } if (text.Contains("seeker")) { return 63; } if (text.Contains("gjall")) { return 62; } if (text.Contains("tick")) { return 65; } if (text.Contains("hare")) { return 61; } if (text.Contains("dvergr")) { return 60; } if (text.Contains("fader")) { return 79; } if (text.Contains("asksvin")) { return 70; } if (text.Contains("bonemaw")) { return 71; } if (text.Contains("fallenvalkyrie") || text.Contains("valkyrie")) { return 72; } if (text.Contains("charredarcher")) { return 73; } if (text.Contains("morgen")) { return 74; } if (text.Contains("volture")) { return 75; } if (text.Contains("charredwarlock") || text.Contains("charredmage")) { return 76; } if (text.Contains("charred")) { return 77; } if (text.Contains("barka")) { return 90; } if (text.Contains("elaking")) { return 91; } if (text.Contains("eyeless")) { return 92; } if (text.Contains("polarbear") || text.Contains("polar_bear")) { return 93; } if (text.Contains("mammoth")) { return 94; } return 9999; } public static bool IsTrophyItem(string sharedName, string prefabName) { if (Find(prefabName) != null || Find(sharedName) != null) { return true; } if (sharedName != null && (sharedName.IndexOf("trophy", StringComparison.OrdinalIgnoreCase) >= 0 || sharedName.IndexOf("bjorn", StringComparison.OrdinalIgnoreCase) >= 0 || sharedName.IndexOf("horse", StringComparison.OrdinalIgnoreCase) >= 0)) { return true; } if (prefabName != null && (prefabName.IndexOf("trophy", StringComparison.OrdinalIgnoreCase) >= 0 || prefabName.IndexOf("bjorn", StringComparison.OrdinalIgnoreCase) >= 0 || prefabName.IndexOf("horse", StringComparison.OrdinalIgnoreCase) >= 0)) { return true; } return false; } public static string GetCanonicalPrefab(string prefabOrItemName) { if (string.IsNullOrEmpty(prefabOrItemName)) { return prefabOrItemName; } if (_aliasToCanonical.TryGetValue(prefabOrItemName, out var value)) { return value; } return prefabOrItemName; } public static List GetAliasesFor(string canonicalPrefab) { if (string.IsNullOrEmpty(canonicalPrefab)) { return null; } if (_canonicalToAliases.TryGetValue(canonicalPrefab, out var value)) { return value; } return null; } public static TrophyEntry Find(string prefabName) { if (string.IsNullOrEmpty(prefabName)) { return null; } string canonicalPrefab = GetCanonicalPrefab(prefabName); if (_byPrefab.TryGetValue(canonicalPrefab, out var value)) { return value; } return null; } } public class TrophyVault : MonoBehaviour, Hoverable, Interactable { public static readonly List All = new List(); private ZNetView _nview; private Piece _piece; private const string CountKeyPrefix = "tv_cnt_"; public bool IsValid => (Object)(object)_nview != (Object)null && _nview.IsValid(); private void Awake() { _nview = ((Component)this).GetComponent(); _piece = ((Component)this).GetComponent(); if ((Object)(object)_nview != (Object)null && _nview.GetZDO() != null) { All.Add(this); _nview.Register("RPC_AddTrophy", (Action)RPC_AddTrophy); _nview.Register("RPC_TakeTrophy", (Action)RPC_TakeTrophy); } } private void OnDestroy() { All.Remove(this); } public string GetHoverText() { if (!IsValid) { return string.Empty; } string text = (((Object)(object)_piece != (Object)null) ? _piece.m_name : "Trophy Vault"); int totalTrophiesStored = GetTotalTrophiesStored(); int distinctTrophiesStored = GetDistinctTrophiesStored(); string text2 = "" + text + ""; string text3 = $"Trophies: {totalTrophiesStored} ({distinctTrophiesStored} types)"; string text4 = "[E] Open Trophy Vault"; string text5 = "[1-8] Quick Deposit Trophy"; return text2 + "\n" + text3 + "\n" + text4 + "\n" + text5; } public string GetHoverName() { return ((Object)(object)_piece != (Object)null) ? _piece.m_name : "Trophy Vault"; } public float GetHoverOffset() { return 0f; } public bool Interact(Humanoid user, bool hold, bool alt) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (hold || !IsValid) { return false; } Player val = (Player)(object)((user is Player) ? user : null); if ((Object)(object)val == (Object)null) { return false; } if (!PrivateArea.CheckAccess(((Component)this).transform.position, 0f, true, false)) { return false; } TrophyVaultUI.Open(this); return true; } public bool UseItem(Humanoid user, ItemData item) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 if (item == null || !IsValid) { return false; } if ((int)item.m_shared.m_itemType != 13 && !((Object)item.m_dropPrefab).name.StartsWith("Trophy", StringComparison.OrdinalIgnoreCase)) { ((Character)user).Message((MessageType)2, "Only trophies can be placed in the Trophy Vault!", 0, (Sprite)null, false); return false; } DepositTrophy(((Object)item.m_dropPrefab).name, item.m_stack); user.GetInventory().RemoveItem(item); ((Character)user).Message((MessageType)2, $"Stored {item.m_stack}x {item.m_shared.m_name}", 0, (Sprite)null, false); return true; } public int GetTrophyCount(string prefabName) { if (!IsValid || string.IsNullOrEmpty(prefabName)) { return 0; } string canonicalPrefab = TrophyDatabase.GetCanonicalPrefab(prefabName); int num = _nview.GetZDO().GetInt("tv_cnt_" + canonicalPrefab, 0); List aliasesFor = TrophyDatabase.GetAliasesFor(canonicalPrefab); if (aliasesFor != null) { for (int i = 0; i < aliasesFor.Count; i++) { string text = aliasesFor[i]; if (!string.Equals(text, canonicalPrefab, StringComparison.OrdinalIgnoreCase)) { num += _nview.GetZDO().GetInt("tv_cnt_" + text, 0); } } } return num; } public void DepositTrophy(string prefabName, int amount) { if (IsValid && amount > 0 && !string.IsNullOrEmpty(prefabName)) { string canonicalPrefab = TrophyDatabase.GetCanonicalPrefab(prefabName); if (_nview.IsOwner()) { RPC_AddTrophy(0L, canonicalPrefab, amount); return; } _nview.InvokeRPC("RPC_AddTrophy", new object[2] { canonicalPrefab, amount }); } } public void WithdrawTrophy(string prefabName, int amount) { if (IsValid && amount > 0 && !string.IsNullOrEmpty(prefabName)) { string canonicalPrefab = TrophyDatabase.GetCanonicalPrefab(prefabName); if (_nview.IsOwner()) { RPC_TakeTrophy(0L, canonicalPrefab, amount); return; } _nview.InvokeRPC("RPC_TakeTrophy", new object[2] { canonicalPrefab, amount }); } } private void RPC_AddTrophy(long sender, string prefabName, int amount) { if (IsValid && _nview.IsOwner()) { string text = "tv_cnt_" + prefabName; int num = _nview.GetZDO().GetInt(text, 0); _nview.GetZDO().Set(text, num + amount); } } private void RPC_TakeTrophy(long sender, string prefabName, int amount) { if (!IsValid || !_nview.IsOwner()) { return; } string canonicalPrefab = TrophyDatabase.GetCanonicalPrefab(prefabName); string text = "tv_cnt_" + canonicalPrefab; int num = _nview.GetZDO().GetInt(text, 0); if (num >= amount) { _nview.GetZDO().Set(text, num - amount); return; } int num2 = amount - num; _nview.GetZDO().Set(text, 0); List aliasesFor = TrophyDatabase.GetAliasesFor(canonicalPrefab); if (aliasesFor == null) { return; } for (int i = 0; i < aliasesFor.Count; i++) { if (num2 <= 0) { break; } string text2 = aliasesFor[i]; if (!string.Equals(text2, canonicalPrefab, StringComparison.OrdinalIgnoreCase)) { string text3 = "tv_cnt_" + text2; int num3 = _nview.GetZDO().GetInt(text3, 0); if (num3 > 0) { int num4 = Mathf.Min(num3, num2); _nview.GetZDO().Set(text3, num3 - num4); num2 -= num4; } } } } public int GetTotalTrophiesStored() { if (!IsValid) { return 0; } int num = 0; foreach (TrophyEntry allTrophy in TrophyDatabase.AllTrophies) { num += GetTrophyCount(allTrophy.PrefabName); } return num; } public int GetDistinctTrophiesStored() { if (!IsValid) { return 0; } int num = 0; foreach (TrophyEntry allTrophy in TrophyDatabase.AllTrophies) { if (GetTrophyCount(allTrophy.PrefabName) > 0) { num++; } } return num; } } public static class TrophyVaultCrafting { private static int _contextDepth; public static float CraftRange => (ModConfig.CraftRange != null) ? ModConfig.CraftRange.Value : 20f; public static bool IsActive => _contextDepth > 0; public static void Enter() { _contextDepth++; } public static void Exit() { if (_contextDepth > 0) { _contextDepth--; } } public static int GetNearbyVaultTrophyCount(string sharedOrPrefabName) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || string.IsNullOrEmpty(sharedOrPrefabName)) { return 0; } if (ModConfig.CraftFromVault != null && !ModConfig.CraftFromVault.Value) { return 0; } string canonicalPrefab = TrophyDatabase.GetCanonicalPrefab(sharedOrPrefabName); int num = 0; float craftRange = CraftRange; float num2 = craftRange * craftRange; Vector3 position = ((Component)localPlayer).transform.position; for (int i = 0; i < TrophyVault.All.Count; i++) { TrophyVault trophyVault = TrophyVault.All[i]; if (!((Object)(object)trophyVault == (Object)null) && trophyVault.IsValid) { Vector3 val = ((Component)trophyVault).transform.position - position; if (!(((Vector3)(ref val)).sqrMagnitude > num2) && PrivateArea.CheckAccess(((Component)trophyVault).transform.position, 0f, false, false)) { num += trophyVault.GetTrophyCount(canonicalPrefab); } } } return num; } public static int WithdrawForCraft(string sharedOrPrefabName, int amount) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || amount <= 0 || string.IsNullOrEmpty(sharedOrPrefabName)) { return 0; } if (ModConfig.CraftFromVault != null && !ModConfig.CraftFromVault.Value) { return 0; } string canonicalPrefab = TrophyDatabase.GetCanonicalPrefab(sharedOrPrefabName); int num = 0; float craftRange = CraftRange; float num2 = craftRange * craftRange; Vector3 position = ((Component)localPlayer).transform.position; for (int i = 0; i < TrophyVault.All.Count; i++) { if (num >= amount) { break; } TrophyVault trophyVault = TrophyVault.All[i]; if ((Object)(object)trophyVault == (Object)null || !trophyVault.IsValid) { continue; } Vector3 val = ((Component)trophyVault).transform.position - position; if (!(((Vector3)(ref val)).sqrMagnitude > num2) && PrivateArea.CheckAccess(((Component)trophyVault).transform.position, 0f, false, false)) { int trophyCount = trophyVault.GetTrophyCount(canonicalPrefab); if (trophyCount > 0) { int num3 = Mathf.Min(trophyCount, amount - num); trophyVault.WithdrawTrophy(canonicalPrefab, num3); num += num3; } } } if (num > 0) { ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogInfo((object)$"Craft from Vault: consumed {num}x {canonicalPrefab} from nearby Trophy Vault."); } } return num; } } [HarmonyPatch(typeof(Player), "HaveRequirementItems")] internal static class Player_HaveRequirementItems_Patch { private static void Prefix(Player __instance, out bool __state) { if ((Object)(object)__instance != (Object)null && (Object)(object)__instance == (Object)(object)Player.m_localPlayer) { TrophyVaultCrafting.Enter(); __state = true; } else { __state = false; } } private static Exception Finalizer(Exception __exception, bool __state) { if (__state) { TrophyVaultCrafting.Exit(); } return __exception; } } [HarmonyPatch(typeof(Player), "HaveRequirements", new Type[] { typeof(Piece), typeof(RequirementMode) })] internal static class Player_HaveRequirementsPiece_Patch { private static void Prefix(Player __instance, out bool __state) { if ((Object)(object)__instance != (Object)null && (Object)(object)__instance == (Object)(object)Player.m_localPlayer) { TrophyVaultCrafting.Enter(); __state = true; } else { __state = false; } } private static Exception Finalizer(Exception __exception, bool __state) { if (__state) { TrophyVaultCrafting.Exit(); } return __exception; } } [HarmonyPatch(typeof(InventoryGui), "SetupRequirement")] internal static class InventoryGui_SetupRequirement_Patch { private static void Prefix(Player player, out bool __state) { if ((Object)(object)player != (Object)null && (Object)(object)player == (Object)(object)Player.m_localPlayer) { TrophyVaultCrafting.Enter(); __state = true; } else { __state = false; } } private static Exception Finalizer(Exception __exception, bool __state) { if (__state) { TrophyVaultCrafting.Exit(); } return __exception; } } [HarmonyPatch(typeof(Inventory), "CountItems", new Type[] { typeof(string), typeof(int), typeof(bool) })] internal static class Inventory_CountItems_Patch { private static void Postfix(Inventory __instance, string name, int quality, ref int __result) { if (TrophyVaultCrafting.IsActive && name != null && quality <= 1 && (Object)(object)Player.m_localPlayer != (Object)null && __instance == ((Humanoid)Player.m_localPlayer).GetInventory()) { __result += TrophyVaultCrafting.GetNearbyVaultTrophyCount(name); } } } [HarmonyPatch(typeof(Inventory), "HaveItem", new Type[] { typeof(string), typeof(bool) })] internal static class Inventory_HaveItem_Patch { private static void Postfix(Inventory __instance, string name, ref bool __result) { if (!__result && TrophyVaultCrafting.IsActive && name != null && (Object)(object)Player.m_localPlayer != (Object)null && __instance == ((Humanoid)Player.m_localPlayer).GetInventory() && TrophyVaultCrafting.GetNearbyVaultTrophyCount(name) > 0) { __result = true; } } } [HarmonyPatch(typeof(Player), "ConsumeResources")] internal static class Player_ConsumeResources_Patch { private static void Prefix(Player __instance, Requirement[] requirements, int qualityLevel, int multiplier, out Dictionary __state) { __state = new Dictionary(); if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || requirements == null) { return; } Inventory inventory = ((Humanoid)__instance).GetInventory(); if (inventory == null) { return; } foreach (Requirement val in requirements) { if (val != null && (Object)(object)val.m_resItem != (Object)null) { string name = val.m_resItem.m_itemData.m_shared.m_name; if (TrophyDatabase.IsTrophyItem(name, ((Object)((Component)val.m_resItem).gameObject).name)) { __state[name] = inventory.CountItems(name, -1, true); } } } } private static void Postfix(Player __instance, Requirement[] requirements, int qualityLevel, int multiplier, Dictionary __state) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || requirements == null || __state == null) { return; } CraftingStation currentCraftingStation = __instance.GetCurrentCraftingStation(); foreach (Requirement val in requirements) { if (val == null || (Object)(object)val.m_resItem == (Object)null || ((Object)(object)currentCraftingStation != (Object)null && currentCraftingStation.m_upgrader != val.m_upgraderResource) || ((Object)(object)currentCraftingStation == (Object)null && val.m_upgraderResource)) { continue; } int num = val.GetAmount(qualityLevel) * multiplier; if (num <= 0) { continue; } string name = val.m_resItem.m_itemData.m_shared.m_name; if (__state.TryGetValue(name, out var value)) { int num2 = Mathf.Min(value, num); int num3 = num - num2; if (num3 > 0) { TrophyVaultCrafting.WithdrawForCraft(name, num3); } } } } } [HarmonyPatch(typeof(ZNetScene), "Awake")] internal static class ZNetScene_Awake_Patch { [HarmonyPostfix] private static void Postfix(ZNetScene __instance) { if ((Object)(object)__instance == (Object)null) { return; } try { TrophyVaultPrefabs.Init(__instance); } catch (Exception arg) { ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogError((object)$"Failed to init Trophy Vault prefab in ZNetScene: {arg}"); } } } } [HarmonyPatch(typeof(ObjectDB), "Awake")] internal static class ObjectDB_Awake_Patch { [HarmonyPostfix] private static void Postfix(ObjectDB __instance) { if ((Object)(object)__instance == (Object)null || __instance.m_items.Count == 0) { return; } try { TrophyDatabase.Refresh(); TrophyVaultPrefabs.TryFinalize(); } catch (Exception arg) { ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogError((object)$"Failed to refresh TrophyDatabase in ObjectDB: {arg}"); } } } } [HarmonyPatch(typeof(ObjectDB), "CopyOtherDB")] internal static class ObjectDB_CopyOtherDB_Patch { [HarmonyPostfix] private static void Postfix() { try { TrophyDatabase.Refresh(); TrophyVaultPrefabs.TryFinalize(); } catch (Exception arg) { ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogError((object)$"Failed in ObjectDB.CopyOtherDB: {arg}"); } } } } [HarmonyPatch(typeof(InventoryGui), "Hide")] internal static class InventoryGui_Hide_Patch { [HarmonyPostfix] private static void Postfix() { TrophyVaultUI.Close(); } } [HarmonyPatch(typeof(Player), "UpdateKnownRecipesList")] internal static class Player_UpdateKnownRecipesList_Patch { private static readonly FieldInfo KnownRecipesField = AccessTools.Field(typeof(Player), "m_knownRecipes"); [HarmonyPostfix] private static void Postfix(Player __instance) { if ((Object)(object)__instance == (Object)null || (Object)(object)TrophyVaultPrefabs.VaultPrefab == (Object)null || KnownRecipesField == null) { return; } try { Piece component = TrophyVaultPrefabs.VaultPrefab.GetComponent(); if ((Object)(object)component != (Object)null && KnownRecipesField.GetValue(__instance) is HashSet hashSet && !hashSet.Contains(component.m_name)) { hashSet.Add(component.m_name); } } catch { } } } [HarmonyPatch(typeof(Player), "TakeInput")] internal static class Player_TakeInput_Patch { [HarmonyPostfix] private static void Postfix(ref bool __result) { if (TrophyVaultUI.IsOpen) { __result = false; } } } [HarmonyPatch(typeof(StoreGui), "IsVisible")] internal static class StoreGui_IsVisible_Patch { [HarmonyPostfix] private static void Postfix(ref bool __result) { if (TrophyVaultUI.IsOpen) { __result = true; } } } [HarmonyPatch(typeof(GameCamera), "UpdateMouseCapture")] internal static class GameCamera_UpdateMouseCapture_Patch { [HarmonyPostfix] private static void Postfix() { if (TrophyVaultUI.IsOpen) { ZCursor.LockState = (CursorLockMode)0; ZCursor.Show(); } } } [HarmonyPatch(typeof(Game), "Start")] internal static class Game_Start_Patch { [HarmonyPostfix] private static void Postfix(Game __instance) { if ((Object)(object)__instance != (Object)null && (Object)(object)((Component)__instance).gameObject.GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogInfo((object)"TrophyVaultPickup component attached to Game."); } } } } public class TrophyVaultPickup : MonoBehaviour { private static readonly FieldInfo InstancesField = AccessTools.Field(typeof(ItemDrop), "s_instances"); private static TrophyVaultPickup _instance; private float _timer; private static bool _loggedError; private void Awake() { _instance = this; } private void OnDestroy() { if ((Object)(object)_instance == (Object)(object)this) { _instance = null; } } public static void CheckAllNow() { if ((Object)(object)_instance != (Object)null) { _instance.ScanAndPickup(); } } private void Update() { _timer -= Time.deltaTime; if (!(_timer > 0f)) { float num = ((ModConfig.PickupInterval != null) ? ModConfig.PickupInterval.Value : 1f); _timer = Mathf.Max(0.25f, num); ScanAndPickup(); } } private void ScanAndPickup() { if ((ModConfig.PickupEnabled != null && !ModConfig.PickupEnabled.Value) || TrophyVault.All.Count == 0 || (Object)(object)Player.m_localPlayer == (Object)null || !(InstancesField?.GetValue(null) is List { Count: not 0 } list)) { return; } List list2 = list.ToList(); for (int i = 0; i < list2.Count; i++) { ItemDrop val = list2[i]; if ((Object)(object)val == (Object)null) { continue; } try { TryAbsorb(val); } catch (Exception arg) { if (!_loggedError) { _loggedError = true; ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogError((object)$"[ArcadeTrophyVault] Pickup error for '{((Object)val).name}': {arg}"); } } } } } public static bool TryAbsorb(ItemDrop drop) { //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)drop == (Object)null || drop.IsPiece()) { return false; } ZNetView component = ((Component)drop).GetComponent(); if ((Object)(object)component == (Object)null || !component.IsValid()) { return false; } drop.Load(); ItemData itemData = drop.m_itemData; if (itemData == null || itemData.m_stack <= 0) { return false; } if (!IsTrophy(drop, itemData)) { return false; } float num = ((ModConfig.PickupRange != null) ? ModConfig.PickupRange.Value : 20f); float num2 = num * num; TrophyVault trophyVault = null; float num3 = float.MaxValue; Vector3 position = ((Component)drop).transform.position; for (int i = 0; i < TrophyVault.All.Count; i++) { TrophyVault trophyVault2 = TrophyVault.All[i]; if (!((Object)(object)trophyVault2 == (Object)null) && trophyVault2.IsValid) { Vector3 val = ((Component)trophyVault2).transform.position - position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude <= num2 && sqrMagnitude < num3 && PrivateArea.CheckAccess(((Component)trophyVault2).transform.position, 0f, false, false)) { num3 = sqrMagnitude; trophyVault = trophyVault2; } } } if ((Object)(object)trophyVault == (Object)null) { return false; } if (!component.IsOwner()) { component.ClaimOwnership(); } string text = (((Object)(object)itemData.m_dropPrefab != (Object)null) ? ((Object)itemData.m_dropPrefab).name : ((Object)((Component)drop).gameObject).name); if (text.EndsWith("(Clone)")) { text = text.Substring(0, text.Length - 7); } string canonicalPrefab = TrophyDatabase.GetCanonicalPrefab(text); int stack = itemData.m_stack; trophyVault.DepositTrophy(canonicalPrefab, stack); if ((Object)(object)Player.m_localPlayer != (Object)null) { try { EffectList pickupEffects = ((Humanoid)Player.m_localPlayer).m_pickupEffects; if (pickupEffects != null) { pickupEffects.Create(position, Quaternion.identity, (Transform)null, 1f, -1, default(ZDOID)); } } catch { } if (ModConfig.PickupNotify != null && ModConfig.PickupNotify.Value) { float num4 = Vector3.Distance(((Component)Player.m_localPlayer).transform.position, position); if (num4 <= num * 1.5f) { string arg = ((Localization.instance != null && !string.IsNullOrEmpty(itemData.m_shared?.m_name)) ? Localization.instance.Localize(itemData.m_shared.m_name) : canonicalPrefab); ((Character)Player.m_localPlayer).Message((MessageType)1, $"Trophy Vault absorbed {stack}x {arg}", 0, (Sprite)null, false); } } } ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogInfo((object)$"[ArcadeTrophyVault] Vacuum absorbed {stack}x '{canonicalPrefab}' into Trophy Vault!"); } component.Destroy(); return true; } private static bool IsTrophy(ItemDrop drop, ItemData itemData) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 if (itemData == null) { return false; } if (itemData.m_shared != null && (int)itemData.m_shared.m_itemType == 13) { return true; } string prefabName = (((Object)(object)itemData.m_dropPrefab != (Object)null) ? ((Object)itemData.m_dropPrefab).name : ((Object)((Component)drop).gameObject).name); string sharedName = ((itemData.m_shared != null) ? itemData.m_shared.m_name : null); return TrophyDatabase.IsTrophyItem(sharedName, prefabName); } } public static class TrophyVaultPrefabs { public const string PrefabName = "arcade_trophy_vault"; private static GameObject _holder; private static Sprite _customPieceIcon; private const string EmbeddedPieceIconBase64 = "iVBORw0KGgoAAAANSUhEUgAAAI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UUQAFbvYsogAK2ehdxHmCMGCfxEREREREREREREREREREREREFw/8Bkdxl0ahFQ54AAAAASUVORK5CYII="; public static GameObject VaultPrefab { get; private set; } public static void Init(ZNetScene scene) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)scene == (Object)null) { return; } GameObject prefab = scene.GetPrefab("piece_chest_wood"); if ((Object)(object)prefab == (Object)null) { ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogError((object)"Base piece_chest_wood not found in ZNetScene!"); } return; } if ((Object)(object)_holder != (Object)null) { Object.Destroy((Object)(object)_holder); } _holder = new GameObject("ArcadeTrophyVault_Holder"); _holder.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_holder); VaultPrefab = Object.Instantiate(prefab, _holder.transform, false); ((Object)VaultPrefab).name = "arcade_trophy_vault"; MonoBehaviour[] components = VaultPrefab.GetComponents(); foreach (MonoBehaviour val in components) { if (!(val is ZNetView) && !(val is Piece) && !(val is WearNTear)) { Object.DestroyImmediate((Object)(object)val); } } Piece component = VaultPrefab.GetComponent(); component.m_enabled = true; component.m_name = "Trophy Vault"; component.m_description = "Ancient runic cabinet holding and displaying all monster and boss trophies."; component.m_category = (PieceCategory)4; component.m_canBeRemoved = true; ((StaticTarget)component).m_primaryTarget = false; component.m_icon = prefab.GetComponent()?.m_icon; VaultPrefab.AddComponent(); TrophyVaultModel.Build(VaultPrefab, scene); try { Sprite customPieceIcon = GetCustomPieceIcon(); if ((Object)(object)customPieceIcon != (Object)null) { component.m_icon = customPieceIcon; } } catch (Exception ex) { ManualLogSource log2 = ArcadeTrophyVaultPlugin.Log; if (log2 != null) { log2.LogWarning((object)("Icon loading skipped: " + ex.Message)); } } RegisterInScene(scene, VaultPrefab); ManualLogSource log3 = ArcadeTrophyVaultPlugin.Log; if (log3 != null) { log3.LogInfo((object)"Trophy Vault prefab created and registered!"); } TryFinalize(); } public static Sprite GetCustomPieceIcon() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_customPieceIcon != (Object)null) { return _customPieceIcon; } try { byte[] array = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAM10lEQVR4nO1dXYhdRx3/z/3Yu7vZTbI2CFJJYoPED6IkRVqqYlSsQh40RLDk7hL0wReLL6GKL33IiyjkRdKXvpXkRkHTT6NQak1prQ3Y2BIVrKS2BRVETTbZ3M+9Z+T3n4875/Tu5m66u/fMnPnByd5zz5zZ3P395j//mTPzu0QRERERERERERERERERERERERERERERERERERERERERoUFQzrFtZlpS4Fhcao6NhwrlnPj7D95HoeLZCy+P+7+QTwGA/CIQP7d9G129tjjW/0vuBFAE8ue2b6O8IDcCKErIn8sR+blJAovQ6gGXfBP6x5kA5kIARcjyR8U4xJCbLmC1COBmy3t27yRfcOWtd9b02caBSt5DP/5As9OT/PpGs00+kX+/B5+tkteEz7QM8wcKsdXP5uCzbWqfc+LYzjX194/+eil1nucIcPzIDnqvn60QOcDx735mpHInf/LS0PfzNoxaz882DpTG/R+IGC+iAAqOTe8CxhH+OPEYln2I9U2C8hTaR4UYxwjgzve/b9Uy//j3/4ZmyEiU1poDSId4ucIHF+v0V8Ds3nv5bIVIAsfR6iX/WYU6BdtWFZKE1KfrHA18QSVk8hXh+FkiKpVIgnwjABxJQiQSLshCKKAIghDAsD7eJV+WykTlMslyhV772xt8ff9ddxFRnwgaEAnrgUXgVlIAQXgvgKF9PBOvWrsUJaJKhWRlggiHKVutkRBdksuGdfwzUAATr0/XK0fII7wWwKAnd0g3zdaQX9bkT0yqw2BiUpGL+/vLJCSigFujYp+v5+Gx6QbBawFYBdh+XpPOh1D9frmqyZ8iqrkCmLJVCIgF+QDnBokSQyK5azBaCFUB3k8EKX5AtiBZqtD8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sLjVFUAKggmNuCPH3HNiXKnPx0uUwBeAKYc/unVQUXHnrnRTxhvws8Yb8Kpa1Y1a719tQAcQkcAxYqdVnyd8MRAHkiHhgM8kfWxdQ1DzgniHE36rVB9UFGOJX+kMUDRfH1OrHEgGK2upXwyjEBxUBsllwkXF1TBM/WcQkMKdAywc2svUDUQA5xEaH/bDWBAaG3iaSD8QIULCQn0UUQAFbvYsogAK2ehdxHmCMGCfxEREREREREREREREREREREREFw/8Bkdxl0ahFQ54AAAAASUVORK5CYII="); Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array)) { _customPieceIcon = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); return _customPieceIcon; } } catch (Exception ex) { ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogError((object)("Failed to load custom piece icon: " + ex.Message)); } } return null; } private static void RegisterInScene(ZNetScene scene, GameObject prefab) { if (!((Object)(object)scene == (Object)null) && !((Object)(object)prefab == (Object)null)) { scene.m_prefabs.RemoveAll((GameObject p) => (Object)(object)p == (Object)null || ((Object)(object)p != (Object)(object)prefab && ((Object)p).name == ((Object)prefab).name)); if (!scene.m_prefabs.Contains(prefab)) { scene.m_prefabs.Add(prefab); } int stableHashCode = StringExtensionMethods.GetStableHashCode(((Object)prefab).name); if (typeof(ZNetScene).GetField("m_namedPrefabs", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(scene) is Dictionary dictionary) { dictionary[stableHashCode] = prefab; } } } public static void TryFinalize() { //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) //IL_014c: 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: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //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) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Expected O, but got Unknown //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Expected O, but got Unknown if ((Object)(object)VaultPrefab == (Object)null || (Object)(object)ObjectDB.instance == (Object)null || ObjectDB.instance.m_items.Count == 0) { return; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab("Hammer"); if ((Object)(object)itemPrefab == (Object)null) { return; } ItemDrop component = itemPrefab.GetComponent(); if ((Object)(object)component == (Object)null || component.m_itemData == null || component.m_itemData.m_shared == null) { return; } PieceTable buildPieces = component.m_itemData.m_shared.m_buildPieces; if ((Object)(object)buildPieces == (Object)null) { return; } Piece component2 = VaultPrefab.GetComponent(); if ((Object)(object)component2 != (Object)null) { List list = new List(); GameObject itemPrefab2 = ObjectDB.instance.GetItemPrefab("Wood"); ItemDrop val = ((itemPrefab2 != null) ? itemPrefab2.GetComponent() : null); GameObject itemPrefab3 = ObjectDB.instance.GetItemPrefab("FineWood"); ItemDrop val2 = ((itemPrefab3 != null) ? itemPrefab3.GetComponent() : null); GameObject itemPrefab4 = ObjectDB.instance.GetItemPrefab("Iron"); ItemDrop val3 = ((itemPrefab4 != null) ? itemPrefab4.GetComponent() : null); if ((Object)(object)val2 != (Object)null) { list.Add(new Requirement { m_resItem = val2, m_amount = 10, m_recover = true }); } else if ((Object)(object)val != (Object)null) { list.Add(new Requirement { m_resItem = val, m_amount = 10, m_recover = true }); } if ((Object)(object)val3 != (Object)null) { list.Add(new Requirement { m_resItem = val3, m_amount = 2, m_recover = true }); } GameObject itemPrefab5 = ObjectDB.instance.GetItemPrefab("BoneFragments"); ItemDrop val4 = ((itemPrefab5 != null) ? itemPrefab5.GetComponent() : null); if ((Object)(object)val4 != (Object)null) { list.Add(new Requirement { m_resItem = val4, m_amount = 5, m_recover = true }); } component2.m_resources = list.ToArray(); component2.m_category = (PieceCategory)4; GameObject itemPrefab6 = ObjectDB.instance.GetItemPrefab("piece_workbench"); if ((Object)(object)itemPrefab6 != (Object)null) { component2.m_craftingStation = itemPrefab6.GetComponent(); } } buildPieces.m_pieces.RemoveAll((GameObject p) => (Object)(object)p == (Object)null || ((Object)p).name == "arcade_trophy_vault"); int num = buildPieces.m_pieces.FindIndex((GameObject p) => (Object)(object)p != (Object)null && ((Object)p).name == "piece_chest_wood"); if (num >= 0) { buildPieces.m_pieces.Insert(num + 1, VaultPrefab); } else { buildPieces.m_pieces.Add(VaultPrefab); } ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogInfo((object)"Trophy Vault successfully inserted into Hammer table!"); } } } } namespace ArcadeTrophyVault.Visuals { internal static class IconRenderer { private const int Size = 128; private const float FieldOfView = 30f; private static readonly Vector3 StudioPosition = new Vector3(0f, 7500f, 0f); internal static Sprite Render(GameObject prefab) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Expected O, but got Unknown //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Expected O, but got Unknown //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Expected O, but got Unknown //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) if ((int)SystemInfo.graphicsDeviceType == 4) { return null; } int num = FreeLayer(); if (num < 0) { return null; } GameObject val = null; GameObject val2 = null; GameObject val3 = null; RenderTexture val4 = null; RenderTexture active = RenderTexture.active; try { val = new GameObject("ArcadeDrawers_IconStudio"); val.transform.position = StudioPosition; Matrix4x4 worldToLocalMatrix = prefab.transform.worldToLocalMatrix; MeshRenderer[] componentsInChildren = prefab.GetComponentsInChildren(true); MeshRenderer[] array = componentsInChildren; foreach (MeshRenderer val5 in array) { MeshFilter component = ((Component)val5).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.sharedMesh == (Object)null) && ((Renderer)val5).enabled && !IsHidden(((Component)val5).transform, prefab.transform) && !(((Object)val5).name == "watermask")) { Matrix4x4 val6 = worldToLocalMatrix * ((Component)val5).transform.localToWorldMatrix; GameObject val7 = new GameObject(((Object)val5).name); val7.layer = num; val7.transform.SetParent(val.transform, false); val7.transform.localPosition = Vector4.op_Implicit(((Matrix4x4)(ref val6)).GetColumn(3)); val7.transform.localRotation = ((Matrix4x4)(ref val6)).rotation; val7.transform.localScale = ((Matrix4x4)(ref val6)).lossyScale; val7.AddComponent().sharedMesh = component.sharedMesh; ((Renderer)val7.AddComponent()).sharedMaterials = ((Renderer)val5).sharedMaterials; } } Renderer[] componentsInChildren2 = val.GetComponentsInChildren(); if (componentsInChildren2.Length == 0) { return null; } Bounds bounds = componentsInChildren2[0].bounds; foreach (Renderer item in componentsInChildren2.Skip(1)) { ((Bounds)(ref bounds)).Encapsulate(item.bounds); } val4 = new RenderTexture(128, 128, 24, (RenderTextureFormat)0) { antiAliasing = 4 }; val2 = new GameObject("ArcadeDrawers_IconCamera"); Camera val8 = val2.AddComponent(); ((Behaviour)val8).enabled = false; val8.clearFlags = (CameraClearFlags)2; val8.backgroundColor = new Color(0f, 0f, 0f, 0f); val8.cullingMask = 1 << num; val8.fieldOfView = 30f; val8.targetTexture = val4; Vector3 val9 = Quaternion.Euler(20f, 205f, 0f) * Vector3.forward; Vector3 extents = ((Bounds)(ref bounds)).extents; float num2 = ((Vector3)(ref extents)).magnitude / Mathf.Sin((float)Math.PI / 12f); ((Component)val8).transform.position = ((Bounds)(ref bounds)).center - val9 * num2; ((Component)val8).transform.rotation = Quaternion.LookRotation(val9); extents = ((Bounds)(ref bounds)).extents; val8.nearClipPlane = Mathf.Max(0.05f, num2 - ((Vector3)(ref extents)).magnitude * 2f); extents = ((Bounds)(ref bounds)).extents; val8.farClipPlane = num2 + ((Vector3)(ref extents)).magnitude * 2f; val3 = new GameObject("ArcadeTrophyVault_IconLight"); Light val10 = val3.AddComponent(); val10.type = (LightType)1; val10.intensity = 1.15f; val10.cullingMask = 1 << num; ((Component)val10).transform.rotation = Quaternion.Euler(35f, 160f, 0f); val8.Render(); RenderTexture.active = val4; Texture2D val11 = new Texture2D(128, 128, (TextureFormat)5, false) { name = ((Object)prefab).name + "_icon" }; val11.ReadPixels(new Rect(0f, 0f, 128f, 128f), 0, 0); val11.Apply(); if (val11.GetPixels32().Count((Color32 p) => p.a > 16) <= 327) { ManualLogSource log = ArcadeTrophyVaultPlugin.Log; if (log != null) { log.LogWarning((object)("Icon for '" + ((Object)prefab).name + "' came out empty: keeping the previous icon.")); } Object.Destroy((Object)(object)val11); return null; } return Sprite.Create(val11, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f)); } catch (Exception ex) { ManualLogSource log2 = ArcadeTrophyVaultPlugin.Log; if (log2 != null) { log2.LogWarning((object)("Icon for '" + ((Object)prefab).name + "' not rendered: " + ex.Message)); } return null; } finally { RenderTexture.active = active; if ((Object)(object)val4 != (Object)null) { val4.Release(); Object.DestroyImmediate((Object)(object)val4); } if ((Object)(object)val != (Object)null) { Object.DestroyImmediate((Object)(object)val); } if ((Object)(object)val2 != (Object)null) { Object.DestroyImmediate((Object)(object)val2); } if ((Object)(object)val3 != (Object)null) { Object.DestroyImmediate((Object)(object)val3); } } } private static bool IsHidden(Transform part, Transform root) { Transform val = part; while ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)root) { if (!((Component)val).gameObject.activeSelf) { return true; } val = val.parent; } return false; } private static int FreeLayer() { for (int num = 31; num >= 8; num--) { if (string.IsNullOrEmpty(LayerMask.LayerToName(num))) { return num; } } return -1; } } internal sealed class MeshBuilder { private readonly List _vertices = new List(); private readonly List _normals = new List(); private readonly List _uvs = new List(); private readonly List _triangles = new List(); internal bool IsEmpty => _triangles.Count == 0; internal void Box(Vector3 center, Vector3 ax, Vector3 ay, Vector3 az, Vector3 half) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) Quad(center + az * half.z, ax * half.x, ay * half.y); Quad(center - az * half.z, -ax * half.x, ay * half.y); Quad(center + ax * half.x, -az * half.z, ay * half.y); Quad(center - ax * half.x, az * half.z, ay * half.y); Quad(center + ay * half.y, ax * half.x, -az * half.z); Quad(center - ay * half.y, ax * half.x, az * half.z); } internal void Box(Vector3 center, Vector3 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_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_0012: 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) Box(center, Vector3.right, Vector3.up, Vector3.forward, size * 0.5f); } internal void Beam(Vector3 from, Vector3 to, float width, float depth, Vector3 depthHint) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_007f: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Distance(from, to); if (!(num < 0.0001f)) { Vector3 val = (to - from) / num; Vector3 val2 = depthHint - Vector3.Dot(depthHint, val) * val; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude < 1E-06f) { val2 = Vector3.Cross(val, Vector3.right); normalized = ((Vector3)(ref val2)).normalized; } Vector3 ax = Vector3.Cross(val, normalized); Box((from + to) * 0.5f, ax, val, normalized, new Vector3(width * 0.5f, num * 0.5f, depth * 0.5f)); } } internal void Ring(Vector3 center, float inner, float outer, float depth, int segments) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0140: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.forward * (depth * 0.5f); for (int i = 0; i < segments; i++) { Vector3 val2 = Radial((float)Math.PI * 2f * (float)i / (float)segments); Vector3 val3 = Radial((float)Math.PI * 2f * (float)(i + 1) / (float)segments); Vector3 val4 = val2 + val3; Vector3 inside = center + ((Vector3)(ref val4)).normalized * ((inner + outer) * 0.5f); Vector3 val5 = center + val2 * inner; Vector3 val6 = center + val3 * inner; Vector3 val7 = center + val2 * outer; Vector3 val8 = center + val3 * outer; QuadPoints(val5 + val, val7 + val, val8 + val, val6 + val, inside); QuadPoints(val5 - val, val7 - val, val8 - val, val6 - val, inside); QuadPoints(val7 - val, val7 + val, val8 + val, val8 - val, inside); QuadPoints(val5 - val, val5 + val, val6 + val, val6 - val, inside); } } private static Vector3 Radial(float a) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return new Vector3(Mathf.Cos(a), Mathf.Sin(a), 0f); } internal void Annulus(Vector3 center, float inner, float outer, float bottom, float top, int segments) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < segments; i++) { Vector3 val = Horizontal((float)Math.PI * 2f * (float)i / (float)segments); Vector3 val2 = Horizontal((float)Math.PI * 2f * (float)(i + 1) / (float)segments); Vector3 val3 = val + val2; Vector3 inside = center + ((Vector3)(ref val3)).normalized * ((inner + outer) * 0.5f) + Vector3.up * ((bottom + top) * 0.5f); Vector3 val4 = center + val * inner + Vector3.up * bottom; Vector3 val5 = center + val2 * inner + Vector3.up * bottom; Vector3 val6 = center + val * outer + Vector3.up * bottom; Vector3 val7 = center + val2 * outer + Vector3.up * bottom; Vector3 val8 = Vector3.up * (top - bottom); QuadPoints(val4 + val8, val6 + val8, val7 + val8, val5 + val8, inside); QuadPoints(val6, val7, val7 + val8, val6 + val8, inside); QuadPoints(val4, val5, val5 + val8, val4 + val8, inside); } } internal void Ribbon(IList points, IList sides, float width, float tileLength) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) int count = _vertices.Count; float num = 0f; for (int i = 0; i < points.Count; i++) { if (i > 0) { num += Vector3.Distance(points[i - 1], points[i]); } Vector3 val = points[Mathf.Min(i + 1, points.Count - 1)] - points[Mathf.Max(i - 1, 0)]; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = sides[i] * (width * 0.5f); val = Vector3.Cross(normalized, sides[i]); Vector3 normalized2 = ((Vector3)(ref val)).normalized; _vertices.Add(points[i] - val2); _vertices.Add(points[i] + val2); _normals.Add(normalized2); _normals.Add(normalized2); _uvs.Add(new Vector2(0f, num / tileLength)); _uvs.Add(new Vector2(1f, num / tileLength)); } for (int j = 0; j < points.Count - 1; j++) { int num2 = count + j * 2; _triangles.Add(num2); _triangles.Add(num2 + 2); _triangles.Add(num2 + 1); _triangles.Add(num2 + 1); _triangles.Add(num2 + 2); _triangles.Add(num2 + 3); } } internal void Disc(Vector3 center, float radius, int segments, float uvScale = 1f) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00dc: Unknown result type (might be due to invalid IL or missing references) int count = _vertices.Count; _vertices.Add(center); _normals.Add(Vector3.forward); _uvs.Add(new Vector2(0.5f, 0.5f) * uvScale); Vector3 val = default(Vector3); for (int i = 0; i <= segments; i++) { float num = (float)Math.PI * 2f * (float)i / (float)segments; ((Vector3)(ref val))..ctor(Mathf.Cos(num), Mathf.Sin(num), 0f); _vertices.Add(center + val * radius); _normals.Add(Vector3.forward); _uvs.Add(new Vector2(0.5f + val.x * 0.5f, 0.5f + val.y * 0.5f) * uvScale); } for (int j = 0; j < segments; j++) { _triangles.Add(count); _triangles.Add(count + 1 + j); _triangles.Add(count + 2 + j); } } private static Vector3 Horizontal(float a) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return new Vector3(Mathf.Cos(a), 0f, Mathf.Sin(a)); } private void QuadPoints(Vector3 a, Vector3 b, Vector3 c, Vector3 d, Vector3 inside) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0059: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(b - a, c - a); Vector3 val2 = ((Vector3)(ref val)).normalized; if (Vector3.Dot(val2, (a + b + c + d) * 0.25f - inside) < 0f) { Vector3 val3 = d; d = b; b = val3; val2 = -val2; } int count = _vertices.Count; _vertices.Add(a); _vertices.Add(b); _vertices.Add(c); _vertices.Add(d); for (int i = 0; i < 4; i++) { _normals.Add(val2); } _uvs.Add(Planar(a, val2)); _uvs.Add(Planar(b, val2)); _uvs.Add(Planar(c, val2)); _uvs.Add(Planar(d, val2)); _triangles.Add(count); _triangles.Add(count + 1); _triangles.Add(count + 2); _triangles.Add(count); _triangles.Add(count + 2); _triangles.Add(count + 3); } internal void Prism(Vector3 center, float radius, float bottom, float top, int sides) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Frustum(center, radius, radius, bottom, top, sides); } internal void Frustum(Vector3 center, float bottomRadius, float topRadius, float bottom, float top, int sides) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) Vector3 inside = center + Vector3.up * ((bottom + top) * 0.5f); float num = (float)Math.PI / (float)sides; for (int i = 0; i < sides; i++) { Vector3 val = Horizontal(num + (float)Math.PI * 2f * (float)i / (float)sides); Vector3 val2 = Horizontal(num + (float)Math.PI * 2f * (float)(i + 1) / (float)sides); Vector3 val3 = center + val * bottomRadius + Vector3.up * bottom; Vector3 val4 = center + val2 * bottomRadius + Vector3.up * bottom; Vector3 val5 = center + val * topRadius + Vector3.up * top; Vector3 c = center + val2 * topRadius + Vector3.up * top; QuadPoints(val3, val4, c, val5, inside); Triangle(center + Vector3.up * top, val5, c, inside); Triangle(center + Vector3.up * bottom, val3, val4, inside); } } internal void Sphere(Vector3 center, float radius, int rings, int segments, float uTiles) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) int count = _vertices.Count; Vector3 val = default(Vector3); for (int i = 0; i <= rings; i++) { float num = (float)Math.PI * (float)i / (float)rings; for (int j = 0; j <= segments; j++) { float num2 = (float)Math.PI * 2f * (float)j / (float)segments; ((Vector3)(ref val))..ctor(Mathf.Sin(num) * Mathf.Cos(num2), Mathf.Cos(num), Mathf.Sin(num) * Mathf.Sin(num2)); _vertices.Add(center + val * radius); _normals.Add(val); _uvs.Add(new Vector2(uTiles * (float)j / (float)segments, (float)i / (float)rings)); } } int num3 = segments + 1; for (int k = 0; k < rings; k++) { for (int l = 0; l < segments; l++) { int num4 = count + k * num3 + l; int num5 = num4 + num3; _triangles.Add(num4); _triangles.Add(num4 + 1); _triangles.Add(num5); _triangles.Add(num4 + 1); _triangles.Add(num5 + 1); _triangles.Add(num5); } } } internal void Crystal(Vector3 center, float length, float radius, int sides) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) Vector3 a = center + Vector3.up * (length * 0.5f); Vector3 a2 = center - Vector3.up * (length * 0.5f); Vector3[] array = (Vector3[])(object)new Vector3[sides]; for (int i = 0; i < sides; i++) { float num = (float)Math.PI * 2f * (float)i / (float)sides; array[i] = center + new Vector3(Mathf.Cos(num) * radius, 0f, Mathf.Sin(num) * radius); } for (int j = 0; j < sides; j++) { Vector3 c = array[(j + 1) % sides]; Triangle(a, array[j], c, center); Triangle(a2, array[j], c, center); } } internal void Tube(IList points, IList radii, int sides) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) int count = _vertices.Count; float num = 0f; for (int i = 0; i < points.Count; i++) { if (i > 0) { num += Vector3.Distance(points[i - 1], points[i]); } Vector3 val = points[Mathf.Min(i + 1, points.Count - 1)] - points[Mathf.Max(i - 1, 0)]; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(normalized, Vector3.up); Vector3 val3 = ((((Vector3)(ref val2)).sqrMagnitude < 0.0001f) ? Vector3.right : ((Vector3)(ref val2)).normalized); val = Vector3.Cross(val3, normalized); Vector3 normalized2 = ((Vector3)(ref val)).normalized; float num2 = (float)Math.PI * 2f * Mathf.Max(radii[i], 0.01f); for (int j = 0; j <= sides; j++) { float num3 = (float)Math.PI * 2f * (float)j / (float)sides; Vector3 val4 = val3 * Mathf.Cos(num3) + normalized2 * Mathf.Sin(num3); _vertices.Add(points[i] + val4 * radii[i]); _normals.Add(val4); _uvs.Add(new Vector2(num2 * (float)j / (float)sides, num)); } } for (int k = 0; k + 1 < points.Count; k++) { for (int l = 0; l < sides; l++) { int num4 = count + k * (sides + 1) + l; int num5 = num4 + sides + 1; _triangles.Add(num4); _triangles.Add(num5); _triangles.Add(num4 + 1); _triangles.Add(num4 + 1); _triangles.Add(num5); _triangles.Add(num5 + 1); } } } internal void Triangle(Vector3 a, Vector3 b, Vector3 c, Vector3 inside) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_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_0037: 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_008b: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(b - a, c - a); Vector3 val2 = ((Vector3)(ref val)).normalized; if (Vector3.Dot(val2, (a + b + c) / 3f - inside) < 0f) { Vector3 val3 = c; c = b; b = val3; val2 = -val2; } int count = _vertices.Count; _vertices.Add(a); _vertices.Add(b); _vertices.Add(c); _normals.Add(val2); _normals.Add(val2); _normals.Add(val2); _uvs.Add(Planar(a, val2)); _uvs.Add(Planar(b, val2)); _uvs.Add(Planar(c, val2)); _triangles.Add(count); _triangles.Add(count + 1); _triangles.Add(count + 2); } private static Vector2 Planar(Vector3 p, Vector3 normal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0031: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Mathf.Abs(normal.x), Mathf.Abs(normal.y), Mathf.Abs(normal.z)); if (val.y >= val.x && val.y >= val.z) { return new Vector2(p.x, p.z); } if (!(val.x >= val.z)) { return new Vector2(p.x, p.y); } return new Vector2(p.z, p.y); } private void Quad(Vector3 center, Vector3 u, Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_00c5: 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) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(u, v); Vector3 normalized = ((Vector3)(ref val)).normalized; int count = _vertices.Count; _vertices.Add(center - u - v); _vertices.Add(center + u - v); _vertices.Add(center + u + v); _vertices.Add(center - u + v); for (int i = 0; i < 4; i++) { _normals.Add(normalized); } float num = ((Vector3)(ref u)).magnitude * 2f; float num2 = ((Vector3)(ref v)).magnitude * 2f; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(center.x + center.z, center.y); _uvs.Add(val2); _uvs.Add(val2 + new Vector2(num, 0f)); _uvs.Add(val2 + new Vector2(num, num2)); _uvs.Add(val2 + new Vector2(0f, num2)); _triangles.Add(count); _triangles.Add(count + 1); _triangles.Add(count + 2); _triangles.Add(count); _triangles.Add(count + 2); _triangles.Add(count + 3); } internal void Append(MeshBuilder other, Matrix4x4 matrix) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) int count = _vertices.Count; for (int i = 0; i < other._vertices.Count; i++) { _vertices.Add(((Matrix4x4)(ref matrix)).MultiplyPoint3x4(other._vertices[i])); List normals = _normals; Vector3 val = ((Matrix4x4)(ref matrix)).MultiplyVector(other._normals[i]); normals.Add(((Vector3)(ref val)).normalized); _uvs.Add(other._uvs[i]); } foreach (int triangle in other._triangles) { _triangles.Add(count + triangle); } } internal Mesh Build(string name) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh { name = name }; if (_vertices.Count > 65000) { val.indexFormat = (IndexFormat)1; } val.SetVertices(_vertices); val.SetNormals(_normals); val.SetUVs(0, _uvs); Color32[] array = (Color32[])(object)new Color32[_vertices.Count]; for (int i = 0; i < array.Length; i++) { array[i] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); } val.colors32 = array; val.SetTriangles(_triangles, 0); val.RecalculateTangents(); val.RecalculateBounds(); return val; } } public static class TrophyVaultModel { public static void Build(GameObject root, ZNetScene scene) { //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Expected O, but got Unknown //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < root.transform.childCount; i++) { Transform child = root.transform.GetChild(i); if (((Object)child).name != "RunicGlow") { Renderer[] componentsInChildren = ((Component)child).GetComponentsInChildren(true); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { val.enabled = false; } } } Material val2 = null; GameObject val3 = scene.GetPrefab("piece_darkwood_arch") ?? scene.GetPrefab("piece_chest_blackmetal"); if ((Object)(object)val3 != (Object)null) { Renderer componentInChildren = val3.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.sharedMaterial != (Object)null) { val2 = componentInChildren.sharedMaterial; } } if ((Object)(object)val2 == (Object)null) { Renderer componentInChildren2 = root.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null && (Object)(object)componentInChildren2.sharedMaterial != (Object)null) { val2 = componentInChildren2.sharedMaterial; } } Material val4 = (((Object)(object)val2 != (Object)null) ? new Material(val2) : new Material(Shader.Find("Standard"))); val4.color = new Color(0.18f, 0.14f, 0.1f); Material val5 = new Material(val4); val5.color = new Color(0.85f, 0.7f, 0.25f); Material val6 = new Material(val4); val6.color = new Color(0.2f, 0.85f, 1f); val6.EnableKeyword("_EMISSION"); val6.SetColor("_EmissionColor", new Color(0.15f, 0.75f, 1f) * 2.5f); GameObject val7 = new GameObject("TrophyVaultCustomModel"); val7.transform.SetParent(root.transform, false); val7.transform.localPosition = Vector3.zero; MeshBuilder meshBuilder = new MeshBuilder(); MeshBuilder meshBuilder2 = new MeshBuilder(); MeshBuilder meshBuilder3 = new MeshBuilder(); meshBuilder.Box(new Vector3(0f, 0.1f, 0f), new Vector3(1.3f, 0.2f, 0.7f)); meshBuilder.Box(new Vector3(0f, 0.8f, 0.25f), new Vector3(1.2f, 1.3f, 0.15f)); meshBuilder.Box(new Vector3(0f, 1.48f, 0.23f), new Vector3(1.3f, 0.12f, 0.22f)); float[] array2 = new float[2] { -0.55f, 0.55f }; float[] array3 = array2; foreach (float num in array3) { meshBuilder.Box(new Vector3(num, 0.8f, 0.15f), new Vector3(0.14f, 1.3f, 0.14f)); meshBuilder2.Box(new Vector3(num, 0.8f, 0.15f), new Vector3(0.16f, 0.05f, 0.16f)); meshBuilder2.Box(new Vector3(num, 1.4f, 0.15f), new Vector3(0.16f, 0.06f, 0.16f)); } meshBuilder.Box(new Vector3(0f, 0.45f, -0.05f), new Vector3(0.9f, 0.55f, 0.45f)); meshBuilder2.Box(new Vector3(0f, 0.73f, -0.05f), new Vector3(0.94f, 0.04f, 0.48f)); float num2 = 0.168f; meshBuilder3.Beam(new Vector3(0f, 0.85f, num2), new Vector3(0f, 1.35f, num2), 0.025f, 0.01f, Vector3.up); meshBuilder3.Beam(new Vector3(-0.25f, 1.1f, num2), new Vector3(0.25f, 1.1f, num2), 0.025f, 0.01f, Vector3.up); meshBuilder3.Beam(new Vector3(-0.18f, 1.28f, num2), new Vector3(0.18f, 0.92f, num2), 0.02f, 0.01f, Vector3.up); meshBuilder3.Beam(new Vector3(-0.18f, 0.92f, num2), new Vector3(0.18f, 1.28f, num2), 0.02f, 0.01f, Vector3.up); float num3 = -0.28f; meshBuilder3.Beam(new Vector3(-0.25f, 0.45f, num3), new Vector3(0.25f, 0.45f, num3), 0.02f, 0.01f, Vector3.up); meshBuilder3.Beam(new Vector3(-0.15f, 0.3f, num3), new Vector3(0f, 0.55f, num3), 0.018f, 0.01f, Vector3.up); meshBuilder3.Beam(new Vector3(0.15f, 0.3f, num3), new Vector3(0f, 0.55f, num3), 0.018f, 0.01f, Vector3.up); CreateSubPart(val7, "Wood", meshBuilder.Build("TrophyVault_Wood"), val4); CreateSubPart(val7, "Gold", meshBuilder2.Build("TrophyVault_Gold"), val5); CreateSubPart(val7, "Runes", meshBuilder3.Build("TrophyVault_Runes"), val6); GameObject val8 = new GameObject("RunicGlow"); val8.transform.SetParent(root.transform, false); val8.transform.localPosition = new Vector3(0f, 1.1f, 0f); Light val9 = val8.AddComponent(); val9.type = (LightType)2; val9.range = 3.5f; val9.color = new Color(0.25f, 0.85f, 1f, 1f); val9.intensity = 1.8f; val9.shadows = (LightShadows)0; } private static void CreateSubPart(GameObject parent, string name, Mesh mesh, Material mat) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(parent.transform, false); MeshFilter val2 = val.AddComponent(); val2.sharedMesh = mesh; MeshRenderer val3 = val.AddComponent(); ((Renderer)val3).sharedMaterial = mat; } } } namespace ArcadeTrophyVault.UI { public class TrophyVaultUI : MonoBehaviour { [CompilerGenerated] private static class <>O { public static UnityAction <0>__Close; } private static TrophyVaultUI _instance; private TrophyVault _currentVault; private GameObject _panelRoot; private RectTransform _panelRect; private RectTransform _contentRect; private ScrollRect _scrollRect; private TMP_Text _titleText; private TMP_Text _statsText; private TMP_InputField _searchInput; private Button _depositAllBtn; private Button _closeBottomBtn; private readonly string[] BiomeTabNames = new string[11] { "ALL", "Meadows", "Black Forest", "Swamp", "Mountain", "Plains", "Ocean", "Mistlands", "Ashlands", "Deep North", "Modded" }; private readonly List