Decompiled source of ElevatorUpgrades v0.1.1

ElevatorUpgrades.dll

Decompiled 2 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
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 ElevatorUpgrades.Helpers;
using ElevatorUpgrades.UI;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.ResourceLocations;
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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class ExtensionMarkerAttribute : Attribute
	{
		private readonly string <Name>k__BackingField;

		public string Name => <Name>k__BackingField;

		public ExtensionMarkerAttribute(string name)
		{
			<Name>k__BackingField = name;
		}
	}
}
namespace ElevatorUpgrades
{
	[BepInPlugin("duviz.ElevatorUpgrades", "ElevatorUpgrades", "0.1.1")]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin instance;

		public static ConfigFile config;

		private static TMP_Text debugText;

		public void Awake()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			config = ((BaseUnityPlugin)this).Config;
			new Harmony("duviz.ElevatorUpgrades").PatchAll();
		}

		public void Start()
		{
			BundleLoader.LoadBundle("Assets.elevatorupgrades.bundle");
			UpgradesManager.CreateDefaultUpgrades();
		}

		public static T Ass<T>(string path)
		{
			return AssHelper.Ass<T>(path);
		}

		public static void LogInfo(object msg)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo(msg);
		}

		public static void LogWarning(object msg)
		{
			((BaseUnityPlugin)instance).Logger.LogWarning(msg);
		}

		public static void LogError(object msg)
		{
			((BaseUnityPlugin)instance).Logger.LogError(msg);
		}

		public static void DebugText(string text)
		{
		}
	}
	public class PluginInfo
	{
		public const string GUID = "duviz.ElevatorUpgrades";

		public const string Name = "ElevatorUpgrades";

		public const string Version = "0.1.1";
	}
	[HarmonyPatch(typeof(ShopZone))]
	public static class ShopPatch
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__0_0;

			internal void <Postfix>b__0_0()
			{
				UpgradesManager.OpenMenu();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ShopZone), "Start")]
		public static void Postfix(ShopZone __instance)
		{
			//IL_00d2: 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_0111: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Expected O, but got Unknown
			if (!(((Object)__instance).name == "Shop") || !((Object)(object)((Component)__instance).transform.parent != (Object)null) || !(((Object)((Component)__instance).transform.parent).name == "Room"))
			{
				return;
			}
			Transform val = ((Component)__instance).transform.Find("Canvas/Background/Main Panel/Main Menu/Buttons");
			Transform val2 = val.Find("SandboxButton");
			Plugin.DebugText(Object.op_Implicit((Object)(object)val) ? "Got Buttons" : "<color=red>Failed to get buttons</color>");
			Plugin.DebugText(Object.op_Implicit((Object)(object)val2) ? "Got shop button" : "<color=red>Failed to shop button</color>");
			Transform val3 = Object.Instantiate<Transform>(val2, val);
			((Object)val3).name = "ElevatorButton";
			((Component)val3).GetComponentInChildren<TMP_Text>(true).text = "Elevator Upgrades";
			((Component)val3).GetComponent<RectTransform>().sizeDelta = new Vector2(207.5f, 30f);
			ShopButton component = ((Component)val3).GetComponent<ShopButton>();
			component.toActivate = Array.Empty<GameObject>();
			component.toDeactivate = Array.Empty<GameObject>();
			Button component2 = ((Component)val3).GetComponent<Button>();
			component2.onClick = new ButtonClickedEvent();
			((UnityEventBase)component2.onClick).RemoveAllListeners();
			ButtonClickedEvent onClick = component2.onClick;
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				UnityAction val4 = delegate
				{
					UpgradesManager.OpenMenu();
				};
				<>c.<>9__0_0 = val4;
				obj = (object)val4;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj);
			UpgradesManager.firstRoom = ((Component)((Component)__instance).transform.parent).gameObject;
			UpgradesManager.CheckForUpgrades();
		}
	}
	public class UpgradesMenu : MonoBehaviour
	{
		public static UpgradesMenu instance;

		private GameObject currentUI;

		public void Awake()
		{
			instance = this;
		}

		public void Open()
		{
			if (!Object.op_Implicit((Object)(object)currentUI))
			{
				RefreshUI();
				Lock();
				Plugin.DebugText("UpgradesMenu OPENED");
			}
		}

		public void Close()
		{
			ResetUI();
			Unlock();
			Plugin.DebugText("UpgradesMenu CLOSED");
		}

		public void Lock()
		{
			//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_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_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_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_003a: Expected O, but got Unknown
			SetPlayer(active: false);
			GameStateManager.Instance.RegisterState(new GameState("ELEVATOR.UPGRADES")
			{
				cursorLock = (LockMode)2,
				playerInputLock = (LockMode)1,
				cameraInputLock = (LockMode)1,
				priority = 50
			});
		}

		public void Unlock()
		{
			SetPlayer(active: true);
			GameStateManager.Instance.PopState("ELEVATOR.UPGRADES");
		}

		public void SetPlayer(bool active)
		{
			NewMovement val = MonoSingleton<NewMovement>.Instance;
			GunControl componentInChildren = ((Component)val).GetComponentInChildren<GunControl>();
			FistControl componentInChildren2 = ((Component)val).GetComponentInChildren<FistControl>();
			CameraController val2 = MonoSingleton<CameraController>.Instance;
			((Behaviour)val).enabled = active;
			((Behaviour)componentInChildren).enabled = active;
			((Behaviour)componentInChildren2).enabled = active;
			((Behaviour)val2).enabled = active;
			MonoSingleton<OptionsManager>.Instance.paused = !active;
			if (active)
			{
				MonoSingleton<OptionsManager>.Instance.UnPause();
			}
		}

		public void ResetUI()
		{
			if (Object.op_Implicit((Object)(object)currentUI))
			{
				Object.Destroy((Object)(object)currentUI);
			}
		}

		public void RefreshUI()
		{
			//IL_0040: 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_0068: 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_00b5: 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_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_00f6: 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_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_0114: 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_0143: 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_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Expected O, but got Unknown
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: 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_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: 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_0304: Expected O, but got Unknown
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			ResetUI();
			Canvas val = Builder.Canvas();
			val.sortingOrder = 30001;
			currentUI = ((Component)val).gameObject;
			Builder.Image(currentUI, new Vector2(0f, 1080f), new Vector2(10000f, 10000f), (Color?)new Color(0f, 0f, 0f, 0.8f), (Vector2?)null, (Vector2?)null, (Vector2?)null);
			Builder.Text(currentUI, new Vector2(0f, 0f), new Vector2(1000f, 50f), MoneyText.DivideMoney(GameProgressSaver.GetMoney()) + " <color=#FF4343>P</color>", 50f, (TextAlignmentOptions)260, Color.white, Vector2.right + Vector2.up, Vector2.right + Vector2.up, Vector2.right + Vector2.up);
			Button val2 = Builder.Button(currentUI, new Vector2(0f, 0f), new Vector2(200f, 50f), "CLOSE", 20f, (TextAlignmentOptions)514, Vector2.right, Vector2.right, Vector2.right);
			((UnityEvent)val2.onClick).AddListener((UnityAction)delegate
			{
				Close();
			});
			float num = 0f;
			float num2 = 0f;
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(200f, 200f);
			foreach (Upgrade upgrade in UpgradesManager.Upgrades)
			{
				Button val4 = Builder.Button(currentUI, new Vector2(num, num2), val3, upgrade.name ?? "", 20f, (TextAlignmentOptions)257);
				Builder.Text(((Component)val4).gameObject, new Vector2(num, num2), val3, upgrade.GetCostText() ?? "", 20f, (TextAlignmentOptions)1028, Color.black);
				Builder.Text(((Component)val4).gameObject, new Vector2(num + 200f, num2), val3, upgrade.description ?? "", 20f, (TextAlignmentOptions)257, Color.white);
				((UnityEvent)val4.onClick).AddListener((UnityAction)delegate
				{
					UpgradesManager.Buy(upgrade);
				});
				if (upgrade.IsBought() || upgrade.locked)
				{
					((Selectable)val4).interactable = false;
				}
				num2 -= val3.y / 1.75f;
				Plugin.DebugText(num2.ToString());
				if (num2 < -400f)
				{
					num2 = 0f;
					num += 250f;
				}
			}
		}
	}
	public static class UpgradesManager
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__11_0;

			public static UnityAction <>9__11_1;

			public static UnityAction <>9__11_2;

			public static UnityAction <>9__11_3;

			public static UnityAction <>9__11_4;

			public static UnityAction <>9__11_5;

			internal void <CreateDefaultUpgrades>b__11_0()
			{
				//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_0050: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Levels/Decorations/ApartmentChair.prefab"));
				val.transform.position = new Vector3(-3.1233f, -0.9893f, -51.2066f) + offset;
				val.transform.eulerAngles = new Vector3(1.0203f, 33.7634f, 0.1241f);
			}

			internal void <CreateDefaultUpgrades>b__11_1()
			{
				//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_0042: 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)
				GameObject val = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Levels/Interactive/GrapplePointSlingshot Variant.prefab"));
				val.transform.position = new Vector3(0f, 3f, -35f) + offset;
				Transform transform = val.transform;
				transform.localScale /= 2f;
			}

			internal void <CreateDefaultUpgrades>b__11_2()
			{
				//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_018b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Expected O, but got Unknown
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01bb: Expected O, but got Unknown
				//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c7: Expected O, but got Unknown
				GameObject val = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Levels/CoolingChamber.prefab"));
				val.transform.position = new Vector3(0f, -2.25f, -32.25f) + offset;
				Transform val2 = val.transform.Find("ActivationTrigger");
				GameObject gameObject = ((Component)val.transform.Find("Sequence")).gameObject;
				Object.Destroy((Object)(object)((Component)val2).GetComponent<ItemTrigger>());
				Object.Destroy((Object)(object)((Component)val.transform.Find("FogTrigger")).GetComponent<FogEnabler>());
				((Component)val.transform.Find("GlassDoors").Find("Door 1")).gameObject.SetActive(false);
				((Component)val.transform.Find("GlassDoors").Find("Door 2")).gameObject.SetActive(false);
				((Component)val.transform.Find("GlassDoors (1)").Find("Door 1")).gameObject.SetActive(false);
				((Component)val.transform.Find("GlassDoors (1)").Find("Door 2")).gameObject.SetActive(false);
				DisableCollisionRecursive(val.transform.Find("GlassDoors").Find("Doorframe"));
				DisableCollisionRecursive(val.transform.Find("GlassDoors (1)").Find("Doorframe"));
				DisableCollisionRecursive(val.transform.Find("Vent"));
				ObjectActivator val3 = ((Component)val2).gameObject.AddComponent<ObjectActivator>();
				val3.oneTime = true;
				UltrakillEvent val4 = new UltrakillEvent();
				val4.toActivateObjects = (GameObject[])(object)new GameObject[1] { gameObject };
				val4.toDisActivateObjects = Array.Empty<GameObject>();
				val4.onActivate = new UnityEvent();
				val4.onDisActivate = new UnityEvent();
				val3.events = val4;
			}

			internal void <CreateDefaultUpgrades>b__11_3()
			{
				//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_0040: 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_0084: 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)
				GameObject val = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Fishing/Fish Pickup Template.prefab"));
				GameObject val2 = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Fishing/Fishes/Shark Fish.prefab"));
				val.transform.position = new Vector3(4.5f, 2f, -42.25f) + offset;
				val2.transform.SetParent(val.transform, false);
				val2.transform.localPosition = Vector3.zero;
				val2.transform.localEulerAngles = new Vector3(280f, 180f, 0f);
				val.transform.eulerAngles = new Vector3(280f, 20f, 0f);
			}

			internal void <CreateDefaultUpgrades>b__11_4()
			{
				//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_0035: 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_0066: 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)
				GameObject val = Object.Instantiate<GameObject>(BundleLoader.bundle.LoadAsset<GameObject>("BlowmePrefab"));
				val.transform.position = new Vector3(-9.6982f, -0.5f, -35f) + offset;
				val.transform.eulerAngles = new Vector3(0f, 319.1443f, 0f);
				val.transform.localScale = Vector3.one * 3f;
				val.layer = LayerMask.NameToLayer("Environment");
			}

			internal void <CreateDefaultUpgrades>b__11_5()
			{
			}
		}

		public static List<Upgrade> Upgrades = new List<Upgrade>();

		public static List<Sale> Sales = new List<Sale>();

		public static GameObject checker;

		public static GameObject firstRoom;

		public static Vector3 offset => GetOffset();

		public static void OpenMenu()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)UpgradesMenu.instance))
			{
				new GameObject("UpgradesMenu").AddComponent<UpgradesMenu>();
			}
			UpgradesMenu.instance.Open();
		}

		public static bool CanAfford(int points)
		{
			return GameProgressSaver.GetMoney() >= points;
		}

		public static void Buy(Upgrade upgrade)
		{
			if (CanAfford(upgrade.cost))
			{
				GameProgressSaver.AddMoney(-upgrade.cost);
				upgrade.Buy();
				upgrade.onBought.Invoke();
				MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("<color=green>Upgrade bought!", "", "", 0, false, false, true);
				UpgradesMenu.instance.RefreshUI();
			}
			else
			{
				MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("<color=red>Not enough P!", "", "", 0, false, false, true);
			}
		}

		public static void CheckForUpgrades()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)checker))
			{
				return;
			}
			checker = new GameObject("UpgradesChecker");
			foreach (Upgrade upgrade in Upgrades)
			{
				if (upgrade.IsBought())
				{
					upgrade.onBought.Invoke();
				}
			}
		}

		private static Vector3 GetOffset()
		{
			//IL_001e: 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_0023: 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)
			return Object.op_Implicit((Object)(object)firstRoom) ? firstRoom.transform.position : Vector3.zero;
		}

		public static void CreateDefaultUpgrades()
		{
			//IL_00d8: 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_00e3: Expected O, but got Unknown
			//IL_0125: 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_0130: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Expected O, but got Unknown
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Expected O, but got Unknown
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Expected O, but got Unknown
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Expected O, but got Unknown
			Sales.Add(new Sale("Modifiers", 0.3f, 31));
			Sales.Add(new Sale("Shark", 0.5f, 1));
			Sales.Add(new Sale("Cooling Chamber", 0.75f, 9));
			Sales.Add(new Sale("Chair", 0.75f, 15));
			Sales.Add(new Sale("Slingshot", 0.5f, 14));
			Sales.Add(new Sale("Blow me", 0.75f, 20));
			Upgrade upgrade = new Upgrade("Chair", "Be comfy :3", 1000000);
			UnityEvent onBought = upgrade.onBought;
			object obj = <>c.<>9__11_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
					//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_0050: Unknown result type (might be due to invalid IL or missing references)
					GameObject val15 = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Levels/Decorations/ApartmentChair.prefab"));
					val15.transform.position = new Vector3(-3.1233f, -0.9893f, -51.2066f) + offset;
					val15.transform.eulerAngles = new Vector3(1.0203f, 33.7634f, 0.1241f);
				};
				<>c.<>9__11_0 = val;
				obj = (object)val;
			}
			onBought.AddListener((UnityAction)obj);
			Upgrades.Add(upgrade);
			Upgrade upgrade2 = new Upgrade("Slingshot", "Could help in speedrunning :3", 3000000);
			UnityEvent onBought2 = upgrade2.onBought;
			object obj2 = <>c.<>9__11_1;
			if (obj2 == null)
			{
				UnityAction val2 = delegate
				{
					//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_0042: 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)
					GameObject val14 = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Levels/Interactive/GrapplePointSlingshot Variant.prefab"));
					val14.transform.position = new Vector3(0f, 3f, -35f) + offset;
					Transform transform = val14.transform;
					transform.localScale /= 2f;
				};
				<>c.<>9__11_1 = val2;
				obj2 = (object)val2;
			}
			onBought2.AddListener((UnityAction)obj2);
			Upgrades.Add(upgrade2);
			Upgrade upgrade3 = new Upgrade("Cooling Chamber", "Stay wet >~<", 10000000);
			UnityEvent onBought3 = upgrade3.onBought;
			object obj3 = <>c.<>9__11_2;
			if (obj3 == null)
			{
				UnityAction val3 = delegate
				{
					//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_018b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0192: Expected O, but got Unknown
					//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
					//IL_01bb: Expected O, but got Unknown
					//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c7: Expected O, but got Unknown
					GameObject val10 = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Levels/CoolingChamber.prefab"));
					val10.transform.position = new Vector3(0f, -2.25f, -32.25f) + offset;
					Transform val11 = val10.transform.Find("ActivationTrigger");
					GameObject gameObject = ((Component)val10.transform.Find("Sequence")).gameObject;
					Object.Destroy((Object)(object)((Component)val11).GetComponent<ItemTrigger>());
					Object.Destroy((Object)(object)((Component)val10.transform.Find("FogTrigger")).GetComponent<FogEnabler>());
					((Component)val10.transform.Find("GlassDoors").Find("Door 1")).gameObject.SetActive(false);
					((Component)val10.transform.Find("GlassDoors").Find("Door 2")).gameObject.SetActive(false);
					((Component)val10.transform.Find("GlassDoors (1)").Find("Door 1")).gameObject.SetActive(false);
					((Component)val10.transform.Find("GlassDoors (1)").Find("Door 2")).gameObject.SetActive(false);
					DisableCollisionRecursive(val10.transform.Find("GlassDoors").Find("Doorframe"));
					DisableCollisionRecursive(val10.transform.Find("GlassDoors (1)").Find("Doorframe"));
					DisableCollisionRecursive(val10.transform.Find("Vent"));
					ObjectActivator val12 = ((Component)val11).gameObject.AddComponent<ObjectActivator>();
					val12.oneTime = true;
					UltrakillEvent val13 = new UltrakillEvent();
					val13.toActivateObjects = (GameObject[])(object)new GameObject[1] { gameObject };
					val13.toDisActivateObjects = Array.Empty<GameObject>();
					val13.onActivate = new UnityEvent();
					val13.onDisActivate = new UnityEvent();
					val12.events = val13;
				};
				<>c.<>9__11_2 = val3;
				obj3 = (object)val3;
			}
			onBought3.AddListener((UnityAction)obj3);
			Upgrades.Add(upgrade3);
			Upgrade upgrade4 = new Upgrade("Shark", "You need one of these :3", 50000000);
			UnityEvent onBought4 = upgrade4.onBought;
			object obj4 = <>c.<>9__11_3;
			if (obj4 == null)
			{
				UnityAction val4 = delegate
				{
					//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_0040: 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_0084: 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)
					GameObject val8 = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Fishing/Fish Pickup Template.prefab"));
					GameObject val9 = Object.Instantiate<GameObject>(Plugin.Ass<GameObject>("Assets/Prefabs/Fishing/Fishes/Shark Fish.prefab"));
					val8.transform.position = new Vector3(4.5f, 2f, -42.25f) + offset;
					val9.transform.SetParent(val8.transform, false);
					val9.transform.localPosition = Vector3.zero;
					val9.transform.localEulerAngles = new Vector3(280f, 180f, 0f);
					val8.transform.eulerAngles = new Vector3(280f, 20f, 0f);
				};
				<>c.<>9__11_3 = val4;
				obj4 = (object)val4;
			}
			onBought4.AddListener((UnityAction)obj4);
			Upgrades.Add(upgrade4);
			Upgrade upgrade5 = new Upgrade("Blow me", "...", 100000000);
			UnityEvent onBought5 = upgrade5.onBought;
			object obj5 = <>c.<>9__11_4;
			if (obj5 == null)
			{
				UnityAction val5 = delegate
				{
					//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_0035: 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_0066: 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)
					GameObject val7 = Object.Instantiate<GameObject>(BundleLoader.bundle.LoadAsset<GameObject>("BlowmePrefab"));
					val7.transform.position = new Vector3(-9.6982f, -0.5f, -35f) + offset;
					val7.transform.eulerAngles = new Vector3(0f, 319.1443f, 0f);
					val7.transform.localScale = Vector3.one * 3f;
					val7.layer = LayerMask.NameToLayer("Environment");
				};
				<>c.<>9__11_4 = val5;
				obj5 = (object)val5;
			}
			onBought5.AddListener((UnityAction)obj5);
			Upgrades.Add(upgrade5);
			Upgrade upgrade6 = new Upgrade("Modifiers", "Not yet...", 1000000000, locked: true);
			UnityEvent onBought6 = upgrade6.onBought;
			object obj6 = <>c.<>9__11_5;
			if (obj6 == null)
			{
				UnityAction val6 = delegate
				{
				};
				<>c.<>9__11_5 = val6;
				obj6 = (object)val6;
			}
			onBought6.AddListener((UnityAction)obj6);
			Upgrades.Add(upgrade6);
		}

		public static void DisableCollisionRecursive(Transform t)
		{
			Collider component = ((Component)t).GetComponent<Collider>();
			if (component != null)
			{
				component.enabled = false;
			}
			for (int i = 0; i < t.childCount; i++)
			{
				DisableCollisionRecursive(t.GetChild(i));
			}
		}
	}
	public class Upgrade
	{
		public string name;

		public string description;

		public int _cost;

		public bool locked;

		public UnityEvent onBought;

		private string pref => "ElevatorUpgrades.Bought." + name;

		public int cost => GetCost();

		public Upgrade(string name, string description, int cost, bool locked = false)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			this.name = name;
			this.description = description;
			_cost = cost;
			this.locked = locked;
			onBought = new UnityEvent();
			base..ctor();
		}

		public int GetCost()
		{
			Sale sale = GetSale();
			if (sale != null)
			{
				return (int)((float)_cost * sale.percentage);
			}
			return _cost;
		}

		public string GetCostText()
		{
			Sale sale = GetSale();
			if (sale != null)
			{
				return $"<color=red><s>({MoneyText.DivideMoney(_cost)} P)</s></color>\n({MoneyText.DivideMoney(cost)} P)\n<color=green>({100 - (int)(sale.percentage * 100f)}% off)</color>";
			}
			return "(" + MoneyText.DivideMoney(cost) + " P)";
		}

		public Sale GetSale()
		{
			foreach (Sale sale in UpgradesManager.Sales)
			{
				if (sale.name == name && sale.isValid)
				{
					return sale;
				}
			}
			return null;
		}

		public void Buy()
		{
			MonoSingleton<PrefsManager>.Instance.SetBool(pref, true);
		}

		public bool IsBought()
		{
			return MonoSingleton<PrefsManager>.Instance.GetBool(pref, false);
		}
	}
	public class Sale
	{
		public string name;

		public float percentage;

		public int day;

		public bool isValid => IsValid();

		public Sale(string upgrade, float percentage, int day)
		{
			name = upgrade;
			this.percentage = percentage;
			this.day = day;
			base..ctor();
		}

		private bool IsValid()
		{
			return DateTime.Now.Day == day;
		}
	}
}
namespace ElevatorUpgrades.UI
{
	public static class Builder
	{
		private static TMP_FontAsset _font;

