using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.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 HarmonyLib; using Il2CppInterop.Runtime; using Microsoft.CodeAnalysis; using ProjectM; using ProjectM.Network; using ProjectM.Physics; using ProjectM.Scripting; using ProjectM.Sequencer; using ProjectM.UI; using ScarletTeleportGUI.Services; using ScarletTeleportGUI.Utilities; using TMPro; using Unity.Collections; using Unity.Entities; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("ScarletTeleportGUI")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.2.8.0")] [assembly: AssemblyInformationalVersion("1.2.8")] [assembly: AssemblyProduct("ScarletTeleportGUI")] [assembly: AssemblyTitle("ScarletTeleportGUI")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.8.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 ScarletTeleportGUI { 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 { get { //IL_0000: 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_0023: 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) if (!_localCharacter.Exists()) { if (!ConsoleShared.TryGetLocalCharacterInCurrentWorld(ref _localCharacter, _client)) { return Entity.Null; } return _localCharacter; } return _localCharacter; } } public static Entity LocalUser { get { //IL_0000: 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_0023: 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) if (!_localUser.Exists()) { if (!ConsoleShared.TryGetLocalUserInCurrentWorld(ref _localUser, _client)) { return Entity.Null; } return _localUser; } return _localUser; } } public static EntityManager EntityManager => _client.EntityManager; public static SystemService SystemService => _systemService ?? (_systemService = new SystemService(_client)); public static CanvasService? CanvasService { get; set; } public static ManualLogSource Log => Plugin.LogInstance; public static bool HasInitialized => _initialized; public static void Initialize(GameDataManager gameDataManager) { if (!_initialized) { _client = ((ComponentSystemBase)gameDataManager).World; _initialized = true; Log.LogInfo((object)"[ScarletTeleportGUI] Core initialized."); } } public static void Reset() { //IL_0018: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) _client = null; _systemService = null; CanvasService = null; _initialized = false; _localCharacter = Entity.Null; _localUser = Entity.Null; Log.LogInfo((object)"[ScarletTeleportGUI] Core reset."); } public static void SetCanvas(UICanvasBase canvas) { CanvasService = new CanvasService(canvas); Log.LogInfo((object)"[ScarletTeleportGUI] Canvas service initialized."); } public static Coroutine StartCoroutine(IEnumerator routine) { //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_0027: Expected O, but got Unknown if ((Object)(object)_monoBehaviour == (Object)null) { GameObject val = new GameObject("ScarletTeleportGUI"); _monoBehaviour = (MonoBehaviour?)(object)val.AddComponent(); Object.DontDestroyOnLoad((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.scarletteleportgui.vrising", "ScarletTeleportGUI", "1.2.8")] internal class Plugin : BasePlugin { private Harmony _harmony; private static ConfigEntry _teleportsPanel; private static ConfigEntry _eclipsed; internal static Plugin Instance { get; private set; } public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log; public static bool TeleportsPanel => _teleportsPanel.Value; public static bool Eclipsed => _eclipsed.Value; public override void Load() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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("ScarletTeleportGUI"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("1.2.8"); ((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("ScarletTeleportGUI"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("1.2.8"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] loaded on client."); } log2.LogInfo(val); } } private static void InitConfig() { _teleportsPanel = InitConfigEntry("UIOptions", "TeleportsPanel", defaultValue: true, "Enable or disable the Scarlet Teleport GUI panel."); _eclipsed = InitConfigEntry("UIOptions", "Eclipsed", defaultValue: true, "Set to false for slower update intervals if you want lower polling overhead."); } private static ConfigEntry InitConfigEntry(string section, string key, T defaultValue, string description) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) ConfigEntry val = ((BasePlugin)Instance).Config.Bind(section, key, defaultValue, description); ConfigEntry val2 = default(ConfigEntry); if (new ConfigFile(Path.Combine(Paths.ConfigPath, "com.scarletteleportgui.vrising.cfg"), true).TryGetEntry(section, key, ref val2)) { val.Value = val2.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) if (entity != Entity.Null) { EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).Exists(entity); } return false; } 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 result = default(T); if (!((EntityManager)(ref entityManager)).TryGetComponentData(entity, ref result)) { return default(T); } return result; } public static NetworkId GetNetworkId(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) //IL_0014: 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) EntityManager entityManager = EntityManager; NetworkId result = default(NetworkId); if (((EntityManager)(ref entityManager)).TryGetComponentData(entity, ref result)) { return result; } return NetworkId.Empty; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "com.scarletteleportgui.vrising"; public const string PLUGIN_NAME = "ScarletTeleportGUI"; public const string PLUGIN_VERSION = "1.2.8"; } } namespace ScarletTeleportGUI.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_0046: 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(); if (!_fromCharacter.HasValue) { valueOrDefault = new FromCharacter { Character = LocalCharacter, User = LocalUser }; _fromCharacter = valueOrDefault; return valueOrDefault; } return valueOrDefault; } } public static void Send(string command) { //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_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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0060: 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_0073: 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_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_0089: 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_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_009c: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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(35, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("[ScarletTeleportGUI] Sent command: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(command); } log.LogInfo(val3); } } public static void Reset() { _fromCharacter = null; } } } namespace ScarletTeleportGUI.Services { internal class CanvasService { private enum TeleportCategory { Private, Public, Player, Waypoints } private const float PANEL_W = 340f; private const float PANEL_H = 290f; private const float HEADER_H = 34f; private const float TAB_H = 34f; private const float NAV_H = 56f; private const float CARD_H = 28f; private const float CARD_GAP = 3f; private const int MAX_CARDS = 5; private const float PLAYER_LIST_W = 250f; private const float PLAYER_LIST_H = 290f; private const int PLAYER_LIST_ROWS = 10; private static readonly Color PanelBg = new Color(0.05f, 0.04f, 0.07f, 0.92f); private static readonly Color HeaderBg = new Color(0.08f, 0.07f, 0.1f, 0.85f); private static readonly Color TabsBg = new Color(0.07f, 0.06f, 0.09f, 0.85f); internal static readonly Color CardBg = new Color(0.08f, 0.07f, 0.1f, 0.78f); private static readonly Color PlayerBg = new Color(0.08f, 0.07f, 0.1f, 0.7f); private static readonly Color InputBg = new Color(0.1f, 0.09f, 0.13f, 0.92f); private static readonly Color ButtonBg = new Color(0.25f, 0.18f, 0.08f, 0.9f); private static readonly Color ButtonBgAlt = new Color(0.25f, 0.18f, 0.08f, 0.9f); private static readonly Color SeparatorBg = new Color(0.5f, 0.4f, 0.2f, 0.7f); private static readonly Color TextPrimary = new Color(0.95f, 0.92f, 0.86f, 1f); internal static readonly Color TextSecondary = new Color(0.88f, 0.84f, 0.76f, 0.95f); internal static readonly Color TextMuted = new Color(0.78f, 0.72f, 0.66f, 0.55f); private static readonly WaitForSeconds _fastWait = new WaitForSeconds(0.1f); private static readonly WaitForSeconds _slowWait = new WaitForSeconds(1f); private static readonly WaitForSeconds _actionDelay = new WaitForSeconds(0.35f); private static bool _ready; private static bool _panelOpen; private static bool _killSwitch; private static bool _holdPlayerSuppression; private static float _suppressionGraceUntil; private static float _blockMapInputUntil; private static float _forceSuppressUntil; private static float _nextOnlinePlayerCacheRefresh; private static float _nextSocialMenuPrimeAttempt; private static bool _socialMenuPrimeInProgress; private static TeleportCategory _activeCategory; private static int _page; private static Canvas? _bottomBarCanvas; private static int _layer; private static GameObject? _iconButton; private static GameObject? _panel; private static GameObject? _cardsRoot; private static GameObject? _playerForm; private static GameObject? _playerListPanel; private static GameObject? _navBar; private static RectTransform? _playerInputRoot; private static TextMeshProUGUI? _titleLabel; private static TextMeshProUGUI? _pageLabel; private static TextMeshProUGUI? _playerListPageLabel; private static TMP_InputField? _playerNameField; private static TextMeshProUGUI? _playerHintLabel; private static readonly List _cards = new List(); private static readonly List _playerListRows = new List(); private static readonly List _discoveredOnlinePlayers = new List(); private static bool _playerListOpen; private static int _playerListPage; private static bool _loggedPlayerSourceDiagnostics; private static WaitForSeconds WaitForSeconds { get { if (!Plugin.Eclipsed) { return _slowWait; } return _fastWait; } } internal static bool IsOpen => _panelOpen; internal static bool BlockMapInput => Time.realtimeSinceStartup < _blockMapInputUntil; internal static bool SuppressGameplayInput { get { if (Time.realtimeSinceStartup < _forceSuppressUntil) { return true; } if (_holdPlayerSuppression) { return true; } if (Time.realtimeSinceStartup < _suppressionGraceUntil) { return true; } if (!_panelOpen || _activeCategory != TeleportCategory.Player) { return false; } if ((Object)(object)_playerNameField != (Object)null) { return _playerNameField.isFocused; } return false; } } private static IReadOnlyList CurrentList => _activeCategory switch { TeleportCategory.Private => TeleportDataService.VisiblePrivateTeleports, TeleportCategory.Public => TeleportDataService.VisiblePublicTeleports, TeleportCategory.Player => TeleportDataService.VisiblePlayerTeleports, TeleportCategory.Waypoints => TeleportDataService.VisibleWaypoints, _ => TeleportDataService.VisiblePrivateTeleports, }; private static string CurrentCategoryLabel => _activeCategory switch { TeleportCategory.Private => "Private", TeleportCategory.Player => "Player", TeleportCategory.Waypoints => "Waypoints", _ => "Private", }; internal CanvasService(UICanvasBase canvas) { _killSwitch = false; _ready = false; _panelOpen = false; _activeCategory = TeleportCategory.Private; _page = 0; _holdPlayerSuppression = false; _suppressionGraceUntil = 0f; _blockMapInputUntil = 0f; _forceSuppressUntil = 0f; _nextOnlinePlayerCacheRefresh = 0f; _nextSocialMenuPrimeAttempt = 0f; _socialMenuPrimeInProgress = false; _playerListPage = 0; _cards.Clear(); _bottomBarCanvas = ((Component)canvas.BottomBarParent).gameObject.GetComponent(); _layer = ((Component)_bottomBarCanvas).gameObject.layer; if (Plugin.TeleportsPanel) { BuildIconButton(); BuildPanel(); GameObject? panel = _panel; if (panel != null) { panel.SetActive(false); } if ((Object)(object)_iconButton != (Object)null) { _ready = true; Core.StartCoroutine(UpdateLoop()); } } } private static IEnumerator UpdateLoop() { while (!_killSwitch) { if (_ready) { TeleportDataService.FinalizeIfExpired(); if (Time.realtimeSinceStartup >= _nextOnlinePlayerCacheRefresh) { RefreshOnlinePlayerCache(); _nextOnlinePlayerCacheRefresh = Time.realtimeSinceStartup + 5f; if (_panelOpen && _activeCategory == TeleportCategory.Player && _discoveredOnlinePlayers.Count == 0) { TryPrimeSocialMenuRoster(); } } if (ShouldReleasePlayerInput()) { DeactivatePlayerInput(); } if (_panelOpen && TeleportDataService.IsDirty) { RefreshPage(); TeleportDataService.IsDirty = false; } } yield return (_panelOpen && _activeCategory == TeleportCategory.Player) ? null : WaitForSeconds; } } private static void BuildIconButton() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_002e: 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_0058: 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_0081: 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) _iconButton = new GameObject("STP_Icon"); AttachToCanvas(_iconButton); RectTransform obj = _iconButton.AddComponent(); obj.anchorMin = new Vector2(0f, 0f); obj.anchorMax = new Vector2(0f, 0f); obj.pivot = new Vector2(0f, 0f); obj.anchoredPosition = new Vector2(104f, 60f); obj.sizeDelta = new Vector2(76f, 28f); ((Graphic)_iconButton.AddComponent()).color = new Color(0.06f, 0.06f, 0.12f, 0.85f); GameObject obj2 = MakeChild("IconLabel", _iconButton.transform); TextMeshProUGUI obj3 = obj2.AddComponent(); ((TMP_Text)obj3).text = "STP"; ((TMP_Text)obj3).fontSize = 12f; ((TMP_Text)obj3).alignment = (TextAlignmentOptions)514; ((TMP_Text)obj3).enableWordWrapping = false; FillParent(obj2); ((UnityEvent)_iconButton.AddComponent