using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using FamBook.Services; using FamBook.Utilities; using HarmonyLib; using Il2CppInterop.Runtime; using Microsoft.CodeAnalysis; using ProjectM; using ProjectM.Hybrid; using ProjectM.Network; using ProjectM.Physics; using ProjectM.Scripting; using ProjectM.UI; using TMPro; using Unity.Collections; using Unity.Entities; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("FamBook")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyInformationalVersion("4.0.0+71c54b742d17f5ede83e1a6ba98410527bb7f322")] [assembly: AssemblyProduct("FamBook")] [assembly: AssemblyTitle("FamBook")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [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 FamBook { internal static class Core { private static World? _client; private static SystemService? _systemService; private static Entity _localCharacter = Entity.Null; private static Entity _localUser = Entity.Null; private static MonoBehaviour? _monoBehaviour; private static bool _initialized; public static Entity LocalCharacter => _localCharacter.Exists() ? _localCharacter : (ConsoleShared.TryGetLocalCharacterInCurrentWorld(ref _localCharacter, _client) ? _localCharacter : Entity.Null); public static Entity LocalUser => _localUser.Exists() ? _localUser : (ConsoleShared.TryGetLocalUserInCurrentWorld(ref _localUser, _client) ? _localUser : Entity.Null); public static EntityManager EntityManager => _client.EntityManager; public static SystemService SystemService => _systemService ?? (_systemService = new SystemService(_client)); public static ClientGameManager ClientGameManager => SystemService.ClientScriptMapper._ClientGameManager; public static CanvasService? CanvasService { get; set; } public static ServerTime ServerTime => ClientGameManager.ServerTime; public static ManualLogSource Log => Plugin.LogInstance; public static bool HasInitialized => _initialized; public static void Initialize(GameDataManager gameDataManager) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if (!_initialized) { _client = ((ComponentSystemBase)gameDataManager).World; _initialized = true; ManualLogSource log = Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 0, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[FamBook] Core initialized."); } log.LogInfo(val); } } public static void Reset() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown _client = null; _systemService = null; CanvasService = null; _initialized = false; _localCharacter = Entity.Null; _localUser = Entity.Null; ManualLogSource log = Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(21, 0, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[FamBook] Core reset."); } log.LogInfo(val); } public static void SetCanvas(UICanvasBase canvas) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown CanvasService = new CanvasService(canvas); ManualLogSource log = Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(37, 0, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[FamBook] Canvas service initialized."); } log.LogInfo(val); } public static Coroutine StartCoroutine(IEnumerator routine) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)_monoBehaviour == (Object)null) { GameObject val = new GameObject("FamBook"); _monoBehaviour = (MonoBehaviour?)(object)val.AddComponent(); Object.DontDestroyOnLoad((Object)(object)val); } return _monoBehaviour.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine)); } public static void StopCoroutine(Coroutine routine) { if (!((Object)(object)_monoBehaviour == (Object)null)) { _monoBehaviour.StopCoroutine(routine); } } } [BepInPlugin("com.fambook.vrising", "FamBook", "4.0.0")] internal class Plugin : BasePlugin { private Harmony _harmony = null; private static ConfigEntry _familiarsPanel; private static ConfigEntry _showActiveIndicator; private static ConfigEntry _eclipsed; internal static Plugin Instance { get; private set; } public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log; public static bool FamiliarsPanel => _familiarsPanel.Value; public static bool ShowActiveIndicator => _showActiveIndicator.Value; public static bool Eclipsed => _eclipsed.Value; public override void Load() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown Instance = this; bool flag = default(bool); if (!Application.productName.Equals("VRising", StringComparison.OrdinalIgnoreCase)) { ManualLogSource log = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(43, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("FamBook"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("4.0.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] is a client mod – skipping on server ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(Application.productName); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")."); } log.LogInfo(val); } else { _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); InitConfig(); ManualLogSource log2 = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(20, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("FamBook"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("4.0.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] loaded on client!"); } log2.LogInfo(val); } } private static void InitConfig() { _familiarsPanel = InitConfigEntry("UIOptions", "FamiliarsPanel", defaultValue: true, "Enable/Disable the familiars panel that lists all unlocked familiars."); _showActiveIndicator = InitConfigEntry("UIOptions", "ShowActiveIndicator", defaultValue: true, "Highlight the currently active familiar in the panel."); _eclipsed = InitConfigEntry("UIOptions", "Eclipsed", defaultValue: true, "Set to false for slower update intervals (0.1s -> 1s) if performance is negatively impacted."); } private static ConfigEntry InitConfigEntry(string section, string key, T defaultValue, string description) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown ConfigEntry val = ((BasePlugin)Instance).Config.Bind(section, key, defaultValue, description); ConfigFile val2 = new ConfigFile(Path.Combine(Paths.ConfigPath, "com.fambook.vrising.cfg"), true); ConfigEntry val3 = default(ConfigEntry); if (val2.TryGetEntry(section, key, ref val3)) { val.Value = val3.Value; } return val; } public override bool Unload() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } return true; } } internal static class VExtensions { private static EntityManager EntityManager => Core.EntityManager; public static bool Has(this Entity entity) { //IL_0000: 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_0008: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).HasComponent(entity); } public static bool Exists(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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_0015: Unknown result type (might be due to invalid IL or missing references) int result; if (entity != Entity.Null) { EntityManager entityManager = EntityManager; result = (((EntityManager)(ref entityManager)).Exists(entity) ? 1 : 0); } else { result = 0; } return (byte)result != 0; } public static T Read(this Entity entity) where T : struct { //IL_0000: 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_0008: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; T val = default(T); return ((EntityManager)(ref entityManager)).TryGetComponentData(entity, ref val) ? val : default(T); } public static void Write(this Entity entity, T componentData) where T : struct { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (entity.Has()) { EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData(entity, componentData); } } public static NetworkId GetNetworkId(this Entity entity) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; NetworkId result = default(NetworkId); if (((EntityManager)(ref entityManager)).TryGetComponentData(entity, ref result)) { return result; } return NetworkId.Empty; } public static Coroutine Run(this IEnumerator routine) { return Core.StartCoroutine(routine); } public static void Stop(this Coroutine routine) { if (routine != null) { Core.StopCoroutine(routine); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "com.fambook.vrising"; public const string PLUGIN_NAME = "FamBook"; public const string PLUGIN_VERSION = "4.0.0"; } } namespace FamBook.Utilities { internal static class CommandSender { private static FromCharacter? _fromCharacter; private static readonly ComponentType[] _componentTypes = (ComponentType[])(object)new ComponentType[4] { ComponentType.ReadOnly(Il2CppType.Of()), ComponentType.ReadOnly(Il2CppType.Of()), ComponentType.ReadOnly(Il2CppType.Of()), ComponentType.ReadOnly(Il2CppType.Of()) }; private static readonly NetworkEventType _networkEventType = new NetworkEventType { IsAdminEvent = false, EventId = NetworkEvents.EventId_ChatMessageEvent, IsDebugEvent = false }; private static EntityManager EntityManager => Core.EntityManager; private static Entity LocalCharacter => Core.LocalCharacter; private static Entity LocalUser => Core.LocalUser; private static FromCharacter FromCharacter { get { //IL_0005: 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_0047: 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_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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_0039: 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) FromCharacter valueOrDefault = _fromCharacter.GetValueOrDefault(); FromCharacter result; if (!_fromCharacter.HasValue) { valueOrDefault = new FromCharacter { Character = LocalCharacter, User = LocalUser }; _fromCharacter = valueOrDefault; result = valueOrDefault; } else { result = valueOrDefault; } return result; } } public static void Send(string command) { //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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0056: 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_006c: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_008c: 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_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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00b6: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown if (Core.HasInitialized && !(LocalCharacter == Entity.Null) && !(LocalUser == Entity.Null)) { ChatMessageEvent val = new ChatMessageEvent { MessageText = new FixedString512Bytes(command), MessageType = (ChatMessageType)4, ReceiverEntity = LocalUser.GetNetworkId() }; EntityManager entityManager = EntityManager; Entity val2 = ((EntityManager)(ref entityManager)).CreateEntity(_componentTypes); entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData(val2, FromCharacter); entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData(val2, _networkEventType); entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData(val2, val); ManualLogSource log = Core.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[FamBook] Sent command: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(command); } log.LogInfo(val3); } } public static void RequestBoxData(int boxIndex) { Send($".fam cb box{boxIndex + 1}"); Send(".fam l"); DataService.BeginAwaitingResponse(); } public static void Reset() { _fromCharacter = null; } } internal static class GameObjects { public static Transform? FindChildRecursive(Transform parent, string name) { if (((Object)parent).name == name) { return parent; } for (int i = 0; i < parent.childCount; i++) { Transform val = FindChildRecursive(parent.GetChild(i), name); if ((Object)(object)val != (Object)null) { return val; } } return null; } public static GameObject? FindTargetObject(Transform parent, string name) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown Transform val = FindChildRecursive(parent, name); if ((Object)(object)val == (Object)null) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(42, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[FamBook] Could not find child '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("' under '"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((Object)parent).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("'"); } log.LogWarning(val2); } return (val != null) ? ((Component)val).gameObject : null; } public static void DeactivateChildrenExcept(Transform parent, string keepName) { for (int i = 0; i < parent.childCount; i++) { Transform child = parent.GetChild(i); if (!((Object)child).name.Equals(keepName, StringComparison.Ordinal)) { ((Component)child).gameObject.SetActive(false); } } } } } namespace FamBook.Services { internal class CanvasService { private const float BOOK_W = 310f; private const float BOOK_H = 380f; private const float HEADER_H = 30f; private const float SEP_H = 2f; private const float NAV_H = 66f; private const float CARD_H = 26f; private const float CARD_GAP = 2f; private const int MAX_CARDS = 10; private static readonly WaitForSeconds _fastWait = new WaitForSeconds(0.1f); private static readonly WaitForSeconds _slowWait = new WaitForSeconds(1f); private static bool _ready; private static bool _bookOpen; private static bool _killSwitch; private static Canvas? _bottomBarCanvas; private static int _layer; private static GameObject? _iconButton; private static GameObject? _bookPanel; private static GameObject? _cardsContainer; private static TextMeshProUGUI? _pageLabel; private static readonly List _cards = new List(); private static bool _showingVBloodList = false; private static int _vbloodPage = 0; private static bool _vbloodScanning = false; private static bool _showingBoxList = false; private static int _boxListPage = 0; private static int _currentListedBoxIndex = -1; private static WaitForSeconds WaitForSeconds => Plugin.Eclipsed ? _fastWait : _slowWait; internal static bool IsOpen => _bookOpen; internal CanvasService(UICanvasBase canvas) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown _killSwitch = false; _ready = false; _bookOpen = false; _cards.Clear(); _bottomBarCanvas = ((Component)canvas.BottomBarParent).gameObject.GetComponent(); _layer = ((Component)_bottomBarCanvas).gameObject.layer; if (!Plugin.FamiliarsPanel) { return; } try { BuildIconButton(); BuildBookPanel(); } catch (Exception ex) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(31, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[FamBook] Failed to build HUD: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } _bookOpen = false; GameObject? bookPanel = _bookPanel; if (bookPanel != null) { bookPanel.SetActive(false); } if ((Object)(object)_iconButton != (Object)null) { _ready = true; Core.StartCoroutine(UpdateLoop()); } } private static IEnumerator UpdateLoop() { bool flag = default(bool); while (!_killSwitch) { if (_ready) { DataService.FinalizeIfExpired(); DataService.FinalizeListIfExpired(); if (_showingBoxList && _currentListedBoxIndex == -1 && DataService.LastListedBoxNames.Count > 0) { _currentListedBoxIndex = 0; } if (_bookOpen && DataService.IsDirty) { try { RefreshBookPage(); DataService.IsDirty = false; } catch (Exception ex) { Exception ex2 = ex; ManualLogSource log = Core.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[FamBook] Update error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex2); } log.LogError(val); } } } yield return WaitForSeconds; } } private static void BuildIconButton() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0089: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) _iconButton = new GameObject("FamBook_Icon"); AttachToCanvas(_iconButton); RectTransform val = _iconButton.AddComponent(); val.anchorMin = new Vector2(0f, 0f); val.anchorMax = new Vector2(0f, 0f); val.pivot = new Vector2(0f, 0f); val.anchoredPosition = new Vector2(20f, 60f); val.sizeDelta = new Vector2(76f, 28f); Image val2 = _iconButton.AddComponent(); ((Graphic)val2).color = new Color(0.06f, 0.06f, 0.12f, 0.85f); GameObject val3 = new GameObject("IconLabel"); val3.layer = _layer; val3.transform.SetParent(_iconButton.transform, false); TextMeshProUGUI val4 = val3.AddComponent(); ((TMP_Text)val4).text = "FamBook"; ((TMP_Text)val4).fontSize = 11f; ((TMP_Text)val4).alignment = (TextAlignmentOptions)514; ((TMP_Text)val4).enableWordWrapping = false; RectTransform component = val3.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; ((UnityEvent)_iconButton.AddComponent