		public static TMP_FontAsset font
		{
			get
			{
				if (!Object.op_Implicit((Object)(object)_font))
				{
					LoadFont();
				}
				return _font;
			}
		}

		public static void LoadFont()
		{
			_font = Plugin.Ass<TMP_FontAsset>("Assets/Fonts/VCR_OSD_MONO_UI.asset");
		}

		public static Canvas Canvas(float width = 1920f, float height = 1080f)
		{
			//IL_0006: 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_001d: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("RuntimeCanvas")
			{
				layer = LayerMask.NameToLayer("UI")
			};
			Canvas val2 = val.AddComponent<Canvas>();
			val2.renderMode = (RenderMode)0;
			val2.pixelPerfect = true;
			val2.sortingOrder = 10000;
			CanvasScaler val3 = val.AddComponent<CanvasScaler>();
			val3.uiScaleMode = (ScaleMode)1;
			val3.referenceResolution = new Vector2(width, height);
			val3.screenMatchMode = (ScreenMatchMode)2;
			val.AddComponent<GraphicRaycaster>();
			Plugin.LogInfo("Canvas created!");
			return val2;
		}

		public static TMP_Text Text(GameObject container, Vector2 position, Vector2 sizeDelta, string defaultText = "Ella jura", float size = 20f, TextAlignmentOptions alignment = 257, Color? color = null, Vector2? anchorMin = null, Vector2? anchorMax = null, Vector2? pivot = null)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0046: 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_0071: 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_009c: 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_00a8: 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_00dc: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Text");
			val.transform.SetParent(container.transform, false);
			RectTransform orAddComponent = GameObjectExtensions.GetOrAddComponent<RectTransform>(val);
			orAddComponent.anchorMin = (Vector2)(((??)anchorMin) ?? new Vector2(0f, 1f));
			orAddComponent.anchorMax = (Vector2)(((??)anchorMax) ?? new Vector2(0f, 1f));
			orAddComponent.pivot = (Vector2)(((??)pivot) ?? new Vector2(0f, 1f));
			orAddComponent.anchoredPosition = position;
			orAddComponent.sizeDelta = sizeDelta;
			TMP_Text val2 = (TMP_Text)(object)val.AddComponent<TextMeshProUGUI>();
			val2.text = defaultText;
			val2.font = font;
			val2.fontSize = size;
			val2.alignment = alignment;
			((Graphic)val2).raycastTarget = false;
			((Graphic)val2).color = (Color)(((??)color) ?? Color.white);
			return val2;
		}

