Decompiled source of Tavern Rush v3.1.0

plugins/Tavern_Rush.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LibCopyUI;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Localization;
using UnityEngine.Localization.Components;
using UnityEngine.Localization.Settings;
using UnityEngine.Localization.Tables;
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: AssemblyCompany("Tavern_Rush")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyInformationalVersion("3.1.0+d02a89ad4282c7cf1bc6f8f48afd9418653bd886")]
[assembly: AssemblyProduct("Tavern_Rush")]
[assembly: AssemblyTitle("Tavern_Rush")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.1.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;
		}
	}
}
namespace Tavern_Rush
{
	[BepInPlugin("Tavern_Rush", "Tavern_Rush", "3.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Logger1;

		internal static ConfigEntry<string> prices;

		internal static ConfigEntry<string> disableObjects;

		internal static ConfigEntry<ulong> moneyDrop;

		internal static ConfigEntry<KeyboardShortcut> mainScreenBind;

		private void SyncConfig()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			mainScreenBind = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keybinds", "Mod Screen key", new KeyboardShortcut((KeyCode)114, (KeyCode[])(object)new KeyCode[1] { (KeyCode)304 }), "Keyboard Shortcut for Mod Screen");
		}

		private void Start()
		{
			Harmony.CreateAndPatchAll(typeof(Plugin), (string)null);
			Logger1 = ((BaseUnityPlugin)this).Logger;
			SyncConfig();
			Logger1.LogInfo((object)"Plugin Tavern_Rush : Version 3.1.0 is loaded!");
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(MainMenu), "Awake")]
		private static void RemoveBarrel()
		{
			GameObject.Find("Props_BarrelStack_03").SetActive(false);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Game), "Update")]
		private static void Update()
		{
			//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)
			KeyboardShortcut value = mainScreenBind.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				GameObject gameObject = ((Component)GameObject.Find("Common").transform.Find("GameCanvas")).gameObject;
				Transform obj = gameObject.transform.Find("Tavern Rush Screen");
				GameObject val = ((obj != null) ? ((Component)obj).gameObject : null);
				if (!Object.op_Implicit((Object)(object)val))
				{
					PluginUI.createWithLibCopyUI().SetActive(false);
					val = ((Component)gameObject.transform.Find("Tavern Rush Screen")).gameObject;
				}
				if (!val.activeSelf)
				{
					GameMenu.Instance.ShowMenuHome();
				}
				else
				{
					GameMenu.Instance.ShowGame();
				}
				val.SetActive(!val.activeSelf);
			}
			if (Input.GetKeyDown((KeyCode)27))
			{
				GameObject gameObject2 = ((Component)GameObject.Find("Common").transform.Find("GameCanvas")).gameObject;
				GameObject gameObject3 = ((Component)gameObject2.transform.Find("Tavern Rush Screen")).gameObject;
				gameObject3.SetActive(false);
			}
		}
	}
	public class PluginAPI : NetworkBehaviour
	{
		[ClientRpc]
		public static void ADD()
		{
		}
	}
	public class PluginUI
	{
		public static UIObject panel0;

		public static UIObject container0;

		public static UIObject container1;

		public static UIObject button0;

		public static UIObject label0;

		public static GameObject createWithLibCopyUI()
		{
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			LibCopy.setup(GameObject.Find("Common/GameCanvas").transform, Templates.AleAndTale);
			panel0 = LibCopy.makePanel("Tavern Rush Screen");
			panel0.setSize(1200f, 1000f);
			container0 = LibCopy.makeContainer(null, panel0.gameObject);
			container0.setSize(500f, 800f);
			container0.offsetPosition(-275f, 0f, 0f);
			container1 = LibCopy.makeContainer(null, panel0.gameObject);
			container1.setSize(500f, 800f);
			container1.offsetPosition(275f, 0f, 0f);
			label0 = LibCopy.makeLabel("Tavern Rush Mod", panel0.gameObject);
			label0.setSize(400f, 50f);
			label0.centerToParentY();
			label0.offsetPosition(0f, -15f, 0f);
			button0 = LibCopy.makeButton("Close", delegate
			{
				panel0.gameObject.SetActive(false);
				GameMenu.Instance.ShowGame();
			}, panel0.gameObject);
			button0.setSize(170f, 60f);
			button0.centerToParentX();
			UIObject uIObject = button0;
			float num = (0f - button0.parentHeight) / 2f;
			Rect rect = button0.rectTransform.rect;
			uIObject.offsetPosition(100f, num + ((Rect)(ref rect)).height - 20f, 0f);
			foreach (KeyValuePair<string, Dictionary<string, Action>> cat in RushMenu.modOptions)
			{
				UIObject uIObject2 = LibCopy.makeButton(cat.Key, delegate
				{
					((Component)container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
					foreach (KeyValuePair<string, Action> option in cat.Value)
					{
						UIObject uIObject3 = LibCopy.makeButton(option.Key, delegate
						{
							option.Value();
						}, ((Component)container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
					}
				}, ((Component)container0.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			}
			return panel0.gameObject;
		}
	}
	public class RushMenu
	{
		public static Dictionary<string, Dictionary<string, Action>> modOptions = new Dictionary<string, Dictionary<string, Action>>
		{
			{
				"General",
				new Dictionary<string, Action>
				{
					{
						"Money Add",
						delegate
						{
							AddMoney();
						}
					},
					{
						"Money Remove",
						delegate
						{
							RemoveMoney();
						}
					},
					{
						"XP",
						delegate
						{
							XP();
						}
					},
					{
						"Level",
						delegate
						{
							LEVEL();
						}
					}
				}
			},
			{
				"Tavern",
				new Dictionary<string, Action>
				{
					{
						"Make Clean",
						delegate
						{
							Object.FindFirstObjectByType<GameStatus>().cleanliness.Value = 100;
						}
					},
					{
						"Make Reputed",
						delegate
						{
							Object.FindFirstObjectByType<GameStatus>().reputation.Value = 100;
						}
					}
				}
			},
			{
				"Items",
				new Dictionary<string, Action>
				{
					{ "Spawn", SpawnItems },
					{ "Change Price", ChangePriceItems }
				}
			},
			{
				"Quests",
				new Dictionary<string, Action>
				{
					{
						"Complete Current Quest",
						delegate
						{
							Object.FindFirstObjectByType<QuestManager>().CompleteCurrentQuest();
						}
					},
					{ "Start", StartQuests }
				}
			},
			{
				"World",
				new Dictionary<string, Action>
				{
					{
						"Hide Posters",
						delegate
						{
							DisableObjectsHavingName(new string[1] { "Poster" });
						}
					},
					{
						"Hide Scarecrow",
						delegate
						{
							DisableObjectsHavingName(new string[1] { "Scarecrow" });
						}
					}
				}
			}
		};

		public static void DisableObjectsHavingName(string[] target)
		{
			GameObject[] array = Object.FindObjectsOfType<GameObject>();
			foreach (GameObject val in array)
			{
				foreach (string value in target)
				{
					if (((Object)val).name.Contains(value))
					{
						val.SetActive(false);
					}
				}
			}
		}

		private static void SpawnItems()
		{
			//IL_004a: 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)
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			ItemData[] array = Resources.FindObjectsOfTypeAll<ItemData>();
			ItemData[] array2 = array;
			foreach (ItemData item in array2)
			{
				string text = LocalizationSettings.StringDatabase.GetLocalizedString(TableReference.op_Implicit("ItemData"), TableEntryReference.op_Implicit(item.name), (Locale)null, (FallbackBehavior)0, Array.Empty<object>());
				if (Utility.IsNullOrWhiteSpace(text))
				{
					text = item.name.Replace("ItemDataName", "").Replace("_Title", "");
				}
				UIObject uIObject = LibCopy.makeButton(text, delegate
				{
					Object.FindFirstObjectByType<GameCommands>().SpawnItem(item.id);
				}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			}
		}

		private static void StartQuests()
		{
			//IL_004a: 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)
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			QuestData[] array = Resources.FindObjectsOfTypeAll<QuestData>();
			QuestData[] array2 = array;
			foreach (QuestData item in array2)
			{
				string text = LocalizationSettings.StringDatabase.GetLocalizedString(TableReference.op_Implicit("QuestData"), TableEntryReference.op_Implicit(((Object)item).name), (Locale)null, (FallbackBehavior)0, Array.Empty<object>());
				if (Utility.IsNullOrWhiteSpace(text))
				{
					text = ((Object)item).name.Replace("QuestDataName", "").Replace("_Title", "");
				}
				UIObject uIObject = LibCopy.makeButton(text, delegate
				{
					Object.FindFirstObjectByType<QuestManager>().StartQuest(item.id, true);
				}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			}
		}

		private static void AddMoney()
		{
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			LibCopy.makeInput(Object.FindFirstObjectByType<GameStatus>().money.Value.ToString(), delegate(string s)
			{
				ushort result = 0;
				ushort.TryParse(s, out result);
				Object.FindFirstObjectByType<GameStatus>().AddMoneyServerRpc((ulong)result);
			}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			LibCopy.makeLabel("Enter Amount:", ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
		}

		private static void RemoveMoney()
		{
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			LibCopy.makeInput(Object.FindFirstObjectByType<GameStatus>().money.Value.ToString(), delegate(string s)
			{
				ushort result = 0;
				ushort.TryParse(s, out result);
				Object.FindFirstObjectByType<GameStatus>().RemoveMoneyServerRpc((ulong)result);
			}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			LibCopy.makeLabel("Enter Amount:", ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
		}

		private static void XP()
		{
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			LibCopy.makeInput(Object.FindFirstObjectByType<GameStatus>().exp.Value.ToString(), delegate(string s)
			{
				ushort result = 0;
				ushort.TryParse(s, out result);
				Object.FindFirstObjectByType<GameStatus>().exp.Value = result;
			}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			LibCopy.makeLabel("Set XP Amount:", ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
		}

		private static void LEVEL()
		{
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			LibCopy.makeInput(Object.FindFirstObjectByType<GameStatus>().level.Value.ToString(), delegate(string s)
			{
				ushort result = 0;
				ushort.TryParse(s, out result);
				Object.FindFirstObjectByType<GameStatus>().level.Value = byte.Parse(s);
			}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			LibCopy.makeLabel("Set Level:", ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
		}

		private static void Input()
		{
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			LibCopy.makeInput(Object.FindFirstObjectByType<GameStatus>().level.Value.ToString(), delegate(string s)
			{
				ushort result = 0;
				ushort.TryParse(s, out result);
				Object.FindFirstObjectByType<GameStatus>().level.Value = byte.Parse(s);
			}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			LibCopy.makeLabel("Set Level:", ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
		}

		private static void ChangePriceItems()
		{
			//IL_004a: 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)
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			ItemData[] array = Resources.FindObjectsOfTypeAll<ItemData>();
			ItemData[] array2 = array;
			foreach (ItemData item in array2)
			{
				string text = LocalizationSettings.StringDatabase.GetLocalizedString(TableReference.op_Implicit("ItemData"), TableEntryReference.op_Implicit(item.name), (Locale)null, (FallbackBehavior)0, Array.Empty<object>());
				if (Utility.IsNullOrWhiteSpace(text))
				{
					text = item.name.Replace("ItemDataName", "").Replace("_Title", "");
				}
				UIObject uIObject = LibCopy.makeButton(text, delegate
				{
					((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
					LibCopy.makeInput(item.price.ToString(), delegate(string s)
					{
						ushort result = 0;
						ushort.TryParse(s, out result);
						item.price = result;
					}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
					LibCopy.makeLabel("Enter Price:", ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
				}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			}
		}

		private static void UnlockItems()
		{
			//IL_003f: 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)
			((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject.transform.DestroyChildren();
			ItemData[] array = Resources.FindObjectsOfTypeAll<ItemData>();
			ItemData[] array2 = array;
			foreach (ItemData val in array2)
			{
				string text = LocalizationSettings.StringDatabase.GetLocalizedString(TableReference.op_Implicit("ItemData"), TableEntryReference.op_Implicit(val.name), (Locale)null, (FallbackBehavior)0, Array.Empty<object>());
				if (Utility.IsNullOrWhiteSpace(text))
				{
					text = val.name.Replace("ItemDataName", "").Replace("_Title", "");
				}
				UIObject uIObject = LibCopy.makeButton(text, delegate
				{
				}, ((Component)PluginUI.container1.gameObject.GetComponentInChildren<VerticalLayoutGroup>()).gameObject);
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Tavern_Rush";

		public const string PLUGIN_NAME = "Tavern_Rush";

		public const string PLUGIN_VERSION = "3.1.0";
	}
}
namespace LibCopyUI
{
	public static class LibCopy
	{
		public static Transform canvas;

		private static bool ready;

		private static Dictionary<string, string> templates;

		public static void setup(Transform UI, Dictionary<string, string> temps)
		{
			if (!Object.op_Implicit((Object)(object)UI) || temps == null)
			{
				throw new Exception("Arguments cannot be null, run setup again");
			}
			canvas = UI;
			templates = temps;
			ready = true;
		}

		public static UIObject copyElement(string template, GameObject cnvs = null, bool active = true, string name = null)
		{
			if (!ready)
			{
				throw new Exception("Run setup once before using lib");
			}
			if (!Object.op_Implicit((Object)(object)cnvs))
			{
				cnvs = ((Component)canvas).gameObject;
			}
			GameObject val = GameObject.Find(templates[template]);
			if (!Object.op_Implicit((Object)(object)val))
			{
				throw new Exception(template + " template reference cannot be found");
			}
			if (name == null)
			{
				name = template;
			}
			return new UIObject(val, cnvs, name, active);
		}

		public static UIObject makeContainer(string name = null, GameObject cnvs = null, bool active = true)
		{
			return copyElement("container", cnvs, active, name);
		}

		public static UIObject makePanel(string name = null, GameObject cnvs = null, bool active = true)
		{
			UIObject uIObject = copyElement("panel", cnvs, active, name);
			uIObject.gameObject.transform.DestroyChildren();
			return uIObject;
		}

		public static UIObject makeLabel(string name = null, GameObject cnvs = null, bool active = true)
		{
			UIObject uIObject = copyElement("label", cnvs, active, name);
			uIObject.gameObject.transform.DestroyChildren();
			((TMP_Text)uIObject.gameObject.GetComponentInChildren<TextMeshProUGUI>()).SetText(name, true);
			return uIObject;
		}

		public static UIObject makeInput(string name = null, Action<string> listener = null, GameObject cnvs = null, bool active = true)
		{
			UIObject uIObject = copyElement("input", cnvs, active, name);
			uIObject.gameObject.GetComponentInChildren<TextInput>().SetText(name);
			uIObject.gameObject.GetComponentInChildren<TextInput>().onEdit = listener;
			uIObject.gameObject.GetComponentInChildren<TextInput>().SetEdit(true);
			return uIObject;
		}

		public static UIObject makeButton(string name = null, Action<GameObject> listener = null, GameObject cnvs = null, bool active = true)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			UIObject ret = copyElement("button", cnvs, active, name);
			((UnityEventBase)ret.gameObject.GetComponent<Button>().onClick).RemoveAllListeners();
			if (listener != null)
			{
				((UnityEvent)ret.gameObject.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
				{
					listener(ret.gameObject);
				});
			}
			Object.Destroy((Object)(object)ret.gameObject.GetComponentInChildren<LocalizeStringEvent>());
			if (name == null)
			{
				name = "button";
			}
			((TMP_Text)ret.gameObject.GetComponentInChildren<TextMeshProUGUI>()).SetText(name, true);
			return ret;
		}
	}
	public class Templates
	{
		public static Dictionary<string, string> AleAndTale = new Dictionary<string, string>
		{
			{ "button", "Common/GameCanvas/Quest Board Screen/Panel/TaskListPanel/ButtonFollow" },
			{ "container", "Common/GameCanvas/Craft Screen/Craft/RecipeListPanel/Scroll View" },
			{ "label", "Common/GameCanvas/Quest Board Screen/Panel/TaskListPanel/Panel/Text (TMP)" },
			{ "panel", "Common/GameCanvas/Quest Board Screen/Panel" },
			{ "input", "Common/GameCanvas/Storage Screen/extContainer/EditableText" }
		};
	}
	public class UIObject
	{
		public GameObject gameObject;

		public RectTransform rectTransform;

		public Vector3 position;

		public float parentWidth;

		public float parentHeight;

		public UIObject(GameObject template, GameObject Canvas = null, string name = null, bool active = true)
		{
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)Canvas))
			{
				gameObject = Object.Instantiate<GameObject>(template, Canvas.transform);
			}
			else
			{
				gameObject = Object.Instantiate<GameObject>(template, template.transform.parent);
			}
			if (name != null)
			{
				((Object)gameObject).name = name;
			}
			rectTransform = gameObject.GetComponentInChildren<RectTransform>();
			position = new Vector3(0f, 0f, 0f);
			((Transform)rectTransform).localPosition = position;
			Rect rect = ((Component)gameObject.transform.parent).GetComponent<RectTransform>().rect;
			parentWidth = ((Rect)(ref rect)).width;
			rect = ((Component)gameObject.transform.parent).GetComponent<RectTransform>().rect;
			parentHeight = ((Rect)(ref rect)).height;
			gameObject.SetActive(active);
		}

		public void setSize(float preferredWidth, float preferredHeight)
		{
			rectTransform.SetSizeWithCurrentAnchors((Axis)0, preferredWidth);
			rectTransform.SetSizeWithCurrentAnchors((Axis)1, preferredHeight);
		}

		public void offsetPosition(float x, float y, float z)
		{
			//IL_000d: 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_0031: 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_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)
			((Transform)rectTransform).localPosition = new Vector3(((Transform)rectTransform).localPosition.x + x, ((Transform)rectTransform).localPosition.y + y, ((Transform)rectTransform).localPosition.z + z);
			position = ((Transform)rectTransform).localPosition;
		}

		public void centerToParentX()
		{
			//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_0031: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			RectTransform component = ((Component)gameObject.transform.parent).GetComponent<RectTransform>();
			Rect rect = component.rect;
			float num = ((Rect)(ref rect)).width / 2f;
			rect = rectTransform.rect;
			float num2 = num - ((Rect)(ref rect)).width;
			((Transform)rectTransform).localPosition = new Vector3(num2, ((Transform)rectTransform).localPosition.y, ((Transform)rectTransform).localPosition.z);
		}

		public void centerToParentY()
		{
			//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_0031: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			RectTransform component = ((Component)gameObject.transform.parent).GetComponent<RectTransform>();
			Rect rect = component.rect;
			float num = ((Rect)(ref rect)).height / 2f;
			rect = rectTransform.rect;
			float num2 = num - ((Rect)(ref rect)).height;
			((Transform)rectTransform).localPosition = new Vector3(((Transform)rectTransform).localPosition.x, num2, ((Transform)rectTransform).localPosition.z);
		}
	}
	public static class Utils
	{
		public static void DestroyChildren(this Transform parent)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			foreach (Transform item in parent)
			{
				Transform val = item;
				Object.Destroy((Object)(object)((Component)val).gameObject);
			}
		}

		public static void DestroyChildrenExcept(this Transform parent, List<Transform> excludes)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			foreach (Transform item in parent)
			{
				Transform val = item;
				if (!excludes.Contains(val))
				{
					Object.Destroy((Object)(object)((Component)val).gameObject);
				}
			}
		}

		public static void DestroyChildrenExcept(this Transform parent, Transform exclude)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			foreach (Transform item in parent)
			{
				Transform val = item;
				if ((Object)(object)val != (Object)(object)exclude)
				{
					Object.Destroy((Object)(object)((Component)val).gameObject);
				}
			}
		}
	}
}