using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; 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.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; 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: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ryang.peakdeathtunes")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0")] [assembly: AssemblyProduct("ryang.peakdeathtunes")] [assembly: AssemblyTitle("PEAKDeathTunes")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] 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 BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Microsoft.CodeAnalysis { [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace PEAKDeathTunes { [BepInPlugin("ryang.peakdeathtunes", "PEAKDeathTunes", "0.1.0")] public class Plugin : BaseUnityPlugin { public const string Id = "ryang.peakdeathtunes"; internal static ManualLogSource Log { get; private set; } public static string Name => "PEAKDeathTunes"; public static string Version => "0.1.0"; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)("Plugin " + Name + " is loaded!")); } } } namespace DeathTunes { public static class DeathCustomizationManager { private class ButtonHoverHandler : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { public Image Background; public TextMeshProUGUI Text; public Color NormalBackground; public Color HoverBackground; public Color NormalText; public Color HoverText; public void OnPointerEnter(PointerEventData eventData) { //IL_0018: 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) if ((Object)(object)Background != (Object)null) { ((Graphic)Background).color = HoverBackground; } if ((Object)(object)Text != (Object)null) { ((Graphic)Text).color = HoverText; } } public void OnPointerExit(PointerEventData eventData) { //IL_0018: 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) if ((Object)(object)Background != (Object)null) { ((Graphic)Background).color = NormalBackground; } if ((Object)(object)Text != (Object)null) { ((Graphic)Text).color = NormalText; } } } [CompilerGenerated] private static class <>O { public static UnityAction <0>__PlaySelectedSound; public static UnityAction <1>__SaveSelection; public static UnityAction <2>__CloseMenu; public static Func <3>__Exists; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__23_0; public static UnityAction <>9__23_1; internal void b__23_0() { PreviousSound(); UpdateMenuDisplay(); } internal void b__23_1() { NextSound(); UpdateMenuDisplay(); } } public static readonly Dictionary Sounds = new Dictionary(); public static readonly List SoundIDs = new List(); public static string SelectedSound = ""; private static int soundIndex; private static GameObject menu; private static TextMeshProUGUI soundNameText; private static TextMeshProUGUI soundCounterText; private static Button previousButton; private static Button nextButton; private static Button previewButton; private static Button saveButton; private static Button closeButton; private static TMP_FontAsset gameFont; private static readonly Color WhiteColor = Color32.op_Implicit(new Color32((byte)252, (byte)254, (byte)253, byte.MaxValue)); private static readonly Color BlueColor = Color32.op_Implicit(new Color32((byte)79, (byte)126, (byte)251, byte.MaxValue)); public static int CurrentSoundIndex => soundIndex; public static bool IsMenuOpen() { return (Object)(object)menu != (Object)null && menu.activeInHierarchy; } public static void LoadSounds() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { return; } string path = Path.Combine(directoryName, "Sounds"); List list = new List(); if (Directory.Exists(path)) { list.AddRange(Directory.GetFiles(path, "*.wav", SearchOption.AllDirectories)); } list.AddRange(Directory.GetFiles(directoryName, "*.wav", SearchOption.TopDirectoryOnly)); foreach (string item in list.Distinct()) { try { AudioClip val = DeathTunesPlugin.Instance.LoadWav(item); if (!((Object)(object)val == (Object)null)) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(item); if (!Sounds.ContainsKey(fileNameWithoutExtension)) { Sounds.Add(fileNameWithoutExtension, val); SoundIDs.Add(fileNameWithoutExtension); } } } catch (Exception arg) { DeathTunesPlugin.Log.LogError((object)$"Failed loading {item}: {arg}"); } } SoundIDs.Sort(StringComparer.OrdinalIgnoreCase); if (SoundIDs.Count == 0) { SelectedSound = ""; soundIndex = 0; return; } string value = DeathTunesPlugin.SavedDeathSound.Value; if (!string.IsNullOrEmpty(value) && Sounds.ContainsKey(value)) { SelectedSound = value; soundIndex = SoundIDs.IndexOf(value); } else { soundIndex = 0; SelectedSound = SoundIDs[0]; } } public static void OpenMenu() { if (IsMainMenu()) { if ((Object)(object)menu == (Object)null) { CreateMenu(); } menu.SetActive(true); UpdateMenuDisplay(); } } public static void CloseMenu() { if ((Object)(object)menu != (Object)null) { menu.SetActive(false); } } public static bool IsMainMenu() { //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) Scene activeScene = SceneManager.GetActiveScene(); if (!((Scene)(ref activeScene)).IsValid() || !((Scene)(ref activeScene)).isLoaded) { return false; } GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects(); GameObject[] array = rootGameObjects; foreach (GameObject val in array) { if ((Object)(object)FindInChildren(val.transform, "MainMenu") != (Object)null) { return true; } } return false; } private static Transform FindInChildren(Transform parent, string name) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if (((Object)parent).name.Equals(name, StringComparison.OrdinalIgnoreCase)) { return parent; } foreach (Transform item in parent) { Transform parent2 = item; Transform val = FindInChildren(parent2, name); if ((Object)(object)val != (Object)null) { return val; } } return null; } private static void CreateMenu() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0057: 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_00b9: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0108: Expected O, but got Unknown //IL_0135: 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_0163: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0308: 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_02e1: 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_02ec: Expected O, but got Unknown //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Expected O, but got Unknown //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Expected O, but got Unknown //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_043a: 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_0445: Expected O, but got Unknown //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Expected O, but got Unknown gameFont = FindGameFont(); menu = new GameObject("DeathTunesMenu"); Canvas val = menu.AddComponent(); val.renderMode = (RenderMode)0; val.sortingOrder = 5000; CanvasScaler val2 = menu.AddComponent(); val2.uiScaleMode = (ScaleMode)1; val2.referenceResolution = new Vector2(1920f, 1080f); val2.screenMatchMode = (ScreenMatchMode)0; val2.matchWidthOrHeight = 0.5f; menu.AddComponent(); GameObject val3 = CreateBoardingPass(menu.transform); RectTransform component = val3.GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.pivot = new Vector2(0.5f, 0.5f); component.sizeDelta = new Vector2(1200f, 400f); component.anchoredPosition = Vector2.zero; GameObject val4 = new GameObject("Content"); val4.transform.SetParent(menu.transform, false); RectTransform val5 = val4.AddComponent(); val5.anchorMin = new Vector2(0.5f, 0.5f); val5.anchorMax = new Vector2(0.5f, 0.5f); val5.pivot = new Vector2(0.5f, 0.5f); val5.sizeDelta = new Vector2(1200f, 300f); val5.anchoredPosition = new Vector2(0f, -30f); CreateText(val4.transform, "DEATHTUNES", 37, new Vector2(-260f, 103f), BlueColor); CreateText(val4.transform, "DEATH SOUND CUSTOMIZATION", 21, new Vector2(-260f, 68f), BlueColor); CreateText(val4.transform, "SELECT SOUND", 20, new Vector2(-260f, 38f), BlueColor); GameObject val6 = CreatePanel(val4.transform, new Vector2(410f, 52f), new Vector2(-260f, -5f), WhiteColor); AddBorder(val6, BlueColor, 2f); GameObject val7 = CreateText(val6.transform, "", 25, Vector2.zero, BlueColor); soundNameText = val7.GetComponent(); ((TMP_Text)soundNameText).fontStyle = (FontStyles)1; previousButton = CreateStyledButton(val4.transform, "‹", new Vector2(-495f, -5f), new Vector2(52f, 52f), arrow: true); ButtonClickedEvent onClick = previousButton.onClick; object obj = <>c.<>9__23_0; if (obj == null) { UnityAction val8 = delegate { PreviousSound(); UpdateMenuDisplay(); }; <>c.<>9__23_0 = val8; obj = (object)val8; } ((UnityEvent)onClick).AddListener((UnityAction)obj); nextButton = CreateStyledButton(val4.transform, "›", new Vector2(-25f, -5f), new Vector2(52f, 52f), arrow: true); ButtonClickedEvent onClick2 = nextButton.onClick; object obj2 = <>c.<>9__23_1; if (obj2 == null) { UnityAction val9 = delegate { NextSound(); UpdateMenuDisplay(); }; <>c.<>9__23_1 = val9; obj2 = (object)val9; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); GameObject val10 = CreateText(val4.transform, "", 16, new Vector2(-260f, -43f), BlueColor); soundCounterText = val10.GetComponent(); previewButton = CreateStyledButton(val4.transform, "> PREVIEW SOUND", new Vector2(340f, 40f), new Vector2(280f, 46f), arrow: false); ButtonClickedEvent onClick3 = previewButton.onClick; object obj3 = <>O.<0>__PlaySelectedSound; if (obj3 == null) { UnityAction val11 = PlaySelectedSound; <>O.<0>__PlaySelectedSound = val11; obj3 = (object)val11; } ((UnityEvent)onClick3).AddListener((UnityAction)obj3); saveButton = CreateStyledButton(val4.transform, "> SAVE", new Vector2(340f, -22f), new Vector2(180f, 46f), arrow: false); ButtonClickedEvent onClick4 = saveButton.onClick; object obj4 = <>O.<1>__SaveSelection; if (obj4 == null) { UnityAction val12 = SaveSelection; <>O.<1>__SaveSelection = val12; obj4 = (object)val12; } ((UnityEvent)onClick4).AddListener((UnityAction)obj4); closeButton = CreateStyledButton(val4.transform, "> CLOSE", new Vector2(340f, -84f), new Vector2(180f, 46f), arrow: false); ButtonClickedEvent onClick5 = closeButton.onClick; object obj5 = <>O.<2>__CloseMenu; if (obj5 == null) { UnityAction val13 = CloseMenu; <>O.<2>__CloseMenu = val13; obj5 = (object)val13; } ((UnityEvent)onClick5).AddListener((UnityAction)obj5); menu.SetActive(false); } private static GameObject CreateBoardingPass(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002c: 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_0058: 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_007a: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BoardingPass"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent(); val2.anchorMin = new Vector2(0.5f, 0.5f); val2.anchorMax = new Vector2(0.5f, 0.5f); val2.pivot = new Vector2(0.5f, 0.5f); val2.sizeDelta = new Vector2(1200f, 400f); val2.anchoredPosition = Vector2.zero; Image val3 = val.AddComponent(); ((Graphic)val3).color = Color.white; ((Graphic)val3).raycastTarget = false; string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { return val; } string[] source = new string[3] { Path.Combine(directoryName, "Sounds", "Boarding_pass_full.png"), Path.Combine(directoryName, "Boarding_pass_full.png"), Path.Combine(directoryName, "DeathTunes", "Sounds", "Boarding_pass_full.png") }; string text = source.FirstOrDefault(File.Exists); if (string.IsNullOrEmpty(text)) { DeathTunesPlugin.Log.LogError((object)"Could not find Boarding_pass_full.png."); return val; } try { byte[] array = File.ReadAllBytes(text); Texture2D val4 = new Texture2D(2, 2, (TextureFormat)4, false); if (!ImageConversion.LoadImage(val4, array, false)) { Object.Destroy((Object)(object)val4); return val; } ((Texture)val4).wrapMode = (TextureWrapMode)1; ((Texture)val4).filterMode = (FilterMode)1; Sprite sprite = Sprite.Create(val4, new Rect(0f, 0f, (float)((Texture)val4).width, (float)((Texture)val4).height), new Vector2(0.5f, 0.5f), 1f); val3.sprite = sprite; val3.preserveAspect = false; } catch (Exception arg) { DeathTunesPlugin.Log.LogError((object)$"Failed to load Boarding_pass_full.png: {arg}"); } return val; } private static void UpdateMenuDisplay() { if ((Object)(object)soundNameText == (Object)null) { return; } if (SoundIDs.Count == 0) { ((TMP_Text)soundNameText).text = "NO SOUNDS FOUND"; if ((Object)(object)soundCounterText != (Object)null) { ((TMP_Text)soundCounterText).text = "SOUND 0 / 0"; } return; } if (soundIndex < 0) { soundIndex = SoundIDs.Count - 1; } if (soundIndex >= SoundIDs.Count) { soundIndex = 0; } SelectedSound = SoundIDs[soundIndex]; ((TMP_Text)soundNameText).text = FormatSoundName(SelectedSound); if ((Object)(object)soundCounterText != (Object)null) { ((TMP_Text)soundCounterText).text = $"SOUND {soundIndex + 1} / {SoundIDs.Count}"; } } private static void SaveSelection() { if (string.IsNullOrEmpty(SelectedSound)) { return; } DeathTunesPlugin.SavedDeathSound.Value = SelectedSound; Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter != (Object)null) { PhotonView photonView = ((MonoBehaviourPun)localCharacter).photonView; if ((Object)(object)photonView != (Object)null) { DeathSoundNetworking.SendSelection(photonView.ViewID, SelectedSound); } } DeathTunesPlugin.Log.LogInfo((object)("Saved death sound: " + SelectedSound)); } private static void NextSound() { if (SoundIDs.Count != 0) { soundIndex++; if (soundIndex >= SoundIDs.Count) { soundIndex = 0; } } } private static void PreviousSound() { if (SoundIDs.Count != 0) { soundIndex--; if (soundIndex < 0) { soundIndex = SoundIDs.Count - 1; } } } private static void PlaySelectedSound() { if (!string.IsNullOrEmpty(SelectedSound) && Sounds.TryGetValue(SelectedSound, out AudioClip value)) { DeathTunesPlugin.PlayClip(value); } } private static GameObject CreatePanel(Transform parent, Vector2 size, Vector2 position, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002c: 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_0058: 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_006c: 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) GameObject val = new GameObject("Panel"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent(); val2.anchorMin = new Vector2(0.5f, 0.5f); val2.anchorMax = new Vector2(0.5f, 0.5f); val2.pivot = new Vector2(0.5f, 0.5f); val2.sizeDelta = size; val2.anchoredPosition = position; Image val3 = val.AddComponent(); ((Graphic)val3).color = color; return val; } private static GameObject CreateText(Transform parent, string value, int size, Vector2 position, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002c: 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_0058: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Text"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent(); val2.anchorMin = new Vector2(0.5f, 0.5f); val2.anchorMax = new Vector2(0.5f, 0.5f); val2.pivot = new Vector2(0.5f, 0.5f); val2.sizeDelta = new Vector2(600f, 54f); val2.anchoredPosition = position; TextMeshProUGUI val3 = val.AddComponent(); ((TMP_Text)val3).text = value; ((TMP_Text)val3).fontSize = size; ((Graphic)val3).color = color; ((TMP_Text)val3).alignment = (TextAlignmentOptions)514; ((TMP_Text)val3).textWrappingMode = (TextWrappingModes)0; ((Graphic)val3).raycastTarget = false; if ((Object)(object)gameFont != (Object)null) { ((TMP_Text)val3).font = gameFont; } return val; } private static Button CreateStyledButton(Transform parent, string value, Vector2 position, Vector2 size, bool arrow) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002c: 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_0058: 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_006c: 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_007f: 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_00c2: 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_00cb: 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_010f: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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) GameObject val = new GameObject("Button"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent(); val2.anchorMin = new Vector2(0.5f, 0.5f); val2.anchorMax = new Vector2(0.5f, 0.5f); val2.pivot = new Vector2(0.5f, 0.5f); val2.sizeDelta = size; val2.anchoredPosition = position; Image val3 = val.AddComponent(); ((Graphic)val3).color = (arrow ? BlueColor : WhiteColor); Button val4 = val.AddComponent