		public static Button Button(GameObject container, Vector2 position, Vector2 sizeDelta, string defaultText = "Ella jura", float size = 20f, TextAlignmentOptions alignment = 257, Vector2? anchorMin = null, Vector2? anchorMax = null, Vector2? pivot = null)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0047: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0096: 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_00b3: 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_00c3: 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_00fc: 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)
			GameObject val = new GameObject("Button");
			val.transform.SetParent(container.transform, false);
			RectTransform orAddComponent = GameObjectExtensions.GetOrAddComponent<RectTransform>(val);
			orAddComponent.anchorMin = (Vector2)(((??)anchorMin) ?? new Vector2(0f, 1f));
			orAddComponent.anchorMax = (Vector2)(((??)anchorMax) ?? new Vector2(0f, 1f));
			orAddComponent.pivot = (Vector2)(((??)pivot) ?? new Vector2(0f, 1f));
			orAddComponent.anchoredPosition = position;
			orAddComponent.sizeDelta = sizeDelta;
			Button val2 = val.AddComponent<Button>();
			Image targetGraphic = Image(val, position, sizeDelta);
			((Selectable)val2).targetGraphic = (Graphic)(object)targetGraphic;
			Text(val, position, sizeDelta, defaultText, size, alignment, Color.black);
			return val2;
		}

		public static Image Image(GameObject container, Vector2 position, Vector2 sizeDelta, Color? color = null, Vector2? anchorMin = null, Vector2? anchorMax = null, Vector2? pivot = null)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0046: 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_0071: 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_009c: 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_00a8: 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_00e3: 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)
			GameObject val = new GameObject("Image");
			val.transform.SetParent(container.transform, false);
			RectTransform orAddComponent = GameObjectExtensions.GetOrAddComponent<RectTransform>(val);
			orAddComponent.anchorMin = (Vector2)(((??)anchorMin) ?? new Vector2(0f, 1f));
			orAddComponent.anchorMax = (Vector2)(((??)anchorMax) ?? new Vector2(0f, 1f));
			orAddComponent.pivot = (Vector2)(((??)pivot) ?? new Vector2(0f, 1f));
			orAddComponent.anchoredPosition = position;
			orAddComponent.sizeDelta = sizeDelta;
			Image val2 = val.AddComponent<Image>();
			((Graphic)val2).color = (Color)(((??)color) ?? new Color(1f, 1f, 1f));
			return val2;
		}
	}
}
namespace ElevatorUpgrades.Helpers
{
	public static class AssHelper
	{
		[SpecialName]
		public sealed class <G>$34505F560D9EACF86A87F3ED1F85E448
		{
			[SpecialName]
			public static class <M>$69FE22D2D9367C6033D7C9FA04F1ABE9
			{
			}

