Decompiled source of TrashBox v1.2.0

TrashBox.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
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 Microsoft.CodeAnalysis;
using Photon.Pun;
using REPOLib.Modules;
using UnityEngine;

[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: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("XiaoHai")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("TrashBox")]
[assembly: AssemblyTitle("TrashBox")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.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.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]
	[Microsoft.CodeAnalysis.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]
	[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 TrashBox
{
	[BepInPlugin("com.REPO.XiaoHai.TrashBox", "TrashBox", "1.2")]
	public class Plugin : BaseUnityPlugin
	{
		public GameObject? TrashPrefab;

		public AudioClip? Trash2Money;

		public ConfigEntry<float>? recoveryRatio;

		internal static Plugin instance { get; private set; }

		internal static ManualLogSource logger => ((BaseUnityPlugin)instance).Logger;

		internal Harmony? Harmony { get; set; }

		private void Awake()
		{
			instance = this;
			((Component)this).gameObject.transform.parent = null;
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			recoveryRatio = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RecoveryRatio", 0.5f, "The ratio of item value recovered when trashing items.");
			LoadAB();
			Patch();
			((BaseUnityPlugin)this).Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
		}

		internal void Patch()
		{
			//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: Expected O, but got Unknown
			//IL_0026: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
				Harmony val2 = val;
				Harmony = val;
			}
			Harmony.PatchAll();
		}

		internal void Unpatch()
		{
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}

		private void Update()
		{
		}

		private void LoadAB()
		{
			string location = Assembly.GetExecutingAssembly().Location;
			string directoryName = Path.GetDirectoryName(location);
			string text = Path.Combine(directoryName, "trashbox");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			TrashPrefab = val.LoadAsset<GameObject>("TrashBox.prefab");
			Trash2Money = val.LoadAsset<AudioClip>("trashBox.wav");
			if ((Object)(object)TrashPrefab != (Object)null)
			{
				logger.LogInfo((object)"TrashBox Prefab 加载成功.");
				TrashPrefab.AddComponent<TrashBox>();
				NetworkPrefabs.RegisterNetworkPrefab(TrashPrefab);
				Utilities.FixAudioMixerGroups(TrashPrefab);
			}
			else
			{
				logger.LogError((object)"电视机预制体加载失败.");
			}
		}
	}
	[HarmonyPatch]
	public static class Patch
	{
		[HarmonyPatch(typeof(LevelGenerator))]
		public class LevelGeneratorPatch
		{
			[HarmonyPatch("GenerateDone")]
			[HarmonyPostfix]
			private static void AfterLevelGenerated(LevelGenerator __instance)
			{
				//IL_0091: 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_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)Plugin.instance.TrashPrefab == (Object)null || !ShouldRunCustomLogic() || !SemiFunc.IsMasterClientOrSingleplayer())
				{
					return;
				}
				Plugin.logger.LogInfo((object)"在关卡生成后放置垃圾桶.");
				GameObject val = GameObject.Find("cctv");
				if ((Object)(object)val != (Object)null)
				{
					if (SemiFunc.IsMultiplayer())
					{
						GameObject val2 = PhotonNetwork.InstantiateRoomObject(((Object)Plugin.instance.TrashPrefab).name, Vector3.zero, Quaternion.identity, (byte)0, (object[])null);
					}
					else
					{
						GameObject val2 = Object.Instantiate<GameObject>(Plugin.instance.TrashPrefab, Vector3.zero, Quaternion.identity);
					}
				}
			}

			private static bool ShouldRunCustomLogic()
			{
				RunManager instance = RunManager.instance;
				return (Object)(object)instance != (Object)null && instance.levels.Contains(instance.levelCurrent) && (Object)(object)instance.levelCurrent != (Object)(object)instance.levelTutorial && (Object)(object)instance.levelCurrent != (Object)(object)instance.levelShop && (Object)(object)instance.levelCurrent != (Object)(object)instance.levelLobbyMenu;
			}
		}
	}
	public class TrashBox : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <CloseCo>d__20 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public TrashBox <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = <>4__this.MoveLocalY(<>4__this.dangBan, 0f, 1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (<>4__this.trashSound != null)
					{
						<>4__this.trashSound.Play(<>4__this.dangBan.transform.position, 1f, 1f, 1f, 1f);
					}
					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();
			}
		}

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

			private object <>2__current;

			public GameObject go;

			public float targetY;

			public float duration;

			public TrashBox <>4__this;

			private Transform <tr>5__1;

			private float <startY>5__2;

			private float <t>5__3;

			private Vector3 <final>5__4;

			private float <k>5__5;

			private Vector3 <lp>5__6;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: 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_0120: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<tr>5__1 = go.transform;
					<startY>5__2 = <tr>5__1.localPosition.y;
					<t>5__3 = 0f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<t>5__3 < duration)
				{
					<t>5__3 += Time.deltaTime;
					<k>5__5 = Mathf.Clamp01(<t>5__3 / duration);
					<lp>5__6 = <tr>5__1.localPosition;
					<lp>5__6.y = Mathf.Lerp(<startY>5__2, targetY, <k>5__5);
					<tr>5__1.localPosition = <lp>5__6;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				<final>5__4 = <tr>5__1.localPosition;
				<final>5__4.y = targetY;
				<tr>5__1.localPosition = <final>5__4;
				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();
			}
		}

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

			private object <>2__current;

			public TrashBox <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = <>4__this.MoveLocalY(<>4__this.dangBan, 0.6f, 2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					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();
			}
		}

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

			private object <>2__current;

			public TrashBox <>4__this;

			private float <totalValue>5__1;

			private List<ItemAttributes> <list>5__2;

			private List<ItemAttributes>.Enumerator <>s__3;

			private ItemAttributes <attr>5__4;

			private StatsManager <sm>5__5;

			private int <current>5__6;

			private float <maxV>5__7;

			private float <minV>5__8;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<list>5__2 = null;
				<>s__3 = default(List<ItemAttributes>.Enumerator);
				<attr>5__4 = null;
				<sm>5__5 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0117: 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_014d: Expected O, but got Unknown
				//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.busy = true;
					if ((Object)(object)<>4__this.pv != (Object)null)
					{
						if (SemiFunc.IsMultiplayer())
						{
							<>4__this.pv.RPC("RPC_Close", (RpcTarget)0, Array.Empty<object>());
						}
						else
						{
							<>4__this.RPC_Close();
						}
					}
					else if ((Object)(object)<>4__this.dangBan != (Object)null)
					{
						<>2__current = <>4__this.MoveLocalY(<>4__this.dangBan, 0f, 1f);
						<>1__state = 1;
						return true;
					}
					goto IL_0137;
				case 1:
					<>1__state = -1;
					if (<>4__this.trashSound != null)
					{
						<>4__this.trashSound.Play(<>4__this.dangBan.transform.position, 1f, 1f, 1f, 1f);
					}
					goto IL_0137;
				case 2:
					<>1__state = -1;
					<totalValue>5__1 = 0f;
					if (SemiFunc.IsMasterClientOrSingleplayer())
					{
						<list>5__2 = new List<ItemAttributes>(<>4__this.insideSet);
						<>s__3 = <list>5__2.GetEnumerator();
						try
						{
							while (<>s__3.MoveNext())
							{
								<attr>5__4 = <>s__3.Current;
								if (!Object.op_Implicit((Object)(object)<attr>5__4))
								{
									continue;
								}
								if (Object.op_Implicit((Object)(object)ShopManager.instance))
								{
									ShopManager.instance.ShoppingListItemRemove(<attr>5__4);
								}
								try
								{
									<attr>5__4.GetValue();
								}
								catch
								{
								}
								try
								{
									<totalValue>5__1 += <attr>5__4.value;
								}
								catch
								{
								}
								try
								{
									<sm>5__5 = StatsManager.instance;
									if ((Object)(object)<sm>5__5 != (Object)null)
									{
										if (!string.IsNullOrEmpty(<attr>5__4.instanceName))
										{
											<sm>5__5.ItemRemove(<attr>5__4.instanceName);
										}
										else if (Object.op_Implicit((Object)(object)<attr>5__4.item))
										{
											<current>5__6 = <sm>5__5.GetItemPurchased(<attr>5__4.item);
											<sm>5__5.SetItemPurchase(<attr>5__4.item, Mathf.Max(0, <current>5__6 - 1));
										}
									}
									<sm>5__5 = null;
								}
								catch
								{
								}
								if (SemiFunc.IsMultiplayer())
								{
									PhotonNetwork.Destroy(((Component)<attr>5__4).gameObject);
								}
								else
								{
									Object.Destroy((Object)(object)((Component)<attr>5__4).gameObject);
								}
								<attr>5__4 = null;
							}
						}
						finally
						{
							((IDisposable)<>s__3).Dispose();
						}
						<>s__3 = default(List<ItemAttributes>.Enumerator);
						<list>5__2 = null;
					}
					if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)<>4__this.moneyPoint != (Object)null && Plugin.instance.recoveryRatio != null)
					{
						<maxV>5__7 = <totalValue>5__1 * Plugin.instance.recoveryRatio.Value * 1005f;
						<minV>5__8 = <totalValue>5__1 * Plugin.instance.recoveryRatio.Value * 995f;
						SpawnMoney(<>4__this.moneyPoint.transform.position, <maxV>5__7, <minV>5__8);
					}
					if ((Object)(object)<>4__this.pv != (Object)null)
					{
						if (SemiFunc.IsMultiplayer())
						{
							<>4__this.pv.RPC("RPC_Open", (RpcTarget)0, Array.Empty<object>());
						}
						else
						{
							<>4__this.RPC_Open();
						}
					}
					else if ((Object)(object)<>4__this.dangBan != (Object)null)
					{
						<>2__current = <>4__this.MoveLocalY(<>4__this.dangBan, 0.6f, 2f);
						<>1__state = 3;
						return true;
					}
					break;
				case 3:
					{
						<>1__state = -1;
						break;
					}
					IL_0137:
					<>2__current = (object)new WaitForSeconds(<>4__this.processDuration);
					<>1__state = 2;
					return true;
				}
				<>4__this.insideSet.Clear();
				<>4__this.busy = false;
				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();
			}
		}

		private GameObject? moneyPoint;

		private GameObject? dangBan;

		private Collider? trashCollider;

		private bool busy;

		private float dangBanDefaultY;

		private readonly List<ItemAttributes> candidates = new List<ItemAttributes>();

		private readonly HashSet<ItemAttributes> insideSet = new HashSet<ItemAttributes>();

		private readonly Dictionary<ItemAttributes, Vector3> originalScales = new Dictionary<ItemAttributes, Vector3>();

		[SerializeField]
		private float collectWindow = 3f;

		[SerializeField]
		private float processDuration = 3f;

		private float collectTimer;

		private Sound? trashSound;

		private PhotonView? pv;

		private void Awake()
		{
			//IL_0122: 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)
			//IL_0154: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("cctv");
			if ((Object)(object)val != (Object)null)
			{
				Plugin.logger.LogInfo((object)"tv不为空!.");
				SetTransform(val, ((Component)this).gameObject);
			}
			else
			{
				Plugin.logger.LogInfo((object)"tv为空!.");
			}
			Transform obj = ((Component)this).transform.Find("MoneyPoint");
			moneyPoint = ((obj != null) ? ((Component)obj).gameObject : null);
			Transform obj2 = ((Component)this).transform.Find("DangBan");
			dangBan = ((obj2 != null) ? ((Component)obj2).gameObject : null);
			Transform obj3 = ((Component)this).transform.Find("Collider/TrashCollider");
			GameObject val2 = ((obj3 != null) ? ((Component)obj3).gameObject : null);
			if ((Object)(object)val2 != (Object)null)
			{
				trashCollider = val2.GetComponentInChildren<Collider>();
			}
			if ((Object)(object)moneyPoint == (Object)null || (Object)(object)dangBan == (Object)null || (Object)(object)trashCollider == (Object)null)
			{
				Plugin.logger.LogError((object)"TrashBox initialization failed: Missing components.");
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			else
			{
				dangBanDefaultY = dangBan.transform.localPosition.y;
			}
			if ((Object)(object)Plugin.instance.Trash2Money != (Object)null)
			{
				trashSound = new Sound();
				trashSound.Type = (AudioType)6;
				trashSound.SpatialBlend = 1f;
				trashSound.Volume = 1f;
				trashSound.Pitch = 1f;
				trashSound.Sounds = (AudioClip[])(object)new AudioClip[1] { Plugin.instance.Trash2Money };
			}
			pv = ((Component)this).GetComponent<PhotonView>();
		}

		public static void SetTransform(GameObject cctv, GameObject tb)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			tb.transform.SetParent(cctv.transform, false);
			tb.transform.localPosition = new Vector3(0.58f, -4.28f, -0.19f);
			tb.transform.localRotation = Quaternion.Euler(90f, 180f, 0f);
			tb.transform.localScale = new Vector3(2f, 2f, 1.5f);
		}

		public static void SpawnMoney(Vector3 position, float maxValue, float minValue)
		{
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			ValuableObject component = AssetManager.instance.surplusValuableSmall.GetComponent<ValuableObject>();
			Value val = ScriptableObject.CreateInstance<Value>();
			val.valueMin = minValue;
			val.valueMax = maxValue;
			component.valuePreset = val;
			Plugin.logger.LogInfo((object)$"最大为:{val.valueMax},最小为{val.valueMin}");
			if (SemiFunc.IsMultiplayer())
			{
				PhotonNetwork.Instantiate("Valuables/" + ((Object)AssetManager.instance.surplusValuableSmall).name, position, Quaternion.identity, (byte)0, (object[])null);
			}
			else
			{
				Object.Instantiate<GameObject>(AssetManager.instance.surplusValuableSmall, position, Quaternion.identity);
			}
		}

		private void Update()
		{
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			if (!SemiFunc.IsMasterClientOrSingleplayer() || busy || (Object)(object)trashCollider == (Object)null)
			{
				return;
			}
			candidates.Clear();
			GatherItemAttrsInside(candidates);
			bool flag = false;
			for (int i = 0; i < candidates.Count; i++)
			{
				if (!insideSet.Contains(candidates[i]))
				{
					flag = true;
					break;
				}
			}
			if (flag)
			{
				collectTimer = collectWindow;
			}
			if (candidates.Count == 0)
			{
				insideSet.Clear();
				collectTimer = 0f;
				if (originalScales.Count <= 0)
				{
					return;
				}
				{
					foreach (KeyValuePair<ItemAttributes, Vector3> item in new List<KeyValuePair<ItemAttributes, Vector3>>(originalScales))
					{
						ItemAttributes key = item.Key;
						if (Object.op_Implicit((Object)(object)key))
						{
							((Component)key).transform.localScale = item.Value;
						}
						originalScales.Remove(key);
					}
					return;
				}
			}
			insideSet.Clear();
			for (int j = 0; j < candidates.Count; j++)
			{
				insideSet.Add(candidates[j]);
			}
			if (originalScales.Count > 0)
			{
				foreach (KeyValuePair<ItemAttributes, Vector3> item2 in new List<KeyValuePair<ItemAttributes, Vector3>>(originalScales))
				{
					ItemAttributes key2 = item2.Key;
					if (Object.op_Implicit((Object)(object)key2) && !insideSet.Contains(key2))
					{
						((Component)key2).transform.localScale = item2.Value;
						originalScales.Remove(key2);
					}
				}
			}
			foreach (ItemAttributes item3 in insideSet)
			{
				if (Object.op_Implicit((Object)(object)item3) && !originalScales.ContainsKey(item3))
				{
					originalScales[item3] = ((Component)item3).transform.localScale;
					((Component)item3).transform.localScale = ((Component)item3).transform.localScale * 0.5f;
				}
			}
			if (collectTimer > 0f)
			{
				collectTimer -= Time.deltaTime;
			}
			else if (insideSet.Count > 0)
			{
				((MonoBehaviour)this).StartCoroutine(ProcessDebounced());
			}
		}

		private void GatherItemAttrsInside(List<ItemAttributes> list)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)trashCollider == (Object)null)
			{
				return;
			}
			Bounds bounds = trashCollider.bounds;
			Collider[] array = Physics.OverlapBox(((Bounds)(ref bounds)).center, ((Bounds)(ref bounds)).extents, ((Component)trashCollider).transform.rotation);
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				ItemAttributes componentInParent = ((Component)val).GetComponentInParent<ItemAttributes>();
				if (Object.op_Implicit((Object)(object)componentInParent) && !list.Contains(componentInParent))
				{
					list.Add(componentInParent);
				}
			}
		}

		[IteratorStateMachine(typeof(<ProcessDebounced>d__18))]
		private IEnumerator ProcessDebounced()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ProcessDebounced>d__18(0)
			{
				<>4__this = this
			};
		}

		[PunRPC]
		private void RPC_Close()
		{
			if (Object.op_Implicit((Object)(object)dangBan))
			{
				((MonoBehaviour)this).StartCoroutine(CloseCo());
			}
		}

		[IteratorStateMachine(typeof(<CloseCo>d__20))]
		private IEnumerator CloseCo()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CloseCo>d__20(0)
			{
				<>4__this = this
			};
		}

		[PunRPC]
		private void RPC_Open()
		{
			if (Object.op_Implicit((Object)(object)dangBan))
			{
				((MonoBehaviour)this).StartCoroutine(OpenCo());
			}
		}

		[IteratorStateMachine(typeof(<OpenCo>d__22))]
		private IEnumerator OpenCo()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OpenCo>d__22(0)
			{
				<>4__this = this
			};
		}

		[IteratorStateMachine(typeof(<MoveLocalY>d__23))]
		private IEnumerator MoveLocalY(GameObject go, float targetY, float duration)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <MoveLocalY>d__23(0)
			{
				<>4__this = this,
				go = go,
				targetY = targetY,
				duration = duration
			};
		}
	}
}