			[ExtensionMarker("<M>$69FE22D2D9367C6033D7C9FA04F1ABE9")]
			public int Occurrences(char lookUp)
			{
				throw new NotSupportedException();
			}

			[ExtensionMarker("<M>$69FE22D2D9367C6033D7C9FA04F1ABE9")]
			public IEnumerable<int> Occurences(char lookUp)
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <Occurences>d__9 : IEnumerable<int>, IEnumerable, IEnumerator<int>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private int <>2__current;

			private int <>l__initialThreadId;

			private string str;

			public string <>3__str;

			private char lookUp;

			public char <>3__lookUp;

			private int <i>5__1;

			int IEnumerator<int>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <Occurences>d__9(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					goto IL_0062;
				}
				<>1__state = -1;
				<i>5__1 = 0;
				goto IL_0072;
				IL_0062:
				<i>5__1++;
				goto IL_0072;
				IL_0072:
				if (<i>5__1 < str.Length)
				{
					if (str[<i>5__1] == lookUp)
					{
						<>2__current = <i>5__1;
						<>1__state = 1;
						return true;
					}
					goto IL_0062;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}

			[DebuggerHidden]
			IEnumerator<int> IEnumerable<int>.GetEnumerator()
			{
				<Occurences>d__9 <Occurences>d__;
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					<Occurences>d__ = this;
				}
				else
				{
					<Occurences>d__ = new <Occurences>d__9(0);
				}
				<Occurences>d__.str = <>3__str;
				<Occurences>d__.lookUp = <>3__lookUp;
				return <Occurences>d__;
			}

			[DebuggerHidden]
			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable<int>)this).GetEnumerator();
			}
		}

		private static List<string> cache_PrefabKeys = null;

		public static Dictionary<string, object> CachedAddressableAssets = new Dictionary<string, object>();

		public static IResourceLocator MainAddressablesLocator => Addressables.ResourceLocators.FirstOrDefault((Func<IResourceLocator, bool>)((IResourceLocator loc) => loc.LocatorId == "AddressablesMainContentCatalog"));

		public static IEnumerable<object> GetAddressableKeys()
		{
			IResourceLocator mainAddressablesLocator = MainAddressablesLocator;
			return ((mainAddressablesLocator != null) ? mainAddressablesLocator.Keys : null) ?? Array.Empty<object>();
		}

		public static List<string> GetPrefabAddressableKeys(Func<string, bool> Search = null)
		{
			if (cache_PrefabKeys != null)
			{
				return cache_PrefabKeys.Where(Search).ToList();
			}
			List<string> list = new List<string>();
			IList<IResourceLocation> list2 = default(IList<IResourceLocation>);
			foreach (object addressableKey in GetAddressableKeys())
			{
				if (MainAddressablesLocator.Locate(addressableKey, typeof(GameObject), ref list2) && !list.Contains(list2[0].PrimaryKey))
				{
					list.Add(list2[0].PrimaryKey);
				}
			}
			list.Sort();
			cache_PrefabKeys = list;
			return list.Where(Search).ToList();
		}

		public static T Ass<T>(string key)
		{
			//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)
			if (CachedAddressableAssets.TryGetValue(key + typeof(T).Name, out var value))
			{
				return (T)value;
			}
			T val = Addressables.LoadAssetAsync<T>((object)key).WaitForCompletion();
			if (val != null)
			{
				CachedAddressableAssets.Add(key + typeof(T).Name, val);
			}
			else
			{
				Plugin.LogError("Failed to load asset: " + key);
			}
			return val;
		}

		public static int Occurrences(this string str, char lookUp)
		{
			int num = 0;
			foreach (char c in str)
			{
				if (c == lookUp)
				{
					num++;
				}
			}
			return num;
		}

		[IteratorStateMachine(typeof(<Occurences>d__9))]
		public static IEnumerable<int> Occurences(this string str, char lookUp)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Occurences>d__9(-2)
			{
				<>3__str = str,
				<>3__lookUp = lookUp
			};
		}
	}
	public static class BundleLoader
	{
		public static AssetBundle bundle { get; private set; }

		public static void LoadBundle(string path)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			string text = "ElevatorUpgrades." + path;
			using Stream stream = executingAssembly.GetManifestResourceStream(text);
			if (stream == null)
			{
				Plugin.LogError("Bundle not found: " + text);
				return;
			}
			using MemoryStream memoryStream = new MemoryStream();
			stream.CopyTo(memoryStream);
			UnloadBundle();
			bundle = AssetBundle.LoadFromMemory(memoryStream.ToArray());
		}

		public static void UnloadBundle()
		{
			AssetBundle obj = bundle;
			if (obj != null)
			{
				obj.Unload(false);
			}
		}
	}
	public static class Extensions
	{
		[SpecialName]
		public sealed class <G>$D50C47355EFA71DA0F6DB3230FE5D4AD
		{
			[SpecialName]
			public static class <M>$D68147830E85447C80ED888358DB7BFB
			{
			}

			[ExtensionMarker("<M>$D68147830E85447C80ED888358DB7BFB")]
			public void ApplyDefaults()
			{
				throw new NotSupportedException();
			}
		}

		[SpecialName]
		public sealed class <G>$5E80EE1F91F68F4C0C8D9D82C38C5E67
		{
			[SpecialName]
			public static class <M>$24BC8566157842FEB6EA2D06D7BBA5FC
			{
			}

			[ExtensionMarker("<M>$24BC8566157842FEB6EA2D06D7BBA5FC")]
			public RectTransform rectTransform
			{
				[ExtensionMarker("<M>$24BC8566157842FEB6EA2D06D7BBA5FC")]
				get
				{
					throw new NotSupportedException();
				}
			}
		}

		public static void ApplyDefaults(this RectTransform rect)
		{
			//IL_000c: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			rect.anchorMin = new Vector2(0f, 1f);
			rect.anchorMax = new Vector2(0f, 1f);
			rect.pivot = new Vector2(0f, 1f);
		}

		public static RectTransform get_rectTransform(GameObject obj)
		{
			return obj.GetComponent<RectTransform>();
		}
	}
	public static class UniversalFloatParse
	{
		public static void Fix()
		{
			Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
		}
	}
	public static class WebRequests
	{
		[CompilerGenerated]
		private sealed class <GetStringFromUrl>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public string url;

			public Action<string> callback;

			private UnityWebRequest <www>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <GetStringFromUrl>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 1)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<www>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Invalid comparison between Unknown and I4
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<www>5__1 = UnityWebRequest.Get(url);
						<>1__state = -3;
						<www>5__1.timeout = 15;
						<>2__current = <www>5__1.SendWebRequest();
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -3;
						if ((int)<www>5__1.result != 1)
						{
							Plugin.LogError("Failed to load string: " + <www>5__1.error);
							callback?.Invoke(null);
						}
						else
						{
							callback?.Invoke(<www>5__1.downloadHandler.text);
						}
						<>m__Finally1();
						<www>5__1 = null;
						return false;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			private void <>m__Finally1()
			{
				<>1__state = -1;
				if (<www>5__1 != null)
				{
					((IDisposable)<www>5__1).Dispose();
				}
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <PostRequest>d__2 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public string url;

			public Dictionary<string, string> postData;

			public Action<string> callback;

			private WWWForm <form>5__1;

			private Dictionary<string, string>.Enumerator <>s__2;

			private KeyValuePair<string, string> <pair>5__3;

			private UnityWebRequest <www>5__4;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <PostRequest>d__2(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 1)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<form>5__1 = null;
				<>s__2 = default(Dictionary<string, string>.Enumerator);
				<pair>5__3 = default(KeyValuePair<string, string>);
				<www>5__4 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Expected O, but got Unknown
				//IL_0111: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Invalid comparison between Unknown and I4
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<form>5__1 = new WWWForm();
						<>s__2 = postData.GetEnumerator();
						try
						{
							while (<>s__2.MoveNext())
							{
								<pair>5__3 = <>s__2.Current;
								<form>5__1.AddField(<pair>5__3.Key, <pair>5__3.Value);
								<pair>5__3 = default(KeyValuePair<string, string>);
							}
						}
						finally
						{
							((IDisposable)<>s__2).Dispose();
						}
						<>s__2 = default(Dictionary<string, string>.Enumerator);
						<www>5__4 = UnityWebRequest.Post(url, <form>5__1);
						<>1__state = -3;
						<www>5__4.timeout = 15;
						<>2__current = <www>5__4.SendWebRequest();
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -3;
						if ((int)<www>5__4.result != 1)
						{
							Plugin.LogError("Failed to post request: " + <www>5__4.error);
							callback?.Invoke(null);
						}
						else
						{
							callback?.Invoke(<www>5__4.downloadHandler.text);
						}
						<>m__Finally1();
						<www>5__4 = null;
						return false;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			private void <>m__Finally1()
			{
				<>1__state = -1;
				if (<www>5__4 != null)
				{
					((IDisposable)<www>5__4).Dispose();
				}
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private const int timeout = 15;

		[IteratorStateMachine(typeof(<GetStringFromUrl>d__1))]
		public static IEnumerator GetStringFromUrl(string url, Action<string> callback)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <GetStringFromUrl>d__1(0)
			{
				url = url,
				callback = callback
			};
		}

		[IteratorStateMachine(typeof(<PostRequest>d__2))]
		public static IEnumerator PostRequest(string url, Dictionary<string, string> postData, Action<string> callback)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PostRequest>d__2(0)
			{
				url = url,
				postData = postData,
				callback = callback
			};
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}