Decompiled source of BestMod v1.5.0

BestMod/bin/Debug/0Harmony.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using HarmonyLib.Internal.Patching;
using HarmonyLib.Internal.RuntimeFixes;
using HarmonyLib.Internal.Util;
using HarmonyLib.Public.Patching;
using HarmonyLib.Tools;
using JetBrains.Annotations;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using MonoMod.Utils;
using MonoMod.Utils.Cil;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("HarmonyTests")]
[assembly: InternalsVisibleTo("MonoMod.Utils.Cil.ILGeneratorProxy")]
[assembly: Guid("69aee16a-b6e7-4642-8081-3928b32455df")]
[assembly: AssemblyCompany("BepInEx")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © BepInEx 2022")]
[assembly: AssemblyDescription("A library for patching, replacing and decorating .NET and Mono methods during runtime powered by MonoMod.")]
[assembly: AssemblyFileVersion("2.9.0.0")]
[assembly: AssemblyInformationalVersion("2.9.0")]
[assembly: AssemblyProduct("HarmonyX")]
[assembly: AssemblyTitle("0Harmony")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.9.0.0")]
[module: UnverifiableCode]
namespace System
{
	internal struct ValueTuple<T1, T2>
	{
		public T1 Item1;

		public T2 Item2;

		public ValueTuple(T1 first, T2 second)
		{
			Item1 = first;
			Item2 = second;
		}
	}
	internal struct ValueTuple<T1, T2, T3>
	{
		public T1 Item1;

		public T2 Item2;

		public T3 Item3;

		public ValueTuple(T1 first, T2 second, T3 third)
		{
			Item1 = first;
			Item2 = second;
			Item3 = third;
		}
	}
}
namespace JetBrains.Annotations
{
	[AttributeUsage(AttributeTargets.All)]
	internal sealed class UsedImplicitlyAttribute : Attribute
	{
		public ImplicitUseKindFlags UseKindFlags { get; }

		public ImplicitUseTargetFlags TargetFlags { get; }

		public UsedImplicitlyAttribute()
			: this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default)
		{
		}

		public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)
			: this(useKindFlags, ImplicitUseTargetFlags.Default)
		{
		}

		public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)
			: this(ImplicitUseKindFlags.Default, targetFlags)
		{
		}

		public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
		{
			UseKindFlags = useKindFlags;
			TargetFlags = targetFlags;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter | AttributeTargets.GenericParameter)]
	internal sealed class MeansImplicitUseAttribute : Attribute
	{
		[UsedImplicitly]
		public ImplicitUseKindFlags UseKindFlags { get; }

		[UsedImplicitly]
		public ImplicitUseTargetFlags TargetFlags { get; }

		public MeansImplicitUseAttribute()
			: this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default)
		{
		}

		public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)
			: this(useKindFlags, ImplicitUseTargetFlags.Default)
		{
		}

		public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)
			: this(ImplicitUseKindFlags.Default, targetFlags)
		{
		}

		public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
		{
			UseKindFlags = useKindFlags;
			TargetFlags = targetFlags;
		}
	}
	[Flags]
	internal enum ImplicitUseKindFlags
	{
		Default = 7,
		Access = 1,
		Assign = 2,
		InstantiatedWithFixedConstructorSignature = 4,
		InstantiatedNoFixedConstructorSignature = 8
	}
	[Flags]
	internal enum ImplicitUseTargetFlags
	{
		Default = 1,
		Itself = 1,
		Members = 2,
		WithInheritors = 4,
		WithMembers = 3
	}
}
namespace HarmonyLib
{
	public class DelegateTypeFactory
	{
		private class DelegateEntry
		{
			public CallingConvention? callingConvention;

			public Type delegateType;
		}

		private static int counter;

		private static readonly Dictionary<MethodInfo, List<DelegateEntry>> TypeCache = new Dictionary<MethodInfo, List<DelegateEntry>>();

		private static readonly MethodBase CallingConvAttr = AccessTools.Constructor(typeof(UnmanagedFunctionPointerAttribute), new Type[1] { typeof(CallingConvention) });

		public static readonly DelegateTypeFactory instance = new DelegateTypeFactory();

		public Type CreateDelegateType(Type returnType, Type[] argTypes)
		{
			return CreateDelegateType(returnType, argTypes, null);
		}

		public Type CreateDelegateType(Type returnType, Type[] argTypes, CallingConvention? convention)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			counter++;
			AssemblyDefinition val = AssemblyDefinition.CreateAssembly(new AssemblyNameDefinition($"HarmonyDTFAssembly{counter}", new Version(1, 0)), $"HarmonyDTFModule{counter}", (ModuleKind)0);
			ModuleDefinition module = val.MainModule;
			TypeDefinition val2 = new TypeDefinition("", $"HarmonyDTFType{counter}", (TypeAttributes)257)
			{
				BaseType = module.ImportReference(typeof(MulticastDelegate))
			};
			module.Types.Add(val2);
			if (convention.HasValue)
			{
				CustomAttribute val3 = new CustomAttribute(module.ImportReference(CallingConvAttr));
				val3.ConstructorArguments.Add(new CustomAttributeArgument(module.ImportReference(typeof(CallingConvention)), (object)convention.Value));
				val2.CustomAttributes.Add(val3);
			}
			MethodDefinition val4 = new MethodDefinition(".ctor", (MethodAttributes)4230, module.ImportReference(typeof(void)))
			{
				ImplAttributes = (MethodImplAttributes)3
			};
			Extensions.AddRange<ParameterDefinition>(((MethodReference)val4).Parameters, (IEnumerable<ParameterDefinition>)(object)new ParameterDefinition[2]
			{
				new ParameterDefinition(module.ImportReference(typeof(object))),
				new ParameterDefinition(module.ImportReference(typeof(IntPtr)))
			});
			val2.Methods.Add(val4);
			MethodDefinition val5 = new MethodDefinition("Invoke", (MethodAttributes)198, module.ImportReference(returnType))
			{
				ImplAttributes = (MethodImplAttributes)3
			};
			Extensions.AddRange<ParameterDefinition>(((MethodReference)val5).Parameters, ((IEnumerable<Type>)argTypes).Select((Func<Type, ParameterDefinition>)((Type t) => new ParameterDefinition(module.ImportReference(t)))));
			val2.Methods.Add(val5);
			return ReflectionHelper.Load(val.MainModule).GetType($"HarmonyDTFType{counter}");
		}

		public Type CreateDelegateType(MethodInfo method)
		{
			return CreateDelegateType(method, null);
		}

		public Type CreateDelegateType(MethodInfo method, CallingConvention? convention)
		{
			DelegateEntry delegateEntry;
			if (TypeCache.TryGetValue(method, out var value) && (delegateEntry = value.FirstOrDefault((DelegateEntry e) => e.callingConvention == convention)) != null)
			{
				return delegateEntry.delegateType;
			}
			if (value == null)
			{
				value = (TypeCache[method] = new List<DelegateEntry>());
			}
			delegateEntry = new DelegateEntry
			{
				delegateType = CreateDelegateType(method.ReturnType, method.GetParameters().Types().ToArray(), convention),
				callingConvention = convention
			};
			value.Add(delegateEntry);
			return delegateEntry.delegateType;
		}
	}
	[Obsolete("Use AccessTools.FieldRefAccess<T, S> for fields and AccessTools.MethodDelegate<Func<T, S>> for property getters")]
	public delegate S GetterHandler<in T, out S>(T source);
	[Obsolete("Use AccessTools.FieldRefAccess<T, S> for fields and AccessTools.MethodDelegate<Action<T, S>> for property setters")]
	public delegate void SetterHandler<in T, in S>(T source, S value);
	public delegate T InstantiationHandler<out T>();
	public static class FastAccess
	{
		public static InstantiationHandler<T> CreateInstantiationHandler<T>()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			ConstructorInfo constructor = typeof(T).GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[0], null);
			if ((object)constructor == null)
			{
				throw new ApplicationException($"The type {typeof(T)} must declare an empty constructor (the constructor may be private, internal, protected, protected internal, or public).");
			}
			DynamicMethodDefinition val = new DynamicMethodDefinition("InstantiateObject_" + typeof(T).Name, typeof(T), (Type[])null);
			ILGenerator iLGenerator = val.GetILGenerator();
			iLGenerator.Emit(OpCodes.Newobj, constructor);
			iLGenerator.Emit(OpCodes.Ret);
			return (InstantiationHandler<T>)Extensions.CreateDelegate((MethodBase)val.Generate(), typeof(InstantiationHandler<T>));
		}

		[Obsolete("Use AccessTools.MethodDelegate<Func<T, S>>(PropertyInfo.GetGetMethod(true))")]
		public static GetterHandler<T, S> CreateGetterHandler<T, S>(PropertyInfo propertyInfo)
		{
			MethodInfo getMethod = propertyInfo.GetGetMethod(nonPublic: true);
			DynamicMethodDefinition obj = CreateGetDynamicMethod<T, S>(propertyInfo.DeclaringType);
			ILGenerator iLGenerator = obj.GetILGenerator();
			iLGenerator.Emit(OpCodes.Ldarg_0);
			iLGenerator.Emit(OpCodes.Call, getMethod);
			iLGenerator.Emit(OpCodes.Ret);
			return (GetterHandler<T, S>)Extensions.CreateDelegate((MethodBase)obj.Generate(), typeof(GetterHandler<T, S>));
		}

		[Obsolete("Use AccessTools.FieldRefAccess<T, S>(fieldInfo)")]
		public static GetterHandler<T, S> CreateGetterHandler<T, S>(FieldInfo fieldInfo)
		{
			DynamicMethodDefinition obj = CreateGetDynamicMethod<T, S>(fieldInfo.DeclaringType);
			ILGenerator iLGenerator = obj.GetILGenerator();
			iLGenerator.Emit(OpCodes.Ldarg_0);
			iLGenerator.Emit(OpCodes.Ldfld, fieldInfo);
			iLGenerator.Emit(OpCodes.Ret);
			return (GetterHandler<T, S>)Extensions.CreateDelegate((MethodBase)obj.Generate(), typeof(GetterHandler<T, S>));
		}

		[Obsolete("Use AccessTools.FieldRefAccess<T, S>(name) for fields and AccessTools.MethodDelegate<Func<T, S>>(AccessTools.PropertyGetter(typeof(T), name)) for properties")]
		public static GetterHandler<T, S> CreateFieldGetter<T, S>(params string[] names)
		{
			foreach (string name in names)
			{
				FieldInfo field = typeof(T).GetField(name, AccessTools.all);
				if ((object)field != null)
				{
					return CreateGetterHandler<T, S>(field);
				}
				PropertyInfo property = typeof(T).GetProperty(name, AccessTools.all);
				if ((object)property != null)
				{
					return CreateGetterHandler<T, S>(property);
				}
			}
			return null;
		}

		[Obsolete("Use AccessTools.MethodDelegate<Action<T, S>>(PropertyInfo.GetSetMethod(true))")]
		public static SetterHandler<T, S> CreateSetterHandler<T, S>(PropertyInfo propertyInfo)
		{
			MethodInfo setMethod = propertyInfo.GetSetMethod(nonPublic: true);
			DynamicMethodDefinition obj = CreateSetDynamicMethod<T, S>(propertyInfo.DeclaringType);
			ILGenerator iLGenerator = obj.GetILGenerator();
			iLGenerator.Emit(OpCodes.Ldarg_0);
			iLGenerator.Emit(OpCodes.Ldarg_1);
			iLGenerator.Emit(OpCodes.Call, setMethod);
			iLGenerator.Emit(OpCodes.Ret);
			return (SetterHandler<T, S>)Extensions.CreateDelegate((MethodBase)obj.Generate(), typeof(SetterHandler<T, S>));
		}

		[Obsolete("Use AccessTools.FieldRefAccess<T, S>(fieldInfo)")]
		public static SetterHandler<T, S> CreateSetterHandler<T, S>(FieldInfo fieldInfo)
		{
			DynamicMethodDefinition obj = CreateSetDynamicMethod<T, S>(fieldInfo.DeclaringType);
			ILGenerator iLGenerator = obj.GetILGenerator();
			iLGenerator.Emit(OpCodes.Ldarg_0);
			iLGenerator.Emit(OpCodes.Ldarg_1);
			iLGenerator.Emit(OpCodes.Stfld, fieldInfo);
			iLGenerator.Emit(OpCodes.Ret);
			return (SetterHandler<T, S>)Extensions.CreateDelegate((MethodBase)obj.Generate(), typeof(SetterHandler<T, S>));
		}

		private static DynamicMethodDefinition CreateGetDynamicMethod<T, S>(Type type)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return new DynamicMethodDefinition("DynamicGet_" + type.Name, typeof(S), new Type[1] { typeof(T) });
		}

		private static DynamicMethodDefinition CreateSetDynamicMethod<T, S>(Type type)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			return new DynamicMethodDefinition("DynamicSet_" + type.Name, typeof(void), new Type[2]
			{
				typeof(T),
				typeof(S)
			});
		}
	}
	public delegate object FastInvokeHandler(object target, params object[] parameters);
	public static class MethodInvoker
	{
		public static FastInvokeHandler GetHandler(MethodInfo methodInfo, bool directBoxValueAccess = false)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			DynamicMethodDefinition val = new DynamicMethodDefinition("FastInvoke_" + methodInfo.Name + "_" + (directBoxValueAccess ? "direct" : "indirect"), typeof(object), new Type[2]
			{
				typeof(object),
				typeof(object[])
			});
			ILGenerator iLGenerator = val.GetILGenerator();
			if (!methodInfo.IsStatic)
			{
				Emit(iLGenerator, OpCodes.Ldarg_0);
				EmitUnboxIfNeeded(iLGenerator, methodInfo.DeclaringType);
			}
			bool flag = true;
			ParameterInfo[] parameters = methodInfo.GetParameters();
			for (int i = 0; i < parameters.Length; i++)
			{
				Type type = parameters[i].ParameterType;
				bool isByRef = type.IsByRef;
				if (isByRef)
				{
					type = type.GetElementType();
				}
				bool isValueType = type.IsValueType;
				if (isByRef && isValueType && !directBoxValueAccess)
				{
					Emit(iLGenerator, OpCodes.Ldarg_1);
					EmitFastInt(iLGenerator, i);
				}
				Emit(iLGenerator, OpCodes.Ldarg_1);
				EmitFastInt(iLGenerator, i);
				if (isByRef && !isValueType)
				{
					Emit(iLGenerator, OpCodes.Ldelema, typeof(object));
					continue;
				}
				Emit(iLGenerator, OpCodes.Ldelem_Ref);
				if (!isValueType)
				{
					continue;
				}
				if (!isByRef || !directBoxValueAccess)
				{
					Emit(iLGenerator, OpCodes.Unbox_Any, type);
					if (isByRef)
					{
						Emit(iLGenerator, OpCodes.Box, type);
						Emit(iLGenerator, OpCodes.Dup);
						if (flag)
						{
							flag = false;
							iLGenerator.DeclareLocal(typeof(object), pinned: false);
						}
						Emit(iLGenerator, OpCodes.Stloc_0);
						Emit(iLGenerator, OpCodes.Stelem_Ref);
						Emit(iLGenerator, OpCodes.Ldloc_0);
						Emit(iLGenerator, OpCodes.Unbox, type);
					}
				}
				else
				{
					Emit(iLGenerator, OpCodes.Unbox, type);
				}
			}
			if (methodInfo.IsStatic)
			{
				EmitCall(iLGenerator, OpCodes.Call, methodInfo);
			}
			else
			{
				EmitCall(iLGenerator, OpCodes.Callvirt, methodInfo);
			}
			if ((object)methodInfo.ReturnType == typeof(void))
			{
				Emit(iLGenerator, OpCodes.Ldnull);
			}
			else
			{
				EmitBoxIfNeeded(iLGenerator, methodInfo.ReturnType);
			}
			Emit(iLGenerator, OpCodes.Ret);
			return (FastInvokeHandler)Extensions.CreateDelegate((MethodBase)val.Generate(), typeof(FastInvokeHandler));
		}

		internal static void Emit(ILGenerator il, OpCode opcode)
		{
			il.Emit(opcode);
		}

		internal static void Emit(ILGenerator il, OpCode opcode, Type type)
		{
			il.Emit(opcode, type);
		}

		internal static void EmitCall(ILGenerator il, OpCode opcode, MethodInfo methodInfo)
		{
			il.EmitCall(opcode, methodInfo, null);
		}

		private static void EmitUnboxIfNeeded(ILGenerator il, Type type)
		{
			if (type.IsValueType)
			{
				Emit(il, OpCodes.Unbox_Any, type);
			}
		}

		private static void EmitBoxIfNeeded(ILGenerator il, Type type)
		{
			if (type.IsValueType)
			{
				Emit(il, OpCodes.Box, type);
			}
		}

		internal static void EmitFastInt(ILGenerator il, int value)
		{
			switch (value)
			{
			case -1:
				il.Emit(OpCodes.Ldc_I4_M1);
				return;
			case 0:
				il.Emit(OpCodes.Ldc_I4_0);
				return;
			case 1:
				il.Emit(OpCodes.Ldc_I4_1);
				return;
			case 2:
				il.Emit(OpCodes.Ldc_I4_2);
				return;
			case 3:
				il.Emit(OpCodes.Ldc_I4_3);
				return;
			case 4:
				il.Emit(OpCodes.Ldc_I4_4);
				return;
			case 5:
				il.Emit(OpCodes.Ldc_I4_5);
				return;
			case 6:
				il.Emit(OpCodes.Ldc_I4_6);
				return;
			case 7:
				il.Emit(OpCodes.Ldc_I4_7);
				return;
			case 8:
				il.Emit(OpCodes.Ldc_I4_8);
				return;
			}
			if (value > -129 && value < 128)
			{
				il.Emit(OpCodes.Ldc_I4_S, (sbyte)value);
			}
			else
			{
				il.Emit(OpCodes.Ldc_I4, value);
			}
		}
	}
	internal class AccessCache
	{
		internal enum MemberType
		{
			Any,
			Static,
			Instance
		}

		private const BindingFlags BasicFlags = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.SetField | BindingFlags.GetProperty | BindingFlags.SetProperty;

		private static readonly Dictionary<MemberType, BindingFlags> declaredOnlyBindingFlags = new Dictionary<MemberType, BindingFlags>
		{
			{
				MemberType.Any,
				BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.SetField | BindingFlags.GetProperty | BindingFlags.SetProperty
			},
			{
				MemberType.Instance,
				BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.SetField | BindingFlags.GetProperty | BindingFlags.SetProperty
			},
			{
				MemberType.Static,
				BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.SetField | BindingFlags.GetProperty | BindingFlags.SetProperty
			}
		};

		private readonly Dictionary<Type, Dictionary<string, FieldInfo>> declaredFields = new Dictionary<Type, Dictionary<string, FieldInfo>>();

		private readonly Dictionary<Type, Dictionary<string, PropertyInfo>> declaredProperties = new Dictionary<Type, Dictionary<string, PropertyInfo>>();

		private readonly Dictionary<Type, Dictionary<string, Dictionary<int, MethodBase>>> declaredMethods = new Dictionary<Type, Dictionary<string, Dictionary<int, MethodBase>>>();

		private readonly Dictionary<Type, Dictionary<string, FieldInfo>> inheritedFields = new Dictionary<Type, Dictionary<string, FieldInfo>>();

		private readonly Dictionary<Type, Dictionary<string, PropertyInfo>> inheritedProperties = new Dictionary<Type, Dictionary<string, PropertyInfo>>();

		private readonly Dictionary<Type, Dictionary<string, Dictionary<int, MethodBase>>> inheritedMethods = new Dictionary<Type, Dictionary<string, Dictionary<int, MethodBase>>>();

		private static T Get<T>(Dictionary<Type, Dictionary<string, T>> dict, Type type, string name, Func<T> fetcher)
		{
			lock (dict)
			{
				if (!dict.TryGetValue(type, out var value))
				{
					value = (dict[type] = new Dictionary<string, T>());
				}
				if (!value.TryGetValue(name, out var value2))
				{
					value2 = (value[name] = fetcher());
				}
				return value2;
			}
		}

		private static T Get<T>(Dictionary<Type, Dictionary<string, Dictionary<int, T>>> dict, Type type, string name, Type[] arguments, Func<T> fetcher)
		{
			lock (dict)
			{
				if (!dict.TryGetValue(type, out var value))
				{
					value = (dict[type] = new Dictionary<string, Dictionary<int, T>>());
				}
				if (!value.TryGetValue(name, out var value2))
				{
					value2 = (value[name] = new Dictionary<int, T>());
				}
				int key = AccessTools.CombinedHashCode(arguments);
				if (!value2.TryGetValue(key, out var value3))
				{
					value3 = (value2[key] = fetcher());
				}
				return value3;
			}
		}

		internal FieldInfo GetFieldInfo(Type type, string name, MemberType memberType = MemberType.Any, bool declaredOnly = false)
		{
			FieldInfo fieldInfo = Get(declaredFields, type, name, () => type.GetField(name, declaredOnlyBindingFlags[memberType]));
			if ((object)fieldInfo == null && !declaredOnly)
			{
				fieldInfo = Get(inheritedFields, type, name, () => AccessTools.FindIncludingBaseTypes(type, (Type t) => t.GetField(name, AccessTools.all)));
			}
			return fieldInfo;
		}

		internal PropertyInfo GetPropertyInfo(Type type, string name, MemberType memberType = MemberType.Any, bool declaredOnly = false)
		{
			PropertyInfo propertyInfo = Get(declaredProperties, type, name, () => type.GetProperty(name, declaredOnlyBindingFlags[memberType]));
			if ((object)propertyInfo == null && !declaredOnly)
			{
				propertyInfo = Get(inheritedProperties, type, name, () => AccessTools.FindIncludingBaseTypes(type, (Type t) => t.GetProperty(name, AccessTools.all)));
			}
			return propertyInfo;
		}

		internal MethodBase GetMethodInfo(Type type, string name, Type[] arguments, MemberType memberType = MemberType.Any, bool declaredOnly = false)
		{
			MethodBase methodBase = Get(declaredMethods, type, name, arguments, () => type.GetMethod(name, declaredOnlyBindingFlags[memberType], null, arguments, null));
			if ((object)methodBase == null && !declaredOnly)
			{
				methodBase = Get(inheritedMethods, type, name, arguments, () => AccessTools.Method(type, name, arguments));
			}
			return methodBase;
		}
	}
	internal static class PatchArgumentExtensions
	{
		private static HarmonyArgument[] AllHarmonyArguments(object[] attributes)
		{
			return (from attr in attributes
				select (attr.GetType().Name != "HarmonyArgument") ? null : AccessTools.MakeDeepCopy<HarmonyArgument>(attr) into harg
				where harg != null
				select harg).ToArray();
		}

		private static HarmonyArgument GetArgumentAttribute(this ParameterInfo parameter)
		{
			return AllHarmonyArguments(parameter.GetCustomAttributes(inherit: false)).FirstOrDefault();
		}

		private static HarmonyArgument[] GetArgumentAttributes(this MethodInfo method)
		{
			if ((object)method == null || method is DynamicMethod)
			{
				return null;
			}
			return AllHarmonyArguments(method.GetCustomAttributes(inherit: false));
		}

		private static HarmonyArgument[] GetArgumentAttributes(this Type type)
		{
			return AllHarmonyArguments(type.GetCustomAttributes(inherit: false));
		}

		private static string GetOriginalArgumentName(this ParameterInfo parameter, string[] originalParameterNames)
		{
			HarmonyArgument argumentAttribute = parameter.GetArgumentAttribute();
			if (argumentAttribute == null)
			{
				return null;
			}
			if (!string.IsNullOrEmpty(argumentAttribute.OriginalName))
			{
				return argumentAttribute.OriginalName;
			}
			if (argumentAttribute.Index >= 0 && argumentAttribute.Index < originalParameterNames.Length)
			{
				return originalParameterNames[argumentAttribute.Index];
			}
			return null;
		}

		private static string GetOriginalArgumentName(HarmonyArgument[] attributes, string name, string[] originalParameterNames)
		{
			if (((attributes != null && attributes.Length != 0) ? 1 : 0) <= (false ? 1 : 0))
			{
				return null;
			}
			HarmonyArgument harmonyArgument = attributes.SingleOrDefault((HarmonyArgument p) => p.NewName == name);
			if (harmonyArgument == null)
			{
				return null;
			}
			if (!string.IsNullOrEmpty(harmonyArgument.OriginalName))
			{
				return harmonyArgument.OriginalName;
			}
			if (originalParameterNames != null && harmonyArgument.Index >= 0 && harmonyArgument.Index < originalParameterNames.Length)
			{
				return originalParameterNames[harmonyArgument.Index];
			}
			return null;
		}

		private static string GetOriginalArgumentName(this MethodInfo method, string[] originalParameterNames, string name)
		{
			string originalArgumentName = GetOriginalArgumentName(((object)method != null) ? method.GetArgumentAttributes() : null, name, originalParameterNames);
			if (originalArgumentName != null)
			{
				return originalArgumentName;
			}
			object attributes;
			if ((object)method == null)
			{
				attributes = null;
			}
			else
			{
				Type? declaringType = method.DeclaringType;
				attributes = (((object)declaringType != null) ? declaringType.GetArgumentAttributes() : null);
			}
			originalArgumentName = GetOriginalArgumentName((HarmonyArgument[])attributes, name, originalParameterNames);
			if (originalArgumentName != null)
			{
				return originalArgumentName;
			}
			return name;
		}

		internal static int GetArgumentIndex(this MethodInfo patch, string[] originalParameterNames, ParameterInfo patchParam)
		{
			if (patch is DynamicMethod)
			{
				return Array.IndexOf<string>(originalParameterNames, patchParam.Name);
			}
			string originalArgumentName = patchParam.GetOriginalArgumentName(originalParameterNames);
			if (originalArgumentName != null)
			{
				return Array.IndexOf(originalParameterNames, originalArgumentName);
			}
			originalArgumentName = patch.GetOriginalArgumentName(originalParameterNames, patchParam.Name);
			if (originalArgumentName != null)
			{
				return Array.IndexOf(originalParameterNames, originalArgumentName);
			}
			return -1;
		}
	}
	internal static class PatchFunctions
	{
		internal static List<MethodInfo> GetSortedPatchMethods(MethodBase original, Patch[] patches, bool debug)
		{
			return new PatchSorter(patches, debug).Sort(original);
		}

		internal static Patch[] GetSortedPatchMethodsAsPatches(MethodBase original, Patch[] patches, bool debug)
		{
			return new PatchSorter(patches, debug).SortAsPatches(original);
		}

		internal static MethodInfo UpdateWrapper(MethodBase original, PatchInfo patchInfo)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			MethodPatcher methodPatcher = original.GetMethodPatcher();
			DynamicMethodDefinition val = methodPatcher.PrepareOriginal();
			if (val != null)
			{
				ILContext ctx = new ILContext(val.Definition);
				HarmonyManipulator.Manipulate(original, patchInfo, ctx);
			}
			try
			{
				return methodPatcher.DetourTo((val != null) ? val.Generate() : null) as MethodInfo;
			}
			catch (Exception ex)
			{
				object body;
				if (val == null)
				{
					body = null;
				}
				else
				{
					MethodDefinition definition = val.Definition;
					body = ((definition != null) ? definition.Body : null);
				}
				throw HarmonyException.Create(ex, (MethodBody)body);
			}
		}

		internal static MethodInfo ReversePatch(HarmonyMethod standin, MethodBase original, MethodInfo postTranspiler, MethodInfo postManipulator)
		{
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Expected O, but got Unknown
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			if (standin == null)
			{
				throw new ArgumentNullException("standin");
			}
			if ((object)standin.method == null)
			{
				throw new ArgumentNullException("standin", "standin.method is NULL");
			}
			bool debug = standin.debug.GetValueOrDefault();
			List<MethodInfo> transpilers = new List<MethodInfo>();
			List<MethodInfo> ilmanipulators = new List<MethodInfo>();
			if (standin.reversePatchType == HarmonyReversePatchType.Snapshot)
			{
				Patches patchInfo = Harmony.GetPatchInfo(original);
				transpilers.AddRange(GetSortedPatchMethods(original, patchInfo.Transpilers.ToArray(), debug));
				ilmanipulators.AddRange(GetSortedPatchMethods(original, patchInfo.ILManipulators.ToArray(), debug));
			}
			if ((object)postTranspiler != null)
			{
				transpilers.Add(postTranspiler);
			}
			if ((object)postManipulator != null)
			{
				ilmanipulators.Add(postManipulator);
			}
			Logger.Log(Logger.LogChannel.Info, delegate
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.AppendLine("Reverse patching " + standin.method.FullDescription() + " with " + original.FullDescription());
				PrintInfo(stringBuilder, transpilers, "Transpiler");
				PrintInfo(stringBuilder, ilmanipulators, "Manipulators");
				return stringBuilder.ToString();
			}, debug);
			MethodBody patchBody = null;
			ILHook val = new ILHook((MethodBase)standin.method, (Manipulator)delegate(ILContext ctx)
			{
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Expected O, but got Unknown
				//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
				if (original is MethodInfo methodInfo2)
				{
					patchBody = ctx.Body;
					MethodPatcher methodPatcher = methodInfo2.GetMethodPatcher();
					DynamicMethodDefinition val2 = methodPatcher.CopyOriginal();
					if (val2 == null)
					{
						throw new NullReferenceException("Cannot reverse patch " + methodInfo2.FullDescription() + ": method patcher (" + methodPatcher.GetType().FullDescription() + ") can't copy original method body");
					}
					ILManipulator iLManipulator = new ILManipulator(val2.Definition.Body, debug);
					ctx.Body.Variables.Clear();
					Enumerator<VariableDefinition> enumerator2 = iLManipulator.Body.Variables.GetEnumerator();
					try
					{
						while (enumerator2.MoveNext())
						{
							VariableDefinition current2 = enumerator2.Current;
							ctx.Body.Variables.Add(new VariableDefinition(ctx.Module.ImportReference(((VariableReference)current2).VariableType)));
						}
					}
					finally
					{
						((IDisposable)enumerator2).Dispose();
					}
					foreach (MethodInfo item in transpilers)
					{
						iLManipulator.AddTranspiler(item);
					}
					iLManipulator.WriteTo(ctx.Body, standin.method);
					HarmonyManipulator.ApplyManipulators(ctx, original, ilmanipulators, null);
					Instruction val3 = null;
					foreach (Instruction item2 in ((IEnumerable<Instruction>)ctx.Instrs).Where((Instruction i) => i.OpCode == OpCodes.Ret))
					{
						if (val3 == null)
						{
							val3 = ctx.IL.Create(OpCodes.Ret);
						}
						item2.OpCode = OpCodes.Br;
						item2.Operand = val3;
					}
					if (val3 != null)
					{
						ctx.IL.Append(val3);
					}
					Logger.Log(Logger.LogChannel.IL, () => "Generated reverse patcher (" + ((MemberReference)ctx.Method).FullName + "):\n" + ctx.Body.ToILDasmString(), debug);
				}
			}, new ILHookConfig
			{
				ManualApply = true
			});
			try
			{
				val.Apply();
			}
			catch (Exception ex)
			{
				throw HarmonyException.Create(ex, patchBody);
			}
			MethodInfo methodInfo = val.GetCurrentTarget() as MethodInfo;
			PatchTools.RememberObject(standin.method, methodInfo);
			return methodInfo;
			static void PrintInfo(StringBuilder sb, ICollection<MethodInfo> methods, string name)
			{
				if (methods.Count <= 0)
				{
					return;
				}
				sb.AppendLine(name + ":");
				foreach (MethodInfo method in methods)
				{
					sb.AppendLine("  * " + method.FullDescription());
				}
			}
		}

		internal static IEnumerable<CodeInstruction> ApplyTranspilers(MethodBase methodBase, ILGenerator generator, int maxTranspilers = 0)
		{
			MethodPatcher methodPatcher = methodBase.GetMethodPatcher();
			DynamicMethodDefinition val = methodPatcher.CopyOriginal();
			if (val == null)
			{
				throw new NullReferenceException("Cannot reverse patch " + methodBase.FullDescription() + ": method patcher (" + methodPatcher.GetType().FullDescription() + ") can't copy original method body");
			}
			ILManipulator iLManipulator = new ILManipulator(val.Definition.Body, debug: false);
			PatchInfo patchInfo = methodBase.GetPatchInfo();
			if (patchInfo != null)
			{
				List<MethodInfo> sortedPatchMethods = GetSortedPatchMethods(methodBase, patchInfo.transpilers, debug: false);
				for (int i = 0; i < maxTranspilers && i < sortedPatchMethods.Count; i++)
				{
					iLManipulator.AddTranspiler(sortedPatchMethods[i]);
				}
			}
			return iLManipulator.GetInstructions(generator, methodBase);
		}

		internal static void UnpatchConditional(Func<Patch, bool> executionCondition)
		{
			foreach (MethodBase item in PatchProcessor.GetAllPatchedMethods().ToList())
			{
				bool num = item.HasMethodBody();
				Patches patchInfo2 = PatchProcessor.GetPatchInfo(item);
				PatchProcessor patchProcessor = new PatchProcessor(null, item);
				if (num)
				{
					patchInfo2.Postfixes.DoIf(executionCondition, delegate(Patch patchInfo)
					{
						patchProcessor.Unpatch(patchInfo.PatchMethod);
					});
					patchInfo2.Prefixes.DoIf(executionCondition, delegate(Patch patchInfo)
					{
						patchProcessor.Unpatch(patchInfo.PatchMethod);
					});
				}
				patchInfo2.ILManipulators.DoIf(executionCondition, delegate(Patch patchInfo)
				{
					patchProcessor.Unpatch(patchInfo.PatchMethod);
				});
				patchInfo2.Transpilers.DoIf(executionCondition, delegate(Patch patchInfo)
				{
					patchProcessor.Unpatch(patchInfo.PatchMethod);
				});
				if (num)
				{
					patchInfo2.Finalizers.DoIf(executionCondition, delegate(Patch patchInfo)
					{
						patchProcessor.Unpatch(patchInfo.PatchMethod);
					});
				}
			}
		}
	}
	internal class PatchJobs<T>
	{
		internal class Job
		{
			internal MethodBase original;

			internal T replacement;

			internal List<HarmonyMethod> prefixes = new List<HarmonyMethod>();

			internal List<HarmonyMethod> postfixes = new List<HarmonyMethod>();

			internal List<HarmonyMethod> transpilers = new List<HarmonyMethod>();

			internal List<HarmonyMethod> finalizers = new List<HarmonyMethod>();

			internal List<HarmonyMethod> ilmanipulators = new List<HarmonyMethod>();

			internal void AddPatch(AttributePatch patch)
			{
				HarmonyPatchType? type = patch.type;
				if (type.HasValue)
				{
					switch (type.GetValueOrDefault())
					{
					case HarmonyPatchType.Prefix:
						prefixes.Add(patch.info);
						break;
					case HarmonyPatchType.Postfix:
						postfixes.Add(patch.info);
						break;
					case HarmonyPatchType.Transpiler:
						transpilers.Add(patch.info);
						break;
					case HarmonyPatchType.Finalizer:
						finalizers.Add(patch.info);
						break;
					case HarmonyPatchType.ILManipulator:
						ilmanipulators.Add(patch.info);
						break;
					case HarmonyPatchType.ReversePatch:
						break;
					}
				}
			}
		}

		internal Dictionary<MethodBase, Job> state = new Dictionary<MethodBase, Job>();

		internal Job GetJob(MethodBase method)
		{
			if ((object)method == null)
			{
				return null;
			}
			if (!state.TryGetValue(method, out var value))
			{
				value = new Job
				{
					original = method
				};
				state[method] = value;
			}
			return value;
		}

		internal List<Job> GetJobs()
		{
			return state.Values.Where((Job job) => job.prefixes.Count + job.postfixes.Count + job.transpilers.Count + job.finalizers.Count + job.ilmanipulators.Count > 0).ToList();
		}

		internal List<T> GetReplacements()
		{
			return state.Values.Select((Job job) => job.replacement).ToList();
		}
	}
	internal class AttributePatch
	{
		private static readonly HarmonyPatchType[] allPatchTypes = new HarmonyPatchType[6]
		{
			HarmonyPatchType.Prefix,
			HarmonyPatchType.Postfix,
			HarmonyPatchType.Transpiler,
			HarmonyPatchType.Finalizer,
			HarmonyPatchType.ReversePatch,
			HarmonyPatchType.ILManipulator
		};

		internal HarmonyMethod info;

		internal HarmonyPatchType? type;

		private static readonly string harmonyAttributeName = typeof(HarmonyAttribute).FullName;

		internal static IEnumerable<AttributePatch> Create(MethodInfo patch, bool collectIncomplete = false)
		{
			if ((object)patch == null)
			{
				throw new NullReferenceException("Patch method cannot be null");
			}
			object[] customAttributes = patch.GetCustomAttributes(inherit: true);
			string name = patch.Name;
			HarmonyPatchType? type = GetPatchType(name, customAttributes);
			if (!type.HasValue)
			{
				return Enumerable.Empty<AttributePatch>();
			}
			if (type != HarmonyPatchType.ReversePatch && !patch.IsStatic)
			{
				throw new ArgumentException("Patch method " + patch.FullDescription() + " must be static");
			}
			List<HarmonyMethod> list = (from attr in customAttributes
				where attr.GetType().BaseType.FullName == harmonyAttributeName
				select AccessTools.Field(attr.GetType(), "info").GetValue(attr) into harmonyInfo
				select AccessTools.MakeDeepCopy<HarmonyMethod>(harmonyInfo)).ToList();
			List<HarmonyMethod> list2 = new List<HarmonyMethod>();
			ILookup<bool, HarmonyMethod> lookup = list.ToLookup((HarmonyMethod m) => IsComplete(m, collectIncomplete));
			List<HarmonyMethod> incomplete = lookup[false].ToList();
			HarmonyMethod info = HarmonyMethod.Merge(incomplete);
			List<HarmonyMethod> list3 = lookup[true].Where((HarmonyMethod m) => !Same(m, info)).ToList();
			if (list3.Count > 1)
			{
				list2.AddRange(list3.Select((HarmonyMethod m) => HarmonyMethod.Merge(incomplete.AddItem(m))));
			}
			else
			{
				list2.Add(HarmonyMethod.Merge(list));
			}
			foreach (HarmonyMethod item in list2)
			{
				item.method = patch;
			}
			return list2.Select((HarmonyMethod i) => new AttributePatch
			{
				info = i,
				type = type
			}).ToList();
			static bool IsComplete(HarmonyMethod m, bool collectIncomplete)
			{
				if (collectIncomplete || (object)m.GetDeclaringType() != null)
				{
					return m.methodName != null;
				}
				return false;
			}
			static bool Same(HarmonyMethod m1, HarmonyMethod m2)
			{
				if ((object)m1.GetDeclaringType() == m2.GetDeclaringType() && m1.methodName == m2.methodName)
				{
					return m1.GetArgumentList().SequenceEqual(m2.GetArgumentList());
				}
				return false;
			}
		}

		private static HarmonyPatchType? GetPatchType(string methodName, object[] allAttributes)
		{
			HashSet<string> hashSet = new HashSet<string>(from attr in allAttributes
				select attr.GetType().FullName into name
				where name.StartsWith("Harmony")
				select name);
			HarmonyPatchType? result = null;
			HarmonyPatchType[] array = allPatchTypes;
			for (int i = 0; i < array.Length; i++)
			{
				HarmonyPatchType value = array[i];
				string text = value.ToString();
				if (text == methodName || hashSet.Contains("HarmonyLib.Harmony" + text))
				{
					result = value;
					break;
				}
			}
			return result;
		}
	}
	internal class PatchSorter
	{
		private class PatchSortingWrapper : IComparable
		{
			internal readonly HashSet<PatchSortingWrapper> after;

			internal readonly HashSet<PatchSortingWrapper> before;

			internal readonly Patch innerPatch;

			internal PatchSortingWrapper(Patch patch)
			{
				innerPatch = patch;
				before = new HashSet<PatchSortingWrapper>();
				after = new HashSet<PatchSortingWrapper>();
			}

			public int CompareTo(object obj)
			{
				return PatchInfoSerialization.PriorityComparer((obj as PatchSortingWrapper)?.innerPatch, innerPatch.index, innerPatch.priority);
			}

			public override bool Equals(object obj)
			{
				if (obj is PatchSortingWrapper patchSortingWrapper)
				{
					return (object)innerPatch.PatchMethod == patchSortingWrapper.innerPatch.PatchMethod;
				}
				return false;
			}

			public override int GetHashCode()
			{
				return innerPatch.PatchMethod.GetHashCode();
			}

			internal void AddBeforeDependency(IEnumerable<PatchSortingWrapper> dependencies)
			{
				foreach (PatchSortingWrapper dependency in dependencies)
				{
					before.Add(dependency);
					dependency.after.Add(this);
				}
			}

			internal void AddAfterDependency(IEnumerable<PatchSortingWrapper> dependencies)
			{
				foreach (PatchSortingWrapper dependency in dependencies)
				{
					after.Add(dependency);
					dependency.before.Add(this);
				}
			}

			internal void RemoveAfterDependency(PatchSortingWrapper afterNode)
			{
				after.Remove(afterNode);
				afterNode.before.Remove(this);
			}

			internal void RemoveBeforeDependency(PatchSortingWrapper beforeNode)
			{
				before.Remove(beforeNode);
				beforeNode.after.Remove(this);
			}
		}

		internal class PatchDetailedComparer : IEqualityComparer<Patch>
		{
			public bool Equals(Patch x, Patch y)
			{
				if (y != null && x != null && x.owner == y.owner && (object)x.PatchMethod == y.PatchMethod && x.index == y.index && x.priority == y.priority && x.before.Length == y.before.Length && x.after.Length == y.after.Length && x.before.All(((IEnumerable<string>)y.before).Contains<string>))
				{
					return x.after.All(((IEnumerable<string>)y.after).Contains<string>);
				}
				return false;
			}

			public int GetHashCode(Patch obj)
			{
				return obj.GetHashCode();
			}
		}

		private List<PatchSortingWrapper> patches;

		private HashSet<PatchSortingWrapper> handledPatches;

		private List<PatchSortingWrapper> result;

		private List<PatchSortingWrapper> waitingList;

		internal Patch[] sortedPatchArray;

		private readonly bool debug;

		internal PatchSorter(Patch[] patches, bool debug = false)
		{
			this.patches = patches.Select((Patch x) => new PatchSortingWrapper(x)).ToList();
			this.debug = debug;
			foreach (PatchSortingWrapper node in this.patches)
			{
				node.AddBeforeDependency(this.patches.Where((PatchSortingWrapper x) => node.innerPatch.before.Contains(x.innerPatch.owner)));
				node.AddAfterDependency(this.patches.Where((PatchSortingWrapper x) => node.innerPatch.after.Contains(x.innerPatch.owner)));
			}
			this.patches.Sort();
		}

		internal List<MethodInfo> Sort(MethodBase original)
		{
			return (from x in SortAsPatches(original)
				select x.GetMethod(original)).ToList();
		}

		internal Patch[] SortAsPatches(MethodBase original)
		{
			if (sortedPatchArray != null)
			{
				return sortedPatchArray;
			}
			handledPatches = new HashSet<PatchSortingWrapper>();
			waitingList = new List<PatchSortingWrapper>();
			result = new List<PatchSortingWrapper>(patches.Count);
			Queue<PatchSortingWrapper> queue = new Queue<PatchSortingWrapper>(patches);
			while (queue.Count != 0)
			{
				foreach (PatchSortingWrapper item in queue)
				{
					if (item.after.All((PatchSortingWrapper x) => handledPatches.Contains(x)))
					{
						AddNodeToResult(item);
						if (item.before.Count != 0)
						{
							ProcessWaitingList();
						}
					}
					else
					{
						waitingList.Add(item);
					}
				}
				CullDependency();
				queue = new Queue<PatchSortingWrapper>(waitingList);
				waitingList.Clear();
			}
			sortedPatchArray = result.Select((PatchSortingWrapper x) => x.innerPatch).ToArray();
			handledPatches = null;
			waitingList = null;
			patches = null;
			return sortedPatchArray;
		}

		internal bool ComparePatchLists(Patch[] patches)
		{
			if (sortedPatchArray == null)
			{
				Sort(null);
			}
			if (patches != null && sortedPatchArray.Length == patches.Length)
			{
				return sortedPatchArray.All((Patch x) => patches.Contains(x, new PatchDetailedComparer()));
			}
			return false;
		}

		private void CullDependency()
		{
			for (int i = waitingList.Count - 1; i >= 0; i--)
			{
				foreach (PatchSortingWrapper afterNode in waitingList[i].after)
				{
					if (!handledPatches.Contains(afterNode))
					{
						waitingList[i].RemoveAfterDependency(afterNode);
						Logger.Log(Logger.LogChannel.Debug, delegate
						{
							string text = afterNode.innerPatch.PatchMethod.FullDescription();
							string text2 = waitingList[i].innerPatch.PatchMethod.FullDescription();
							return "Breaking dependence between " + text + " and " + text2;
						}, debug);
						return;
					}
				}
			}
		}

		private void ProcessWaitingList()
		{
			int num = waitingList.Count;
			int num2 = 0;
			while (num2 < num)
			{
				PatchSortingWrapper patchSortingWrapper = waitingList[num2];
				if (patchSortingWrapper.after.All(handledPatches.Contains))
				{
					waitingList.Remove(patchSortingWrapper);
					AddNodeToResult(patchSortingWrapper);
					num--;
					num2 = 0;
				}
				else
				{
					num2++;
				}
			}
		}

		private void AddNodeToResult(PatchSortingWrapper node)
		{
			result.Add(node);
			handledPatches.Add(node);
		}
	}
	internal static class PatchTools
	{
		[ThreadStatic]
		private static Dictionary<object, object> objectReferences;

		internal static void RememberObject(object key, object value)
		{
			if (objectReferences == null)
			{
				objectReferences = new Dictionary<object, object>();
			}
			objectReferences[key] = value;
		}

		internal static MethodInfo GetPatchMethod(Type patchType, string attributeName)
		{
			MethodInfo methodInfo = patchType.GetMethods(AccessTools.all).FirstOrDefault((MethodInfo m) => m.GetCustomAttributes(inherit: true).Any((object a) => a.GetType().FullName == attributeName));
			if ((object)methodInfo == null)
			{
				string name = attributeName.Replace("HarmonyLib.Harmony", "");
				methodInfo = patchType.GetMethod(name, AccessTools.all);
			}
			return methodInfo;
		}

		internal static AssemblyBuilder DefineDynamicAssembly(string name)
		{
			AssemblyName assemblyName = new AssemblyName(name);
			return AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
		}

		internal static List<AttributePatch> GetPatchMethods(Type type, bool collectIncomplete = false)
		{
			return (from attributePatch in AccessTools.GetDeclaredMethods(type).SelectMany((MethodInfo m) => AttributePatch.Create(m, collectIncomplete))
				where attributePatch != null
				select attributePatch).ToList();
		}

		internal static MethodBase GetOriginalMethod(this HarmonyMethod attr)
		{
			try
			{
				MethodType? methodType = attr.methodType;
				if (methodType.HasValue)
				{
					switch (methodType.GetValueOrDefault())
					{
					case MethodType.Normal:
						if (attr.methodName == null)
						{
							return null;
						}
						return AccessTools.DeclaredMethod(attr.GetDeclaringType(), attr.methodName, attr.argumentTypes);
					case MethodType.Getter:
						if (attr.methodName == null)
						{
							return null;
						}
						return AccessTools.DeclaredProperty(attr.GetDeclaringType(), attr.methodName).GetGetMethod(nonPublic: true);
					case MethodType.Setter:
						if (attr.methodName == null)
						{
							return null;
						}
						return AccessTools.DeclaredProperty(attr.GetDeclaringType(), attr.methodName).GetSetMethod(nonPublic: true);
					case MethodType.Constructor:
						return AccessTools.DeclaredConstructor(attr.GetDeclaringType(), attr.argumentTypes);
					case MethodType.StaticConstructor:
						return AccessTools.GetDeclaredConstructors(attr.GetDeclaringType()).FirstOrDefault((ConstructorInfo c) => c.IsStatic);
					case MethodType.Enumerator:
						if (attr.methodName == null)
						{
							return null;
						}
						return AccessTools.EnumeratorMoveNext(AccessTools.DeclaredMethod(attr.GetDeclaringType(), attr.methodName, attr.argumentTypes));
					}
				}
			}
			catch (AmbiguousMatchException ex)
			{
				throw new HarmonyException("Ambiguous match for HarmonyMethod[" + attr.Description() + "]", ex.InnerException ?? ex);
			}
			return null;
		}
	}
	public enum MethodType
	{
		Normal,
		Getter,
		Setter,
		Constructor,
		StaticConstructor,
		Enumerator
	}
	public enum ArgumentType
	{
		Normal,
		Ref,
		Out,
		Pointer
	}
	public enum HarmonyPatchType
	{
		All,
		Prefix,
		Postfix,
		Transpiler,
		Finalizer,
		ReversePatch,
		ILManipulator
	}
	public enum HarmonyReversePatchType
	{
		Original,
		Snapshot
	}
	public enum MethodDispatchType
	{
		VirtualCall,
		Call
	}
	[MeansImplicitUse]
	public class HarmonyAttribute : Attribute
	{
		public HarmonyMethod info = new HarmonyMethod();
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Delegate, AllowMultiple = true)]
	public class HarmonyPatch : HarmonyAttribute
	{
		public HarmonyPatch()
		{
		}

		public HarmonyPatch(Type declaringType)
		{
			info.declaringType = declaringType;
		}

		public HarmonyPatch(Type declaringType, Type[] argumentTypes)
		{
			info.declaringType = declaringType;
			info.argumentTypes = argumentTypes;
		}

		public HarmonyPatch(Type declaringType, string methodName)
		{
			info.declaringType = declaringType;
			info.methodName = methodName;
		}

		public HarmonyPatch(Type declaringType, string methodName, params Type[] argumentTypes)
		{
			info.declaringType = declaringType;
			info.methodName = methodName;
			info.argumentTypes = argumentTypes;
		}

		public HarmonyPatch(Type declaringType, string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
		{
			info.declaringType = declaringType;
			info.methodName = methodName;
			ParseSpecialArguments(argumentTypes, argumentVariations);
		}

		public HarmonyPatch(string assemblyQualifiedDeclaringType, string methodName)
		{
			info.assemblyQualifiedDeclaringTypeName = assemblyQualifiedDeclaringType;
			info.methodName = methodName;
		}

		public HarmonyPatch(string assemblyQualifiedDeclaringType, string methodName, MethodType methodType, Type[] argumentTypes = null, ArgumentType[] argumentVariations = null)
		{
			info.assemblyQualifiedDeclaringTypeName = assemblyQualifiedDeclaringType;
			info.methodName = methodName;
			info.methodType = methodType;
			if (argumentTypes != null)
			{
				ParseSpecialArguments(argumentTypes, argumentVariations);
			}
		}

		public HarmonyPatch(Type declaringType, MethodType methodType)
		{
			info.declaringType = declaringType;
			info.methodType = methodType;
		}

		public HarmonyPatch(Type declaringType, MethodType methodType, params Type[] argumentTypes)
		{
			info.declaringType = declaringType;
			info.methodType = methodType;
			info.argumentTypes = argumentTypes;
		}

		public HarmonyPatch(Type declaringType, MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
		{
			info.declaringType = declaringType;
			info.methodType = methodType;
			ParseSpecialArguments(argumentTypes, argumentVariations);
		}

		public HarmonyPatch(Type declaringType, string methodName, MethodType methodType)
		{
			info.declaringType = declaringType;
			info.methodName = methodName;
			info.methodType = methodType;
		}

		public HarmonyPatch(string methodName)
		{
			info.methodName = methodName;
		}

		public HarmonyPatch(string methodName, params Type[] argumentTypes)
		{
			info.methodName = methodName;
			info.argumentTypes = argumentTypes;
		}

		public HarmonyPatch(string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
		{
			info.methodName = methodName;
			ParseSpecialArguments(argumentTypes, argumentVariations);
		}

		public HarmonyPatch(string methodName, MethodType methodType)
		{
			info.methodName = methodName;
			info.methodType = methodType;
		}

		public HarmonyPatch(MethodType methodType)
		{
			info.methodType = methodType;
		}

		public HarmonyPatch(MethodType methodType, params Type[] argumentTypes)
		{
			info.methodType = methodType;
			info.argumentTypes = argumentTypes;
		}

		public HarmonyPatch(MethodType methodType, Type[] argumentTypes, ArgumentType[] argumentVariations)
		{
			info.methodType = methodType;
			ParseSpecialArguments(argumentTypes, argumentVariations);
		}

		public HarmonyPatch(Type[] argumentTypes)
		{
			info.argumentTypes = argumentTypes;
		}

		public HarmonyPatch(Type[] argumentTypes, ArgumentType[] argumentVariations)
		{
			ParseSpecialArguments(argumentTypes, argumentVariations);
		}

		private void ParseSpecialArguments(Type[] argumentTypes, ArgumentType[] argumentVariations)
		{
			if (argumentVariations == null || argumentVariations.Length == 0)
			{
				info.argumentTypes = argumentTypes;
				return;
			}
			if (argumentTypes.Length < argumentVariations.Length)
			{
				throw new ArgumentException("argumentVariations contains more elements than argumentTypes", "argumentVariations");
			}
			List<Type> list = new List<Type>();
			for (int i = 0; i < argumentTypes.Length; i++)
			{
				Type type = argumentTypes[i];
				switch (argumentVariations[i])
				{
				case ArgumentType.Ref:
				case ArgumentType.Out:
					type = type.MakeByRefType();
					break;
				case ArgumentType.Pointer:
					type = type.MakePointerType();
					break;
				}
				list.Add(type);
			}
			info.argumentTypes = list.ToArray();
		}
	}
	[AttributeUsage(AttributeTargets.Delegate, AllowMultiple = true)]
	public class HarmonyDelegate : HarmonyPatch
	{
		public HarmonyDelegate(Type declaringType)
			: base(declaringType)
		{
		}

		public HarmonyDelegate(Type declaringType, Type[] argumentTypes)
			: base(declaringType, argumentTypes)
		{
		}

		public HarmonyDelegate(Type declaringType, string methodName)
			: base(declaringType, methodName)
		{
		}

		public HarmonyDelegate(Type declaringType, string methodName, params Type[] argumentTypes)
			: base(declaringType, methodName, argumentTypes)
		{
		}

		public HarmonyDelegate(Type declaringType, string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
			: base(declaringType, methodName, argumentTypes, argumentVariations)
		{
		}

		public HarmonyDelegate(Type declaringType, MethodDispatchType methodDispatchType)
			: base(declaringType, MethodType.Normal)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(Type declaringType, MethodDispatchType methodDispatchType, params Type[] argumentTypes)
			: base(declaringType, MethodType.Normal, argumentTypes)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(Type declaringType, MethodDispatchType methodDispatchType, Type[] argumentTypes, ArgumentType[] argumentVariations)
			: base(declaringType, MethodType.Normal, argumentTypes, argumentVariations)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(Type declaringType, string methodName, MethodDispatchType methodDispatchType)
			: base(declaringType, methodName, MethodType.Normal)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(string methodName)
			: base(methodName)
		{
		}

		public HarmonyDelegate(string methodName, params Type[] argumentTypes)
			: base(methodName, argumentTypes)
		{
		}

		public HarmonyDelegate(string methodName, Type[] argumentTypes, ArgumentType[] argumentVariations)
			: base(methodName, argumentTypes, argumentVariations)
		{
		}

		public HarmonyDelegate(string methodName, MethodDispatchType methodDispatchType)
			: base(methodName, MethodType.Normal)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(MethodDispatchType methodDispatchType)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(MethodDispatchType methodDispatchType, params Type[] argumentTypes)
			: base(MethodType.Normal, argumentTypes)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(MethodDispatchType methodDispatchType, Type[] argumentTypes, ArgumentType[] argumentVariations)
			: base(MethodType.Normal, argumentTypes, argumentVariations)
		{
			info.nonVirtualDelegate = methodDispatchType == MethodDispatchType.Call;
		}

		public HarmonyDelegate(Type[] argumentTypes)
			: base(argumentTypes)
		{
		}

		public HarmonyDelegate(Type[] argumentTypes, ArgumentType[] argumentVariations)
			: base(argumentTypes, argumentVariations)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
	public class HarmonyReversePatch : HarmonyAttribute
	{
		public HarmonyReversePatch(HarmonyReversePatchType type = HarmonyReversePatchType.Original)
		{
			info.reversePatchType = type;
		}
	}
	[AttributeUsage(AttributeTargets.Class)]
	public class HarmonyPatchAll : HarmonyAttribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
	public class HarmonyPriority : HarmonyAttribute
	{
		public HarmonyPriority(int priority)
		{
			info.priority = priority;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
	public class HarmonyBefore : HarmonyAttribute
	{
		public HarmonyBefore(params string[] before)
		{
			info.before = before;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
	public class HarmonyAfter : HarmonyAttribute
	{
		public HarmonyAfter(params string[] after)
		{
			info.after = after;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
	public class HarmonyDebug : HarmonyAttribute
	{
		public HarmonyDebug()
		{
			info.debug = true;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
	public class HarmonyEmitIL : HarmonyAttribute
	{
		public HarmonyEmitIL()
		{
			info.debugEmitPath = "./";
		}

		public HarmonyEmitIL(string dir)
		{
			info.debugEmitPath = dir;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
	public class HarmonyWrapSafe : HarmonyAttribute
	{
		public HarmonyWrapSafe()
		{
			info.wrapTryCatch = true;
		}
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyPrepare : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyCleanup : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyTargetMethod : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyTargetMethods : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyPrefix : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyPostfix : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyTranspiler : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyILManipulator : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class HarmonyFinalizer : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Parameter, AllowMultiple = true)]
	public class HarmonyArgument : Attribute
	{
		public string OriginalName { get; private set; }

		public int Index { get; private set; }

		public string NewName { get; private set; }

		public HarmonyArgument(string originalName)
			: this(originalName, null)
		{
		}

		public HarmonyArgument(int index)
			: this(index, null)
		{
		}

		public HarmonyArgument(string originalName, string newName)
		{
			OriginalName = originalName;
			Index = -1;
			NewName = newName;
		}

		public HarmonyArgument(int index, string name)
		{
			OriginalName = null;
			Index = index;
			NewName = name;
		}
	}
	public class CodeInstruction
	{
		public OpCode opcode;

		public object operand;

		public List<Label> labels = new List<Label>();

		public List<ExceptionBlock> blocks = new List<ExceptionBlock>();

		internal CodeInstruction()
		{
		}

		public CodeInstruction(OpCode opcode, object operand = null)
		{
			this.opcode = opcode;
			this.operand = operand;
		}

		public CodeInstruction(CodeInstruction instruction)
		{
			opcode = instruction.opcode;
			operand = instruction.operand;
			labels = instruction.labels.ToList();
			blocks = instruction.blocks.ToList();
		}

		public CodeInstruction Clone()
		{
			return new CodeInstruction(this)
			{
				labels = new List<Label>(),
				blocks = new List<ExceptionBlock>()
			};
		}

		public CodeInstruction Clone(OpCode opcode)
		{
			CodeInstruction codeInstruction = Clone();
			codeInstruction.opcode = opcode;
			return codeInstruction;
		}

		public CodeInstruction Clone(object operand)
		{
			CodeInstruction codeInstruction = Clone();
			codeInstruction.operand = operand;
			return codeInstruction;
		}

		public static CodeInstruction Call(Type type, string name, Type[] parameters = null, Type[] generics = null)
		{
			MethodInfo methodInfo = AccessTools.Method(type, name, parameters, generics);
			if ((object)methodInfo == null)
			{
				throw new ArgumentException($"No method found for type={type}, name={name}, parameters={parameters.Description()}, generics={generics.Description()}");
			}
			return new CodeInstruction(OpCodes.Call, methodInfo);
		}

		public static CodeInstruction Call(string typeColonMethodname, Type[] parameters = null, Type[] generics = null)
		{
			MethodInfo methodInfo = AccessTools.Method(typeColonMethodname, parameters, generics);
			if ((object)methodInfo == null)
			{
				throw new ArgumentException("No method found for " + typeColonMethodname + ", parameters=" + parameters.Description() + ", generics=" + generics.Description());
			}
			return new CodeInstruction(OpCodes.Call, methodInfo);
		}

		public static CodeInstruction Call(Expression<Action> expression)
		{
			return new CodeInstruction(OpCodes.Call, SymbolExtensions.GetMethodInfo(expression));
		}

		public static CodeInstruction Call<T>(Expression<Action<T>> expression)
		{
			return new CodeInstruction(OpCodes.Call, SymbolExtensions.GetMethodInfo(expression));
		}

		public static CodeInstruction Call<T, TResult>(Expression<Func<T, TResult>> expression)
		{
			return new CodeInstruction(OpCodes.Call, SymbolExtensions.GetMethodInfo(expression));
		}

		public static CodeInstruction Call(LambdaExpression expression)
		{
			return new CodeInstruction(OpCodes.Call, SymbolExtensions.GetMethodInfo(expression));
		}

		public static CodeInstruction CallClosure<T>(T closure) where T : Delegate
		{
			return Transpilers.EmitDelegate(closure);
		}

		public static CodeInstruction LoadField(Type type, string name, bool useAddress = false)
		{
			FieldInfo fieldInfo = AccessTools.Field(type, name);
			if ((object)fieldInfo == null)
			{
				throw new ArgumentException($"No field found for {type} and {name}");
			}
			return new CodeInstruction((!useAddress) ? (fieldInfo.IsStatic ? OpCodes.Ldsfld : OpCodes.Ldfld) : (fieldInfo.IsStatic ? OpCodes.Ldsflda : OpCodes.Ldflda), fieldInfo);
		}

		public static CodeInstruction StoreField(Type type, string name)
		{
			FieldInfo fieldInfo = AccessTools.Field(type, name);
			if ((object)fieldInfo == null)
			{
				throw new ArgumentException($"No field found for {type} and {name}");
			}
			return new CodeInstruction(fieldInfo.IsStatic ? OpCodes.Stsfld : OpCodes.Stfld, fieldInfo);
		}

		public override string ToString()
		{
			List<string> list = new List<string>();
			foreach (Label label in labels)
			{
				list.Add($"Label{label.GetHashCode()}");
			}
			foreach (ExceptionBlock block in blocks)
			{
				list.Add("EX_" + block.blockType.ToString().Replace("Block", ""));
			}
			string text = ((list.Count > 0) ? (" [" + string.Join(", ", list.ToArray()) + "]") : "");
			string text2 = FormatArgument(operand);
			if (text2.Length > 0)
			{
				text2 = " " + text2;
			}
			OpCode opCode = opcode;
			return opCode.ToString() + text2 + text;
		}

		internal static string FormatArgument(object argument, string extra = null)
		{
			if (argument == null)
			{
				return "NULL";
			}
			Type type = argument.GetType();
			if (argument is MethodBase member)
			{
				return member.FullDescription() + ((extra != null) ? (" " + extra) : "");
			}
			if (argument is FieldInfo fieldInfo)
			{
				return fieldInfo.FieldType.FullDescription() + " " + fieldInfo.DeclaringType.FullDescription() + "::" + fieldInfo.Name;
			}
			if ((object)type == typeof(Label))
			{
				return $"Label{((Label)argument).GetHashCode()}";
			}
			if ((object)type == typeof(Label[]))
			{
				return "Labels" + string.Join(",", ((Label[])argument).Select((Label l) => l.GetHashCode().ToString()).ToArray());
			}
			if ((object)type == typeof(LocalBuilder))
			{
				return $"{((LocalBuilder)argument).LocalIndex} ({((LocalBuilder)argument).LocalType})";
			}
			if ((object)type == typeof(string))
			{
				return argument.ToString().ToLiteral();
			}
			return argument.ToString().Trim();
		}
	}
	public enum ExceptionBlockType
	{
		BeginExceptionBlock,
		BeginCatchBlock,
		BeginExceptFilterBlock,
		BeginFaultBlock,
		BeginFinallyBlock,
		EndExceptionBlock
	}
	public class ExceptionBlock
	{
		public ExceptionBlockType blockType;

		public Type catchType;

		public ExceptionBlock(ExceptionBlockType blockType, Type catchType = null)
		{
			this.blockType = blockType;
			this.catchType = catchType ?? typeof(object);
		}
	}
	public class InvalidHarmonyPatchArgumentException : Exception
	{
		public MethodBase Original { get; }

		public MethodInfo Patch { get; }

		public override string Message => "(" + Patch.FullDescription() + "): " + base.Message;

		public InvalidHarmonyPatchArgumentException(string message, MethodBase original, MethodInfo patch)
			: base(message)
		{
			Original = original;
			Patch = patch;
		}
	}
	public class MemberNotFoundException : Exception
	{
		public MemberNotFoundException(string message)
			: base(message)
		{
		}
	}
	public class Harmony : IDisposable
	{
		[Obsolete("Use HarmonyFileLog.Enabled instead")]
		public static bool DEBUG;

		public string Id { get; }

		static Harmony()
		{
			StackTraceFixes.Install();
		}

		public Harmony(string id)
		{
			if (string.IsNullOrEmpty(id))
			{
				throw new ArgumentException("id cannot be null or empty");
			}
			try
			{
				string environmentVariable = Environment.GetEnvironmentVariable("HARMONY_DEBUG");
				if (environmentVariable != null && environmentVariable.Length > 0)
				{
					environmentVariable = environmentVariable.Trim();
					DEBUG = environmentVariable == "1" || bool.Parse(environmentVariable);
				}
			}
			catch
			{
			}
			if (DEBUG)
			{
				HarmonyFileLog.Enabled = true;
			}
			MethodBase callingMethod = (Logger.IsEnabledFor(Logger.LogChannel.Info) ? AccessTools.GetOutsideCaller() : null);
			Logger.Log(Logger.LogChannel.Info, delegate
			{
				//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)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				StringBuilder stringBuilder = new StringBuilder();
				Assembly assembly = typeof(Harmony).Assembly;
				Version version = assembly.GetName().Version;
				string text = assembly.Location;
				string text2 = Environment.Version.ToString();
				string text3 = Environment.OSVersion.Platform.ToString();
				if (string.IsNullOrEmpty(text))
				{
					text = new Uri(assembly.CodeBase).LocalPath;
				}
				int size = IntPtr.Size;
				Platform current = PlatformHelper.Current;
				stringBuilder.AppendLine($"### Harmony id={id}, version={version}, location={text}, env/clr={text2}, platform={text3}, ptrsize:runtime/env={size}/{current}");
				if ((object)callingMethod?.DeclaringType != null)
				{
					Assembly assembly2 = callingMethod.DeclaringType.Assembly;
					text = assembly2.Location;
					if (string.IsNullOrEmpty(text))
					{
						text = new Uri(assembly2.CodeBase).LocalPath;
					}
					stringBuilder.AppendLine("### Started from " + callingMethod.FullDescription() + ", location " + text);
					stringBuilder.Append($"### At {DateTime.Now:yyyy-MM-dd hh.mm.ss}");
				}
				return stringBuilder.ToString();
			});
			Id = id;
		}

		public void PatchAll()
		{
			Assembly assembly = new StackTrace().GetFrame(1).GetMethod().ReflectedType.Assembly;
			PatchAll(assembly);
		}

		public PatchProcessor CreateProcessor(MethodBase original)
		{
			return new PatchProcessor(this, original);
		}

		public PatchClassProcessor CreateClassProcessor(Type type)
		{
			return new PatchClassProcessor(this, type);
		}

		public PatchClassProcessor CreateClassProcessor(Type type, bool allowUnannotatedType)
		{
			return new PatchClassProcessor(this, type, allowUnannotatedType);
		}

		public ReversePatcher CreateReversePatcher(MethodBase original, HarmonyMethod standin)
		{
			return new ReversePatcher(this, original, standin);
		}

		public void PatchAll(Assembly assembly)
		{
			AccessTools.GetTypesFromAssembly(assembly).Do(delegate(Type type)
			{
				CreateClassProcessor(type).Patch();
			});
		}

		public void PatchAll(Type type)
		{
			CreateClassProcessor(type, allowUnannotatedType: true).Patch();
		}

		public MethodInfo Patch(MethodBase original, HarmonyMethod prefix = null, HarmonyMethod postfix = null, HarmonyMethod transpiler = null, HarmonyMethod finalizer = null, HarmonyMethod ilmanipulator = null)
		{
			PatchProcessor patchProcessor = CreateProcessor(original);
			patchProcessor.AddPrefix(prefix);
			patchProcessor.AddPostfix(postfix);
			patchProcessor.AddTranspiler(transpiler);
			patchProcessor.AddFinalizer(finalizer);
			patchProcessor.AddILManipulator(ilmanipulator);
			return patchProcessor.Patch();
		}

		[Obsolete("Use newer Patch() instead", true)]
		public MethodInfo Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer)
		{
			return Patch(original, prefix, postfix, transpiler, finalizer, null);
		}

		public static MethodInfo ReversePatch(MethodBase original, HarmonyMethod standin, MethodInfo transpiler = null, MethodInfo ilmanipulator = null)
		{
			return PatchFunctions.ReversePatch(standin, original, transpiler, ilmanipulator);
		}

		[Obsolete("Use newer ReversePatch() instead", true)]
		public static MethodInfo ReversePatch(MethodBase original, HarmonyMethod standin, MethodInfo transpiler)
		{
			return PatchFunctions.ReversePatch(standin, original, transpiler, null);
		}

		public static void UnpatchID(string harmonyID)
		{
			if (string.IsNullOrEmpty(harmonyID))
			{
				throw new ArgumentNullException("harmonyID", "UnpatchID was called with a null or empty harmonyID.");
			}
			PatchFunctions.UnpatchConditional((Patch patchInfo) => patchInfo.owner == harmonyID);
		}

		void IDisposable.Dispose()
		{
			UnpatchSelf();
		}

		public void UnpatchSelf()
		{
			UnpatchID(Id);
		}

		public static void UnpatchAll()
		{
			Logger.Log(Logger.LogChannel.Warn, () => "UnpatchAll has been called - This will remove ALL HARMONY PATCHES.");
			PatchFunctions.UnpatchConditional((Patch _) => true);
		}

		[Obsolete("Use UnpatchSelf() to unpatch the current instance. The functionality to unpatch either other ids or EVERYTHING has been moved the static methods UnpatchID() and UnpatchAll() respectively", true)]
		public void UnpatchAll(string harmonyID = null)
		{
			if (harmonyID == null)
			{
				if (HarmonyGlobalSettings.DisallowLegacyGlobalUnpatchAll)
				{
					Logger.Log(Logger.LogChannel.Warn, () => "Legacy UnpatchAll has been called AND DisallowLegacyGlobalUnpatchAll=true. Skipping execution of UnpatchAll");
				}
				else
				{
					UnpatchAll();
				}
			}
			else if (harmonyID.Length == 0)
			{
				Logger.Log(Logger.LogChannel.Warn, () => "Legacy UnpatchAll was called with harmonyID=\"\" which is an invalid id. Skipping execution of UnpatchAll");
			}
			else
			{
				UnpatchID(harmonyID);
			}
		}

		public void Unpatch(MethodBase original, HarmonyPatchType type, string harmonyID = null)
		{
			CreateProcessor(original).Unpatch(type, harmonyID);
		}

		public void Unpatch(MethodBase original, MethodInfo patch)
		{
			CreateProcessor(original).Unpatch(patch);
		}

		public static bool HasAnyPatches(string harmonyID)
		{
			return (from original in GetAllPatchedMethods()
				select GetPatchInfo(original)).Any((Patches info) => info.Owners.Contains(harmonyID));
		}

		public static Patches GetPatchInfo(MethodBase method)
		{
			return PatchProcessor.GetPatchInfo(method);
		}

		public IEnumerable<MethodBase> GetPatchedMethods()
		{
			return from original in GetAllPatchedMethods()
				where GetPatchInfo(original).Owners.Contains(Id)
				select original;
		}

		public static IEnumerable<MethodBase> GetAllPatchedMethods()
		{
			return PatchProcessor.GetAllPatchedMethods();
		}

		public static MethodBase GetOriginalMethod(MethodInfo replacement)
		{
			if ((object)replacement == null)
			{
				throw new ArgumentNullException("replacement");
			}
			return PatchManager.GetOriginal(replacement);
		}

		public static MethodBase GetMethodFromStackframe(StackFrame frame)
		{
			if (frame == null)
			{
				throw new ArgumentNullException("frame");
			}
			return PatchManager.FindReplacement(frame) ?? frame.GetMethod();
		}

		public static Dictionary<string, Version> VersionInfo(out Version currentVersion)
		{
			return PatchProcessor.VersionInfo(out currentVersion);
		}

		public static Harmony CreateAndPatchAll(Type type, string harmonyInstanceId = null)
		{
			Harmony harmony = new Harmony(harmonyInstanceId ?? $"harmony-auto-{Guid.NewGuid()}");
			harmony.PatchAll(type);
			return harmony;
		}

		public static Harmony CreateAndPatchAll(Assembly assembly, string harmonyInstanceId = null)
		{
			Harmony harmony = new Harmony(harmonyInstanceId ?? $"harmony-auto-{Guid.NewGuid()}");
			harmony.PatchAll(assembly);
			return harmony;
		}
	}
	[Serializable]
	public class HarmonyException : Exception
	{
		private Dictionary<int, CodeInstruction> instructions;

		private int errorOffset;

		internal HarmonyException()
		{
		}

		internal HarmonyException(string message)
			: base(message)
		{
		}

		internal HarmonyException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		protected HarmonyException(SerializationInfo serializationInfo, StreamingContext streamingContext)
		{
			throw new NotImplementedException();
		}

		internal HarmonyException(Exception innerException, Dictionary<int, CodeInstruction> instructions, int errorOffset)
			: base("IL Compile Error", innerException)
		{
			this.instructions = instructions;
			this.errorOffset = errorOffset;
		}

		internal static Exception Create(Exception ex, MethodBody body)
		{
			Match match = Regex.Match(ex.Message.TrimEnd(new char[0]), "Reason: Invalid IL code in.+: IL_(\\d{4}): (.+)$");
			if (!match.Success)
			{
				return new HarmonyException("IL Compile Error (unknown location)", ex);
			}
			Dictionary<int, CodeInstruction> dictionary = ILManipulator.GetInstructions(body) ?? new Dictionary<int, CodeInstruction>();
			int num = int.Parse(match.Groups[1].Value, NumberStyles.HexNumber);
			Regex.Replace(match.Groups[2].Value, " {2,}", " ");
			if (ex is HarmonyException ex2)
			{
				if (dictionary.Count != 0)
				{
					ex2.instructions = dictionary;
					ex2.errorOffset = num;
				}
				return ex2;
			}
			return new HarmonyException(ex, dictionary, num);
		}

		public List<KeyValuePair<int, CodeInstruction>> GetInstructionsWithOffsets()
		{
			return instructions.OrderBy((KeyValuePair<int, CodeInstruction> ins) => ins.Key).ToList();
		}

		public List<CodeInstruction> GetInstructions()
		{
			return (from ins in instructions
				orderby ins.Key
				select ins.Value).ToList();
		}

		public int GetErrorOffset()
		{
			return errorOffset;
		}

		public int GetErrorIndex()
		{
			if (instructions.TryGetValue(errorOffset, out var value))
			{
				return GetInstructions().IndexOf(value);
			}
			return -1;
		}
	}
	public static class HarmonyGlobalSettings
	{
		public static bool DisallowLegacyGlobalUnpatchAll { get; set; }
	}
	public class HarmonyMethod
	{
		public MethodInfo method;

		public Type declaringType;

		public string methodName;

		public MethodType? methodType;

		public Type[] argumentTypes;

		public int priority = -1;

		public string[] before;

		public string[] after;

		public HarmonyReversePatchType? reversePatchType;

		public bool? debug;

		public string debugEmitPath;

		public bool nonVirtualDelegate;

		public bool? wrapTryCatch;

		internal string assemblyQualifiedDeclaringTypeName;

		public HarmonyMethod()
		{
		}

		private void ImportMethod(MethodInfo theMethod)
		{
			method = theMethod;
			if ((object)method != null)
			{
				List<HarmonyMethod> fromMethod = HarmonyMethodExtensions.GetFromMethod(method);
				if (fromMethod != null)
				{
					Merge(fromMethod).CopyTo(this);
				}
			}
		}

		public HarmonyMethod(MethodInfo method)
		{
			if ((object)method == null)
			{
				throw new ArgumentNullException("method");
			}
			ImportMethod(method);
		}

		public HarmonyMethod(MethodInfo method, int priority = -1, string[] before = null, string[] after = null, bool? debug = null)
		{
			if ((object)method == null)
			{
				throw new ArgumentNullException("method");
			}
			ImportMethod(method);
			this.priority = priority;
			this.before = before;
			this.after = after;
			this.debug = debug;
		}

		public HarmonyMethod(Type methodType, string methodName, Type[] argumentTypes = null)
		{
			MethodInfo methodInfo = AccessTools.Method(methodType, methodName, argumentTypes);
			if ((object)methodInfo == null)
			{
				throw new ArgumentException($"Cannot not find method for type {methodType} and name {methodName} and parameters {argumentTypes?.Description()}");
			}
			ImportMethod(methodInfo);
		}

		public static List<string> HarmonyFields()
		{
			return (from s in AccessTools.GetFieldNames(typeof(HarmonyMethod))
				where s != "method"
				select s).ToList();
		}

		public static HarmonyMethod Merge(List<HarmonyMethod> attributes)
		{
			return Merge((IEnumerable<HarmonyMethod>)attributes);
		}

		internal static HarmonyMethod Merge(IEnumerable<HarmonyMethod> attributes)
		{
			HarmonyMethod harmonyMethod = new HarmonyMethod();
			if (attributes == null)
			{
				return harmonyMethod;
			}
			Traverse resultTrv = Traverse.Create(harmonyMethod);
			attributes.Do(delegate(HarmonyMethod attribute)
			{
				Traverse trv = Traverse.Create(attribute);
				HarmonyFields().ForEach(delegate(string f)
				{
					object value = trv.Field(f).GetValue();
					if (value != null && (f != "priority" || (int)value != -1))
					{
						HarmonyMethodExtensions.SetValue(resultTrv, f, value);
					}
				});
			});
			return harmonyMethod;
		}

		public override string ToString()
		{
			string result = "";
			Traverse trv = Traverse.Create(this);
			HarmonyFields().ForEach(delegate(string f)
			{
				if (result.Length > 0)
				{
					result += ", ";
				}
				result += $"{f}={trv.Field(f).GetValue()}";
			});
			return "HarmonyMethod[" + result + "]";
		}

		internal string Description()
		{
			string text = (((object)declaringType != null) ? declaringType.FullName : ((assemblyQualifiedDeclaringTypeName != null) ? assemblyQualifiedDeclaringTypeName : "undefined"));
			string text2 = methodName ?? "undefined";
			string text3 = (methodType.HasValue ? methodType.Value.ToString() : "undefined");
			string text4 = ((argumentTypes != null) ? argumentTypes.Description() : "undefined");
			return "(class=" + text + ", methodname=" + text2 + ", type=" + text3 + ", args=" + text4 + ")";
		}

		internal Type GetDeclaringType()
		{
			if ((object)declaringType == null && assemblyQualifiedDeclaringTypeName != null)
			{
				declaringType = Type.GetType(assemblyQualifiedDeclaringTypeName, throwOnError: true);
			}
			return declaringType;
		}

		internal Type[] GetArgumentList()
		{
			return argumentTypes ?? EmptyType.NoArgs;
		}
	}
	internal static class EmptyType
	{
		internal static readonly Type[] NoArgs = new Type[0];
	}
	public static class HarmonyMethodExtensions
	{
		internal static void SetValue(Traverse trv, string name, object val)
		{
			if (val != null)
			{
				Traverse traverse = trv.Field(name);
				if (name == "methodType" || name == "reversePatchType")
				{
					val = Enum.ToObject(Nullable.GetUnderlyingType(traverse.GetValueType()), (int)val);
				}
				traverse.SetValue(val);
			}
		}

		public static void CopyTo(this HarmonyMethod from, HarmonyMethod to)
		{
			if (to == null)
			{
				return;
			}
			Traverse fromTrv = Traverse.Create(from);
			Traverse toTrv = Traverse.Create(to);
			HarmonyMethod.HarmonyFields().ForEach(delegate(string f)
			{
				object value = fromTrv.Field(f).GetValue();
				if (value != null)
				{
					SetValue(toTrv, f, value);
				}
			});
		}

		public static HarmonyMethod Clone(this HarmonyMethod original)
		{
			HarmonyMethod harmonyMethod = new HarmonyMethod();
			original.CopyTo(harmonyMethod);
			return harmonyMethod;
		}

		public static HarmonyMethod Merge(this HarmonyMethod master, HarmonyMethod detail)
		{
			if (detail == null)
			{
				return master;
			}
			HarmonyMethod harmonyMethod = new HarmonyMethod();
			Traverse resultTrv = Traverse.Create(harmonyMethod);
			Traverse masterTrv = Traverse.Create(master);
			Traverse detailTrv = Traverse.Create(detail);
			HarmonyMethod.HarmonyFields().ForEach(delegate(string f)
			{
				object value = masterTrv.Field(f).GetValue();
				object value2 = detailTrv.Field(f).GetValue();
				if (f != "priority" || (int)value2 != -1)
				{
					SetValue(resultTrv, f, value2 ?? value);
				}
			});
			return harmonyMethod;
		}

		private static HarmonyMethod GetHarmonyMethodInfo(object attribute)
		{
			FieldInfo field = attribute.GetType().GetField("info", AccessTools.all);
			if ((object)field == null)
			{
				return null;
			}
			if (field.FieldType.FullName != typeof(HarmonyMethod).FullName)
			{
				return null;
			}
			return AccessTools.MakeDeepCopy<HarmonyMethod>(field.GetValue(attribute));
		}

		public static List<HarmonyMethod> GetFromType(Type type)
		{
			return (from attr in type.GetCustomAttributes(inherit: true)
				select GetHarmonyMethodInfo(attr) into info
				where info != null
				select info).ToList();
		}

		public static HarmonyMethod GetMergedFromType(Type type)
		{
			return HarmonyMethod.Merge(GetFromType(type));
		}

		public static List<HarmonyMethod> GetFromMethod(MethodBase method)
		{
			return (from attr in method.GetCustomAttributes(inherit: true)
				select GetHarmonyMethodInfo(attr) into info
				where info != null
				select info).ToList();
		}

		public static HarmonyMethod GetMergedFromMethod(MethodBase method)
		{
			return HarmonyMethod.Merge(GetFromMethod(method));
		}
	}
	public class InlineSignature : ICallSiteGenerator
	{
		public class ModifierType
		{
			public bool IsOptional;

			public Type Modifier;

			public object Type;

			public override string ToString()
			{
				return ((Type is Type type) ? type.FullDescription() : Type?.ToString()) + " mod" + (IsOptional ? "opt" : "req") + "(" + Modifier?.FullDescription() + ")";
			}

			internal TypeReference ToTypeReference(ModuleDefinition module)
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Expected O, but got Unknown
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Expected O, but got Unknown
				if (!IsOptional)
				{
					return (TypeReference)new RequiredModifierType(module.ImportReference(Modifier), GetTypeReference(module, Type));
				}
				return (TypeReference)new OptionalModifierType(module.ImportReference(Modifier), GetTypeReference(module, Type));
			}
		}

		public bool HasThis { get; set; }

		public bool ExplicitThis { get; set; }

		public CallingConvention CallingConvention { get; set; } = CallingConvention.Winapi;


		public List<object> Parameters { get; set; } = new List<object>();


		public object ReturnType { get; set; } = typeof(void);


		public override string ToString()
		{
			return ((ReturnType is Type type) ? type.FullDescription() : ReturnType?.ToString()) + " (" + Parameters.Join((object p) => (!(p is Type type2)) ? p?.ToString() : type2.FullDescription()) + ")";
		}

		internal static TypeReference GetTypeReference(ModuleDefinition module, object param)
		{
			if (!(param is Type type))
			{
				if (!(param is InlineSignature inlineSignature))
				{
					if (param is ModifierType modifierType)
					{
						return modifierType.ToTypeReference(module);
					}
					throw new NotSupportedException($"Unsupported inline signature parameter type: {param} ({param?.GetType().FullDescription()})");
				}
				return (TypeReference)(object)inlineSignature.ToFunctionPointer(module);
			}
			return module.ImportReference(type);
		}

		CallSite ICallSiteGenerator.ToCallSite(ModuleDefinition module)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			CallSite val = new CallSite(GetTypeReference(module, ReturnType))
			{
				HasThis = HasThis,
				ExplicitThis = ExplicitThis,
				CallingConvention = (MethodCallingConvention)(byte)((byte)CallingConvention - 1)
			};
			foreach (object parameter in Parameters)
			{
				val.Parameters.Add(new ParameterDefinition(GetTypeReference(module, parameter)));
			}
			return val;
		}

		private FunctionPointerType ToFunctionPointer(ModuleDefinition module)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			FunctionPointerType val = new FunctionPointerType
			{
				ReturnType = GetTypeReference(module, ReturnType),
				HasThis = HasThis,
				ExplicitThis = ExplicitThis,
				CallingConvention = (MethodCallingConvention)(byte)((byte)CallingConvention - 1)
			};
			foreach (object parameter in Parameters)
			{
				val.Parameters.Add(new ParameterDefinition(GetTypeReference(module, parameter)));
			}
			return val;
		}
	}
	internal static class PatchInfoSerialization
	{
		private class Binder : SerializationBinder
		{
			public override Type BindToType(string assemblyName, string typeName)
			{
				Type[] array = new Type[3]
				{
					typeof(PatchInfo),
					typeof(Patch[]),
					typeof(Patch)
				};
				foreach (Type type in array)
				{
					if (typeName == type.FullName)
					{
						return type;
					}
				}
				return Type.GetType($"{typeName}, {assemblyName}");
			}
		}

		internal static byte[] Serialize(this PatchInfo patchInfo)
		{
			using MemoryStream memoryStream = new MemoryStream();
			new BinaryFormatter().Serialize(memoryStream, patchInfo);
			return memoryStream.GetBuffer();
		}

		internal static PatchInfo Deserialize(byte[] bytes)
		{
			BinaryFormatter obj = new BinaryFormatter
			{
				Binder = new Binder()
			};
			MemoryStream serializationStream = new MemoryStream(bytes);
			return (PatchInfo)obj.Deserialize(serializationStream);
		}

		internal static int PriorityComparer(object obj, int index, int priority)
		{
			Traverse traverse = Traverse.Create(obj);
			int value = traverse.Field("priority").GetValue<int>();
			int value2 = traverse.Field("index").GetValue<int>();
			if (priority != value)
			{
				return -priority.CompareTo(value);
			}
			return index.CompareTo(value2);
		}
	}
	[Serializable]
	public class PatchInfo
	{
		public Patch[] prefixes = new Patch[0];

		public Patch[] postfixes = new Patch[0];

		public Patch[] transpilers = new Patch[0];

		public Patch[] finalizers = new Patch[0];

		public Patch[] ilmanipulators = new Patch[0];

		public bool Debugging
		{
			get
			{
				if (!prefixes.Any((Patch p) => p.debug) && !postfixes.Any((Patch p) => p.debug) && !transpilers.Any((Patch p) => p.debug) && !finalizers.Any((Patch p) => p.debug))
				{
					return ilmanipulators.Any((Patch p) => p.debug);
				}
				return true;
			}
		}

		public string[] DebugEmitPaths => (from p in prefixes.Concat(postfixes).Concat(transpilers).Concat(finalizers)
				.Concat(ilmanipulators)
			select p.debugEmitPath into p
			where p != null
			select p).ToArray();

		internal void AddPrefixes(string owner, params HarmonyMethod[] methods)
		{
			prefixes = Add(owner, methods, prefixes);
		}

		[Obsolete("This method only exists for backwards compatibility since the class is public.")]
		public void AddPrefix(MethodInfo patch, string owner, int priority, string[] before, string[] after, bool debug)
		{
			AddPrefixes(owner, new HarmonyMethod(patch, priority, before, after, debug));
		}

		public void RemovePrefix(string owner)
		{
			prefixes = Remove(owner, prefixes);
		}

		internal void AddPostfixes(string owner, params HarmonyMethod[] methods)
		{
			postfixes = Add(owner, methods, postfixes);
		}

		[Obsolete("This method only exists for backwards compatibility since the class is public.")]
		public void AddPostfix(MethodInfo patch, string owner, int priority, string[] before, string[] after, bool debug)
		{
			AddPostfixes(owner, new HarmonyMethod(patch, priority, before, after, debug));
		}

		public void RemovePostfix(string owner)
		{
			postfixes = Remove(owner, postfixes);
		}

		internal void AddTranspilers(string owner, params HarmonyMethod[] methods)
		{
			transpilers = Add(owner, methods, transpilers);
		}

		[Obsolete("This method only exists for backwards compatibility since the class is public.")]
		public void AddTranspiler(MethodInfo patch, string owner, int priority, string[] before, string[] after, bool debug)
		{
			AddTranspilers(owner, new HarmonyMethod(patch, priority, before, after, debug));
		}

		public void RemoveTranspiler(string owner)
		{
			transpilers = Remove(owner, transpilers);
		}

		internal void AddFinalizers(string owner, params HarmonyMethod[] methods)
		{
			finalizers = Add(owner, methods, finalizers);
		}

		[Obsolete("This method only exists for backwards compatibility since the class is public.")]
		public void AddFinalizer(MethodInfo patch, string owner, int priority, string[] before, string[] after, bool debug)
		{
			AddFinalizers(owner, new HarmonyMethod(patch, priority, before, after, debug));
		}

		public void RemoveFinalizer(string owner)
		{
			finalizers = Remove(owner, finalizers);
		}

		internal void AddILManipulators(string owner, params HarmonyMethod[] methods)
		{
			ilmanipulators = Add(owner, methods, ilmanipulators);
		}

		public void RemoveILManipulator(string owner)
		{
			ilmanipulators = Remove(owner, ilmanipulators);
		}

		public void RemovePatch(MethodInfo patch)
		{
			prefixes = prefixes.Where((Patch p) => (object)p.PatchMethod != patch).ToArray();
			postfixes = postfixes.Where((Patch p) => (object)p.PatchMethod != patch).ToArray();
			transpilers = transpilers.Where((Patch p) => (object)p.PatchMethod != patch).ToArray();
			finalizers = finalizers.Where((Patch p) => (object)p.PatchMethod != patch).ToArray();
			ilmanipulators = ilmanipulators.Where((Patch p) => (object)p.PatchMethod != patch).ToArray();
		}

		private static Patch[] Add(string owner, HarmonyMethod[] add, Patch[] current)
		{
			if (add.Length == 0)
			{
				return current;
			}
			int initialIndex = current.Length;
			return current.Concat(add.Where((HarmonyMethod method) => method != null).Select((HarmonyMethod method, int i) => new Patch(method, i + initialIndex, owner))).ToArray();
		}

		private static Patch[] Remove(string owner, Patch[] current)
		{
			if (!(owner == "*"))
			{
				return current.Where((Patch patch) => patch.owner != owner).ToArray();
			}
			return new Patch[0];
		}
	}
	[Serializable]
	public class Patch : IComparable
	{
		public readonly int index;

		public readonly string owner;

		public readonly int priority;

		public readonly string[] before;

		public readonly string[] after;

		public readonly bool debug;

		public readonly string debugEmitPath;

		public readonly bool wrapTryCatch;

		[NonSerialized]
		private MethodInfo patchMethod;

		private int methodToken;

		private string moduleGUID;

		public MethodInfo PatchMethod
		{
			get
			{
				if ((object)patchMethod == null)
				{
					Module module = (from a in AppDomain.CurrentDomain.GetAssemblies()
						where !a.FullName.StartsWith("Microsoft.VisualStudio")
						select a).SelectMany((Assembly a) => a.GetLoadedModules()).First((Module m) => m.ModuleVersionId.ToString() == moduleGUID);
					patchMethod = (MethodInfo)module.ResolveMethod(methodToken);
				}
				return patchMethod;
			}
			set
			{
				patchMethod = value;
				methodToken = patchMethod.MetadataToken;
				moduleGUID = patchMethod.Module.ModuleVersionId.ToString();
			}
		}

		public Patch(MethodInfo patch, int index, string owner, int priority, string[] before, string[] after, bool debug)
		{
			if (patch is DynamicMethod)
			{
				throw new Exception("Cannot directly reference dynamic method \"" + patch.FullDescription() + "\" in Harmony. Use a factory method instead that will return the dynamic method.");
			}
			this.index = index;
			this.owner = owner;
			this.priority = ((priority == -1) ? 400 : priority);
			this.before = before ?? new string[0];
			this.after = after ?? new string[0];
			this.debug = debug;
			PatchMethod = patch;
		}

		public Patch(MethodInfo patch, int index, string owner, int priority, string[] before, string[] after, bool debug, bool wrapTryCatch)
		{
			if (patch is DynamicMethod)
			{
				throw new Exception("Cannot directly reference dynamic method \"" + patch.FullDescription() + "\" in Harmony. Use a factory method instead that will return the dynamic method.");
			}
			this.index = index;
			this.owner = owner;
			this.priority = ((priority == -1) ? 400 : priority);
			this.before = before ?? new string[0];
			this.after = after ?? new string[0];
			this.debug = debug;
			this.wrapTryCatch = wrapTryCatch;
			PatchMethod = patch;
		}

		public Patch(MethodInfo patch, int index, string owner, int priority, string[] before, string[] after, bool debug, bool wrapTryCatch, string debugEmitPath)
		{
			if (patch is DynamicMethod)
			{
				throw new Exception("Cannot directly reference dynamic method \"" + patch.FullDescription() + "\" in Harmony. Use a factory method instead that will return the dynamic method.");
			}
			this.index = index;
			this.owner = owner;
			this.priority = ((priority == -1) ? 400 : priority);
			this.before = before ?? new string[0];
			this.after = after ?? new string[0];
			this.debug = debug;
			this.debugEmitPath = debugEmitPath;
			this.wrapTryCatch = wrapTryCatch;
			PatchMethod = patch;
		}

		public Patch(HarmonyMethod method, int index, string owner)
			: this(method.method, index, owner, method.priority, method.before, method.after, method.debug.GetValueOrDefault(), method.wrapTryCatch.GetValueOrDefault(), method.debugEmitPath)
		{
		}

		public MethodInfo GetMethod(MethodBase original)
		{
			MethodInfo methodInfo = PatchMethod;
			if ((object)methodInfo.ReturnType != typeof(DynamicMethod) && (object)methodInfo.ReturnType != typeof(MethodInfo))
			{
				return methodInfo;
			}
			if (!methodInfo.IsStatic)
			{
				return methodInfo;
			}
			ParameterInfo[] parameters = methodInfo.GetParameters();
			if (parameters.Length != 1)
			{
				return methodInfo;
			}
			if ((object)parameters[0].ParameterType != typeof(MethodBase))
			{
				return methodInfo;
			}
			return methodInfo.Invoke(null, new object[1] { original }) as MethodInfo;
		}

		public override bool Equals(object obj)
		{
			if (obj != null && obj is Patch)
			{
				return (object)PatchMethod == ((Patch)obj).PatchMethod;
			}
			return false;
		}

		public int CompareTo(object obj)
		{
			return PatchInfoSerialization.PriorityComparer(obj, index, priority);
		}

		public override int GetHashCode()
		{
			return PatchMethod.GetHashCode();
		}
	}
	public class PatchClassProcessor
	{
		private readonly Harmony instance;

		private readonly Type containerType;

		private readonly HarmonyMethod containerAttributes;

		private readonly Dictionary<Type, MethodInfo> auxilaryMethods;

		private readonly List<AttributePatch> patchMethods;

		private static readonly List<Type> auxilaryTypes = new List<Type>
		{
			typeof(HarmonyPrepare),
			typeof(HarmonyCleanup),
			typeof(HarmonyTargetMethod),
			typeof(HarmonyTargetMethods)
		};

		public PatchClassProcessor(Harmony instance, Type type)
			: this(instance, type, allowUnannotatedType: false)
		{
		}

		public PatchClassProcessor(Harmony instance, Type type, bool allowUnannotatedType)
		{
			if (instance == null)
			{
				throw new ArgumentNullException("instance");
			}
			if ((object)type == null)
			{
				throw new ArgumentNullException("type");
			}
			this.instance = instance;
			containerType = type;
			List<HarmonyMethod> fromType = HarmonyMethodExtensions.GetFromType(type);
			if (!allowUnannotatedType && (fromType == null || fromType.Count == 0))
			{
				return;
			}
			containerAttributes = HarmonyMethod.Merge(fromType);
			MethodType? methodType = containerAttributes.methodType;
			if (!methodType.HasValue)
			{
				containerAttributes.methodType = MethodType.Normal;
			}
			auxilaryMethods = new Dictionary<Type, MethodInfo>();
			foreach (Type auxilaryType in auxilaryTypes)
			{
				MethodInfo patchMethod = PatchTools.GetPatchMethod(containerType, auxilaryType.FullName);
				if ((object)patchMethod != null)
				{
					auxilaryMethods[auxilaryType] = patchMethod;
				}
			}
			patchMethods = PatchTools.GetPatchMethods(containerType, (object)containerAttributes.GetDeclaringType() != null);
			foreach (AttributePatch patchMethod2 in patchMethods)
			{
				MethodInfo method = patchMethod2.info.method;
				patchMethod2.info = containerAttributes.Merge(patchMethod2.info);
				patchMethod2.info.method = method;
			}
		}

		public List<MethodInfo> Patch()
		{
			if (containerAttributes == null)
			{
				return null;
			}
			Exception exception = null;
			if (!RunMethod<HarmonyPrepare, bool>(defaultIfNotExisting: true, defaultIfFailing: false, null, new object[0]))
			{
				RunMethod<HarmonyCleanup>(ref exception, new object[0]);
				ReportException(exception, null);
				return new List<MethodInfo>();
			}
			List<MethodInfo> result = new List<MethodInfo>();
			MethodBase lastOriginal = null;
			try
			{
				List<MethodBase> bulkMethods = GetBulkMethods();
				if (bulkMethods.Count == 1)
				{
					lastOriginal = bulkMethods[0];
				}
				ReversePatch(ref lastOriginal);
				result = ((bulkMethods.Count > 0) ? BulkPatch(bulkMethods, ref lastOriginal) : PatchWithAttributes(ref lastOriginal));
			}
			catch (Exception ex)
			{
				exception = ex;
			}
			RunMethod<HarmonyCleanup>(ref exception, new object[1] { exception });
			ReportException(exception, lastOriginal);
			return result;
		}

		private void ReversePatch(ref MethodBase lastOriginal)
		{
			for (int i = 0; i < patchMethods.Count; i++)
			{
				AttributePatch attributePatch = patchMethods[i];
				if (attributePatch.type == HarmonyPatchType.ReversePatch)
				{
					MethodBase originalMethod = attributePatch.info.GetOriginalMethod();
					if ((object)originalMethod != null)
					{
						lastOriginal = originalMethod;
					}
					ReversePatcher reversePatcher = instance.CreateReversePatcher(lastOriginal, attributePatch.info);
					lock (PatchProcessor.locker)
					{
						reversePatcher.Patch();
					}
				}
			}
		}

		private List<MethodInfo> BulkPatch(List<MethodBase> originals, ref MethodBase lastOriginal)
		{
			PatchJobs<MethodInfo> patchJobs = new PatchJobs<MethodInfo>();
			for (int i = 0; i < originals.Count; i++)
			{
				lastOriginal = originals[i];
				PatchJobs<MethodInfo>.Job job = patchJobs.GetJob(lastOriginal);
				foreach (AttributePatch patchMethod in patchMethods)
				{
					string text = "You cannot combine TargetMethod, TargetMethods or [HarmonyPatchAll] with individual annotations";
					HarmonyMethod info = patchMethod.info;
					if (info.methodName != null)
					{
						throw new ArgumentException(text + " [" + info.methodName + "]");
					}
					if (info.methodType.HasValue && info.methodType.Value != 0)
					{
						throw new ArgumentException($"{text} [{info.methodType}]");
					}
					if (info.argumentTypes != null)
					{
						throw new ArgumentException(text + " [" + info.argumentTypes.Description() + "]");
					}
					job.AddPatch(patchMethod);
				}
			}
			foreach (PatchJobs<MethodInfo>.Job job2 in patchJobs.GetJobs())
			{
				lastOriginal = job2.original;
				ProcessPatchJob(job2);
			}
			return patchJobs.GetReplacements();
		}

		private List<MethodInfo> PatchWithAttributes(ref MethodBase lastOriginal)
		{
			PatchJobs<MethodInfo> patchJobs = new PatchJobs<MethodInfo>();
			foreach (AttributePatch patchMethod in patchMethods)
			{
				lastOriginal = patchMethod.info.GetOriginalMethod();
				if ((object)lastOriginal == null)
				{
					throw new ArgumentException("Undefined target method for patch method " + patchMethod.info.method.FullDescription());
				}
				patchJobs.GetJob(lastOriginal).AddPatch(patchMethod);
			}
			foreach (PatchJob

BestMod/bin/Debug/Assembly-CSharp.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using AmplifyColor;
using ExitGames.Client.Photon;
using InControl;
using Irc;
using Landfall.AI;
using Landfall.Network;
using Photon.Compression;
using Photon.Compression.HalfFloat;
using Photon.Compression.Internal;
using Photon.Pun;
using Photon.Pun.Simple;
using Photon.Pun.Simple.ContactGroups;
using Photon.Pun.Simple.Internal;
using Photon.Pun.Simple.Pooling;
using Photon.Realtime;
using Photon.Utilities;
using Sirenix.OdinInspector;
using Sonigon;
using Sonigon.Internal;
using SoundImplementation;
using Steamworks;
using TMPro;
using UnityEngine;
using UnityEngine.Analytics;
using UnityEngine.Audio;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.UI;
using UnityEngine.UI.ProceduralImage;
using UnityEngine.XR;
using emotitron;
using emotitron.Compression;
using emotitron.Utilities;
using emotitron.Utilities.GUIUtilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
public class Platform
{
	private List<BoxCollider2D> m_boxColliders = new List<BoxCollider2D>();

	private List<Vector2> m_platformPoints = new List<Vector2>();

	public List<Vector2> m_edges = new List<Vector2>();

	private static float EPSILON = Mathf.Epsilon * 10f;

	private int m_lastCalculatedClosestPoint = -1;

	public List<BoxCollider2D> BoxColliders => m_boxColliders;

	public List<Vector2> PlatformPoints
	{
		get
		{
			return m_platformPoints;
		}
		set
		{
			m_platformPoints = value;
		}
	}

	public List<Vector2> Edges => m_edges;

	public Color Color { get; set; }

	public Platform()
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		Color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
	}

	public bool ContainsCollider(BoxCollider2D collider)
	{
		foreach (BoxCollider2D boxCollider in m_boxColliders)
		{
			if ((Object)(object)collider == (Object)(object)boxCollider)
			{
				return true;
			}
		}
		return false;
	}

	public void AddCollider(BoxCollider2D collider)
	{
		m_boxColliders.Add(collider);
	}

	public void AddPlatformPoint(Vector2 point)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		m_platformPoints.Add(point);
	}

	public float GetClosestDistance(Vector2 position)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		float num = float.MaxValue;
		for (int i = 0; i < m_edges.Count; i++)
		{
			float num2 = Vector2.Distance(position, m_edges[i]);
			if (num2 < num)
			{
				m_lastCalculatedClosestPoint = i;
				num = num2;
			}
		}
		return num;
	}

	public bool IsPositionOutsidePlatform(Vector2 position)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = m_edges[m_lastCalculatedClosestPoint];
		if (position.x > val.x && m_lastCalculatedClosestPoint == m_edges.Count - 1)
		{
			return true;
		}
		if (position.x < val.x && m_lastCalculatedClosestPoint == 0)
		{
			return true;
		}
		return false;
	}

	public Vector2 GetPointOnPath(Vector2 position)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: 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_00a6: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: 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_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = m_edges[m_lastCalculatedClosestPoint];
		if (position.x > val.x && m_lastCalculatedClosestPoint == m_edges.Count - 1)
		{
			return val;
		}
		if (position.x < val.x && m_lastCalculatedClosestPoint == 0)
		{
			return val;
		}
		int index = -1;
		int num = 0;
		if (position.x > val.x)
		{
			index = m_lastCalculatedClosestPoint + 1;
			num = 1;
		}
		else if (position.x <= val.x)
		{
			index = m_lastCalculatedClosestPoint - 1;
			num = -1;
		}
		if (num == 1)
		{
			return GetClosestPointOnLineSegment(val, m_edges[index], position);
		}
		return GetClosestPointOnLineSegment(m_edges[index], val, position);
	}

	private Vector2 Project(Vector2 line1, Vector2 line2, Vector2 toProject)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: 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_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: 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_0054: 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)
		float num = (line2.y - line1.y) / (line2.x - line1.x);
		float num2 = line1.y - num * line1.x;
		float num3 = (num * toProject.y + toProject.x - num * num2) / (num * num + 1f);
		float num4 = (num * num * toProject.y + num * toProject.x + num2) / (num * num + 1f);
		return new Vector2(num3, num4);
	}

	public static Vector2 GetClosestPointOnLineSegment(Vector2 A, Vector2 B, Vector2 P)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: 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_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = P - A;
		Vector2 val2 = B - A;
		float sqrMagnitude = ((Vector2)(ref val2)).sqrMagnitude;
		float num = Vector2.Dot(val, val2) / sqrMagnitude;
		if (num < 0f)
		{
			return A;
		}
		if (num > 1f)
		{
			return B;
		}
		return A + val2 * num;
	}

	public void PostProcessPlatformPoints()
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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)
		int mask = LayerMask.GetMask(new string[1] { "Default" });
		List<Vector2> list = new List<Vector2>(m_platformPoints.OrderBy((Vector2 v) => v.x).ToArray());
		new HashSet<int>();
		for (int num = list.Count - 1; num > 0; num--)
		{
			if ((Object)(object)Physics2D.OverlapCircle(list[num] + new Vector2(0f, 0.25f), 0.2f, mask) != (Object)null)
			{
				list.RemoveAt(num);
			}
		}
		m_platformPoints = list;
		DetectEdges();
	}

	public void DetectEdges()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		if (m_platformPoints.Count == 0)
		{
			return;
		}
		List<Vector2> list = new List<Vector2>();
		for (int i = 0; i < m_platformPoints.Count - 2; i++)
		{
			Vector2 val = m_platformPoints[i];
			Vector2 val2 = m_platformPoints[i + 1];
			if (i == 0)
			{
				list.Add(val);
			}
			else if (i == m_platformPoints.Count - 3)
			{
				list.Add(val2);
			}
			else if (val2.y - val.y > Mathf.Epsilon)
			{
				list.Add(val);
				list.Add(val2);
			}
		}
		m_edges = list;
	}

	public void DrawGizmos()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: 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_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		Gizmos.color = Color;
		for (int i = 0; i < m_edges.Count; i++)
		{
			Gizmos.DrawSphere(Vector2.op_Implicit(m_edges[i]), 0.2f);
		}
		for (int j = 0; j < m_edges.Count - 1; j++)
		{
			Gizmos.DrawLine(Vector2.op_Implicit(m_edges[j]), Vector2.op_Implicit(m_edges[j + 1]));
		}
	}
}
public class BrodalAIController : MonoBehaviour
{
	private PlayerAPI m_playerAPI;

	private int m_sampleCount = 250;

	private float m_sampleSize;

	private LayerMask m_layerMask;

	private Dictionary<Guid, Platform> m_platforms = new Dictionary<Guid, Platform>();

	private Platform m_currentPlatform;

	private Vector2 m_pointOnLine;

	private bool inited;

	private void Start()
	{
		m_playerAPI = ((Component)this).GetComponentInParent<PlayerAPI>();
		HealthHandler healthHandler = m_playerAPI.player.data.healthHandler;
		healthHandler.delayedReviveAction = (Action)Delegate.Combine(healthHandler.delayedReviveAction, new Action(Init));
	}

	public void Init()
	{
		m_platforms.Clear();
		m_currentPlatform = null;
		PlotPlatforms();
		RaycastMap();
		PostProcessPlatforms();
		inited = true;
		Debug.Log("Revived");
	}

	private void PostProcessPlatforms()
	{
		foreach (KeyValuePair<Guid, Platform> platform in m_platforms)
		{
			platform.Value.PostProcessPlatformPoints();
		}
	}

	private void PlotPlatforms()
	{
		//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_007e: Unknown result type (might be due to invalid IL or missing references)
		BoxCollider2D[] array = Object.FindObjectsOfType<BoxCollider2D>();
		foreach (BoxCollider2D val in array)
		{
			if (((Component)val).gameObject.layer == LayerMask.GetMask(new string[1] { "Player" }))
			{
				continue;
			}
			bool flag = false;
			foreach (KeyValuePair<Guid, Platform> platform in m_platforms)
			{
				foreach (BoxCollider2D boxCollider in platform.Value.BoxColliders)
				{
					bool flag2 = false;
					Bounds bounds = ((Collider2D)val).bounds;
					if (((Bounds)(ref bounds)).Intersects(((Collider2D)boxCollider).bounds))
					{
						flag2 = true;
					}
					if (flag2)
					{
						m_platforms[platform.Key].AddCollider(val);
						flag = true;
						break;
					}
				}
				if (flag)
				{
					break;
				}
			}
			if (!flag)
			{
				Guid key = Guid.NewGuid();
				m_platforms.Add(key, new Platform());
				m_platforms[key].AddCollider(val);
			}
		}
	}

	private void MergePlatforms()
	{
	}

	private void RaycastMap()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: 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_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: 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)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Expected O, but got Unknown
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		m_layerMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Default" }));
		Camera component = ((Component)((Component)MainCam.instance).transform).GetComponent<Camera>();
		Vector3 val = component.ViewportToWorldPoint(Vector2.op_Implicit(new Vector2(0f, 1f)));
		Vector3 val2 = component.ViewportToWorldPoint(Vector2.op_Implicit(new Vector2(1f, 1f)));
		m_sampleSize = (val2.x - val.x) / (float)m_sampleCount;
		for (float num = val.x; num < val2.x; num += m_sampleSize)
		{
			RaycastHit2D[] array = Physics2D.RaycastAll(Vector2.op_Implicit(new Vector3(num, val.y, 0f)), Vector2.down, 9999f, LayerMask.op_Implicit(m_layerMask));
			for (int i = 0; i < array.Length; i++)
			{
				RaycastHit2D val3 = array[i];
				foreach (KeyValuePair<Guid, Platform> platform in m_platforms)
				{
					if (platform.Value.ContainsCollider((BoxCollider2D)((RaycastHit2D)(ref val3)).collider))
					{
						m_platforms[platform.Key].AddPlatformPoint(((RaycastHit2D)(ref val3)).point);
						break;
					}
				}
			}
		}
	}

	private void Update()
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: 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_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: 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_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: 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_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: 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_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: 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)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: 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)
		//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_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		if (inited)
		{
			FindClosestPlatform(Vector2.op_Implicit(((Component)this).transform.position));
			Vector2 val = Vector2.op_Implicit(m_playerAPI.OtherPlayerPosition() - ((Component)this).transform.position);
			float magnitude = ((Vector2)(ref val)).magnitude;
			((Vector2)(ref val)).Normalize();
			Vector2 val2 = val + new Vector2(0f, 0.15f);
			Vector2 normalized = ((Vector2)(ref val2)).normalized;
			m_playerAPI.SetAimDirection(normalized);
			Vector2 position = new Vector2(((Component)this).transform.position.x, ((Component)this).transform.position.y) + val * 1.5f;
			bool num = m_currentPlatform.IsPositionOutsidePlatform(position);
			m_playerAPI.Move(m_playerAPI.TowardsOtherPlayer());
			if (num)
			{
				m_playerAPI.Jump();
			}
			val.y = 0f;
			((Vector2)(ref val)).Normalize();
			RaycastHit2D val3 = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), val, 0.85f, LayerMask.op_Implicit(m_layerMask));
			RaycastHit2D val4 = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), val, magnitude, LayerMask.op_Implicit(m_layerMask));
			if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val3)).collider))
			{
				m_playerAPI.Jump();
			}
			if ((Object)(object)((RaycastHit2D)(ref val4)).collider == (Object)null)
			{
				m_playerAPI.Attack();
			}
			m_playerAPI.Block();
		}
	}

	private void FindClosestPlatform(Vector2 position)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		float num = float.MaxValue;
		foreach (KeyValuePair<Guid, Platform> platform in m_platforms)
		{
			float closestDistance = platform.Value.GetClosestDistance(position);
			if (closestDistance < num)
			{
				m_currentPlatform = platform.Value;
				num = closestDistance;
			}
		}
	}
}
public class Accelerate : MonoBehaviour
{
	private MoveTransform move;

	public float startMultiplier = 0.5f;

	public float acceleratonPerSecond = 2f;

	public float pow = 1f;

	private void Start()
	{
		move = ((Component)this).GetComponentInParent<MoveTransform>();
		move.multiplier *= startMultiplier;
		move.multiplier = Mathf.Clamp(move.multiplier, 0.01f, float.PositiveInfinity);
	}

	private void Update()
	{
		move.multiplier = Mathf.Clamp(move.multiplier + TimeHandler.deltaTime * acceleratonPerSecond * Mathf.Pow(move.multiplier, pow), 0f, 25f);
	}
}
public class ActivateSciptWhenCanSeeOtherPlayer : MonoBehaviour
{
	public enum Target
	{
		OtherPlayer,
		Closest
	}

	public Target target;

	private SpawnedAttack spawned;

	public MonoBehaviour script;

	private void Start()
	{
		spawned = ((Component)this).GetComponentInParent<SpawnedAttack>();
	}

	private void Update()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		Player player = null;
		player = ((target != 0) ? PlayerManager.instance.GetClosestPlayer(Vector2.op_Implicit(((Component)this).transform.position), needVision: true) : PlayerManager.instance.GetOtherPlayer(spawned.spawner));
		if (Object.op_Implicit((Object)(object)player))
		{
			if (PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), player).canSee)
			{
				((Behaviour)script).enabled = true;
			}
			else
			{
				((Behaviour)script).enabled = false;
			}
		}
		else
		{
			((Behaviour)script).enabled = false;
		}
	}
}
public class AddShake : MonoBehaviour
{
	public Vector2 shake;

	public bool auto = true;

	public bool inheritScale;

	public float max = float.PositiveInfinity;

	private void Start()
	{
		if (auto)
		{
			DoShake();
		}
	}

	public void DoShake()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: 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)
		GamefeelManager.GameFeel(shake * Mathf.Clamp(inheritScale ? ((Component)this).transform.localScale.x : 1f, 0f, max));
	}
}
public class Aim : MonoBehaviour
{
	private GeneralInput input;

	private HoldingObject holdingObject;

	private CharacterData data;

	private Vector3 aimDirection;

	private void Awake()
	{
		input = ((Component)this).GetComponent<GeneralInput>();
		data = ((Component)this).GetComponent<CharacterData>();
		holdingObject = ((Component)this).GetComponentInChildren<HoldingObject>();
	}

	private void Update()
	{
		//IL_0023: 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_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: 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_00ba: 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_00a4: 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)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		if ((double)((Vector3)(ref input.aimDirection)).magnitude > 0.2)
		{
			aimDirection = input.aimDirection;
		}
		if (((Vector3)(ref input.direction)).magnitude > 0.2f && Optionshandler.leftStickAim && input.aimDirection == Vector3.zero)
		{
			aimDirection = input.direction;
		}
		if (Object.op_Implicit((Object)(object)holdingObject))
		{
			if (aimDirection != Vector3.zero)
			{
				((Component)holdingObject).transform.rotation = Quaternion.LookRotation(aimDirection);
			}
			data.aimDirection = aimDirection;
		}
	}
}
public class AimForPlayer : MonoBehaviour
{
	public enum Target
	{
		OtherPlayer,
		Closest
	}

	public float upOffset;

	public Target target;

	private SpawnedAttack spawned;

	private void Start()
	{
		spawned = ((Component)this).GetComponentInParent<SpawnedAttack>();
	}

	private void Update()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		Player player = null;
		player = ((target != 0) ? PlayerManager.instance.GetClosestPlayer(Vector2.op_Implicit(((Component)this).transform.position), needVision: true) : PlayerManager.instance.GetOtherPlayer(spawned.spawner));
		if (Object.op_Implicit((Object)(object)player) && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), player).canSee)
		{
			((Component)this).transform.rotation = Quaternion.LookRotation(((Component)player).transform.position + Vector3.up * Vector3.Distance(((Component)player).transform.position, ((Component)this).transform.position) * 0.1f * upOffset - ((Component)this).transform.position, Vector3.forward);
		}
	}
}
public class ApplyCardStats : MonoBehaviour
{
	private Gun myGunStats;

	private CharacterStatModifiers myPlayerStats;

	private Block myBlock;

	private Player playerToUpgrade;

	private CardAudioModifier cardAudio;

	private bool done;

	private DamagableEvent damagable;

	public bool shootToPick;

	private void Start()
	{
		myGunStats = ((Component)this).GetComponent<Gun>();
		myPlayerStats = ((Component)this).GetComponent<CharacterStatModifiers>();
		myBlock = ((Component)this).GetComponentInChildren<Block>();
		cardAudio = ((Component)this).GetComponent<CardAudioModifier>();
		damagable = ((Component)this).GetComponentInChildren<DamagableEvent>();
	}

	private void Update()
	{
		if (shootToPick && damagable.dead && Object.op_Implicit((Object)(object)damagable.lastPlayer))
		{
			Pick(damagable.lastPlayer.teamID);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	[PunRPC]
	public void RPCA_Pick(int[] actorIDs)
	{
		for (int i = 0; i < actorIDs.Length; i++)
		{
			playerToUpgrade = PlayerManager.instance.GetPlayerWithActorID(actorIDs[i]);
			ApplyStats();
			CardBarHandler.instance.AddCard(playerToUpgrade.playerID, ((Component)this).GetComponent<CardInfo>().sourceCard);
		}
	}

	[PunRPC]
	public void OFFLINE_Pick(Player[] players)
	{
		for (int i = 0; i < players.Length; i++)
		{
			playerToUpgrade = players[i];
			ApplyStats();
			CardBarHandler.instance.AddCard(playerToUpgrade.playerID, ((Component)this).GetComponent<CardInfo>().sourceCard);
		}
	}

	public void Pick(int pickerID, bool forcePick = false, PickerType pickerType = PickerType.Team)
	{
		Start();
		if (done && !forcePick)
		{
			return;
		}
		done = true;
		Player[] array = PlayerManager.instance.GetPlayersInTeam(pickerID);
		if (pickerType == PickerType.Player)
		{
			array = new Player[1] { PlayerManager.instance.players[pickerID] };
		}
		if (PhotonNetwork.OfflineMode)
		{
			OFFLINE_Pick(array);
			return;
		}
		int[] array2 = new int[array.Length];
		for (int i = 0; i < array.Length; i++)
		{
			array2[i] = array[i].data.view.ControllerActorNr;
		}
		((Component)this).GetComponent<PhotonView>().RPC("RPCA_Pick", (RpcTarget)0, new object[1] { array2 });
	}

	private void ApplyStats()
	{
		//IL_02b2: 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)
		done = true;
		PlayerAudioModifyers component = ((Component)playerToUpgrade).GetComponent<PlayerAudioModifyers>();
		Gun component2 = ((Component)((Component)playerToUpgrade).GetComponent<Holding>().holdable).GetComponent<Gun>();
		Player component3 = ((Component)playerToUpgrade).GetComponent<Player>();
		CharacterData component4 = ((Component)playerToUpgrade).GetComponent<CharacterData>();
		HealthHandler component5 = ((Component)playerToUpgrade).GetComponent<HealthHandler>();
		((Component)playerToUpgrade).GetComponent<Movement>();
		Gravity component6 = ((Component)playerToUpgrade).GetComponent<Gravity>();
		Block component7 = ((Component)playerToUpgrade).GetComponent<Block>();
		CharacterStatModifiers component8 = ((Component)component3).GetComponent<CharacterStatModifiers>();
		GunAmmo componentInChildren = ((Component)component2).GetComponentInChildren<GunAmmo>();
		if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)myGunStats))
		{
			componentInChildren.ammoReg += myGunStats.ammoReg;
			componentInChildren.maxAmmo += myGunStats.ammo;
			componentInChildren.maxAmmo = Mathf.Clamp(componentInChildren.maxAmmo, 1, 90);
			componentInChildren.reloadTimeMultiplier *= myGunStats.reloadTime;
			componentInChildren.reloadTimeAdd += myGunStats.reloadTimeAdd;
		}
		component3.data.currentCards.Add(((Component)this).GetComponent<CardInfo>().sourceCard);
		if (Object.op_Implicit((Object)(object)myGunStats))
		{
			if (myGunStats.lockGunToDefault)
			{
				component2.defaultCooldown = myGunStats.forceSpecificAttackSpeed;
				component2.lockGunToDefault = myGunStats.lockGunToDefault;
			}
			if (Object.op_Implicit((Object)(object)myGunStats) && myGunStats.projectiles.Length != 0)
			{
				component2.projectiles[0].objectToSpawn = myGunStats.projectiles[0].objectToSpawn;
			}
			if (Object.op_Implicit((Object)(object)myGunStats))
			{
				CopyGunStats(myGunStats, component2);
			}
		}
		if (Object.op_Implicit((Object)(object)myPlayerStats))
		{
			component8.sizeMultiplier *= myPlayerStats.sizeMultiplier;
			component4.maxHealth *= myPlayerStats.health;
			component8.ConfigureMassAndSize();
			component8.movementSpeed *= myPlayerStats.movementSpeed;
			component8.jump *= myPlayerStats.jump;
			component4.jumps += myPlayerStats.numberOfJumps;
			component6.gravityForce *= myPlayerStats.gravity;
			component5.regeneration += myPlayerStats.regen;
			if (Object.op_Implicit((Object)(object)myPlayerStats.AddObjectToPlayer))
			{
				component8.objectsAddedToPlayer.Add(Object.Instantiate<GameObject>(myPlayerStats.AddObjectToPlayer, ((Component)component3).transform.position, ((Component)component3).transform.rotation, ((Component)component3).transform));
			}
			component8.lifeSteal += myPlayerStats.lifeSteal;
			component8.respawns += myPlayerStats.respawns;
			component8.secondsToTakeDamageOver += myPlayerStats.secondsToTakeDamageOver;
			if (myPlayerStats.refreshOnDamage)
			{
				component8.refreshOnDamage = true;
			}
			if (!myPlayerStats.automaticReload)
			{
				component8.automaticReload = false;
			}
		}
		if (Object.op_Implicit((Object)(object)myBlock))
		{
			if (myBlock.objectsToSpawn != null)
			{
				for (int i = 0; i < myBlock.objectsToSpawn.Count; i++)
				{
					component7.objectsToSpawn.Add(myBlock.objectsToSpawn[i]);
				}
			}
			component7.cdMultiplier *= myBlock.cdMultiplier;
			component7.cdAdd += myBlock.cdAdd;
			component7.forceToAdd += myBlock.forceToAdd;
			component7.forceToAddUp += myBlock.forceToAddUp;
			component7.additionalBlocks += myBlock.additionalBlocks;
			component7.healing += myBlock.healing;
			if (myBlock.autoBlock)
			{
				component7.autoBlock = myBlock.autoBlock;
			}
		}
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)cardAudio))
		{
			component.AddToStack(cardAudio);
		}
		component8.WasUpdated();
		component5.Revive();
	}

	public static void CopyGunStats(Gun copyFromGun, Gun copyToGun)
	{
		//IL_039e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_049c: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04db: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
		if (copyFromGun.unblockable)
		{
			copyToGun.unblockable = copyFromGun.unblockable;
		}
		if (copyFromGun.ignoreWalls)
		{
			copyToGun.ignoreWalls = copyFromGun.ignoreWalls;
		}
		float num = 1f;
		if (copyFromGun.numberOfProjectiles != 0 && copyToGun.numberOfProjectiles != 1)
		{
			num = (float)copyFromGun.numberOfProjectiles / ((float)copyFromGun.numberOfProjectiles + (float)copyToGun.numberOfProjectiles);
		}
		copyToGun.damage *= 1f - num * (1f - copyFromGun.damage);
		if (copyToGun.damage < 0.25f)
		{
			copyToGun.damage = 0.25f;
		}
		copyToGun.size += copyFromGun.size;
		float num2 = 1f;
		if (copyFromGun.chargeNumberOfProjectilesTo != 0f)
		{
			num2 = copyFromGun.chargeNumberOfProjectilesTo / (copyFromGun.chargeNumberOfProjectilesTo + copyToGun.chargeNumberOfProjectilesTo);
		}
		copyToGun.chargeDamageMultiplier *= 1f - num2 * (1f - copyFromGun.chargeDamageMultiplier);
		copyToGun.knockback *= 1f - num * (1f - copyFromGun.knockback);
		copyToGun.projectileSpeed *= copyFromGun.projectileSpeed;
		copyToGun.projectielSimulatonSpeed *= copyFromGun.projectielSimulatonSpeed;
		copyToGun.gravity *= copyFromGun.gravity;
		copyToGun.multiplySpread *= copyFromGun.multiplySpread;
		copyToGun.attackSpeed *= copyFromGun.attackSpeed;
		copyToGun.bodyRecoil *= copyFromGun.recoilMuiltiplier;
		copyToGun.speedMOnBounce *= copyFromGun.speedMOnBounce;
		copyToGun.dmgMOnBounce *= copyFromGun.dmgMOnBounce;
		copyToGun.bulletDamageMultiplier *= copyFromGun.bulletDamageMultiplier;
		copyToGun.spread += copyFromGun.spread;
		copyToGun.drag += copyFromGun.drag;
		copyToGun.timeBetweenBullets += copyFromGun.timeBetweenBullets;
		copyToGun.dragMinSpeed += copyFromGun.dragMinSpeed;
		copyToGun.evenSpread += copyFromGun.evenSpread;
		copyToGun.numberOfProjectiles += copyFromGun.numberOfProjectiles;
		copyToGun.reflects += copyFromGun.reflects;
		copyToGun.smartBounce += copyFromGun.smartBounce;
		copyToGun.bulletPortal += copyFromGun.bulletPortal;
		copyToGun.randomBounces += copyFromGun.randomBounces;
		copyToGun.bursts += copyFromGun.bursts;
		copyToGun.slow += copyFromGun.slow;
		copyToGun.overheatMultiplier += copyFromGun.overheatMultiplier;
		copyToGun.projectileSize += copyFromGun.projectileSize;
		copyToGun.percentageDamage += copyFromGun.percentageDamage;
		copyToGun.damageAfterDistanceMultiplier *= copyFromGun.damageAfterDistanceMultiplier;
		copyToGun.timeToReachFullMovementMultiplier *= copyFromGun.timeToReachFullMovementMultiplier;
		copyToGun.cos += copyFromGun.cos;
		if (copyFromGun.dontAllowAutoFire)
		{
			copyToGun.dontAllowAutoFire = true;
		}
		if (copyFromGun.destroyBulletAfter != 0f)
		{
			copyToGun.destroyBulletAfter = copyFromGun.destroyBulletAfter;
		}
		copyToGun.chargeSpreadTo += copyFromGun.chargeSpreadTo;
		copyToGun.chargeSpeedTo += copyFromGun.chargeSpeedTo;
		copyToGun.chargeEvenSpreadTo += copyFromGun.chargeEvenSpreadTo;
		copyToGun.chargeNumberOfProjectilesTo += copyFromGun.chargeNumberOfProjectilesTo;
		copyToGun.chargeRecoilTo += copyFromGun.chargeRecoilTo;
		if (copyFromGun.projectileColor != Color.black)
		{
			if (copyToGun.projectileColor == Color.black)
			{
				copyToGun.projectileColor = copyFromGun.projectileColor;
			}
			float num3 = Mathf.Pow((copyToGun.projectileColor.r * copyToGun.projectileColor.r + copyFromGun.projectileColor.r * copyFromGun.projectileColor.r) / 2f, 0.5f);
			float num4 = Mathf.Pow((copyToGun.projectileColor.g * copyToGun.projectileColor.g + copyFromGun.projectileColor.g * copyFromGun.projectileColor.g) / 2f, 0.5f);
			float num5 = Mathf.Pow((copyToGun.projectileColor.b * copyToGun.projectileColor.b + copyFromGun.projectileColor.b * copyFromGun.projectileColor.b) / 2f, 0.5f);
			Color val = new Color(num3, num4, num5, 1f);
			float num6 = 0f;
			float num7 = 0f;
			float num8 = 0f;
			Color.RGBToHSV(val, ref num6, ref num7, ref num8);
			num7 = 1f;
			num8 = 1f;
			copyToGun.projectileColor = Color.HSVToRGB(num6, num7, num8);
		}
		List<ObjectsToSpawn> list = new List<ObjectsToSpawn>();
		for (int i = 0; i < copyToGun.objectsToSpawn.Length; i++)
		{
			list.Add(copyToGun.objectsToSpawn[i]);
		}
		for (int j = 0; j < copyFromGun.objectsToSpawn.Length; j++)
		{
			bool flag = false;
			for (int k = 0; k < list.Count; k++)
			{
				if (Object.op_Implicit((Object)(object)list[k].effect) && Object.op_Implicit((Object)(object)copyFromGun.objectsToSpawn[j].effect))
				{
					if (((Object)list[k].effect).name == ((Object)copyFromGun.objectsToSpawn[j].effect).name && list[k].scaleStacks)
					{
						list[k].stacks++;
						flag = true;
					}
				}
				else if (Object.op_Implicit((Object)(object)list[k].AddToProjectile) && Object.op_Implicit((Object)(object)copyFromGun.objectsToSpawn[j].AddToProjectile) && ((Object)list[k].AddToProjectile).name == ((Object)copyFromGun.objectsToSpawn[j].AddToProjectile).name && list[k].scaleStacks)
				{
					list[k].stacks++;
					flag = true;
				}
			}
			if (!flag)
			{
				list.Add(copyFromGun.objectsToSpawn[j]);
			}
		}
		copyToGun.objectsToSpawn = list.ToArray();
		if (copyFromGun.useCharge)
		{
			copyToGun.useCharge = copyFromGun.useCharge;
		}
		copyToGun.soundGun.AddSoundShotModifier(copyFromGun.soundShotModifier);
		copyToGun.soundGun.AddSoundImpactModifier(copyFromGun.soundImpactModifier);
		copyToGun.soundGun.RefreshSoundModifiers();
	}
}
public class ArmRotator : MonoBehaviour
{
	public Vector3 rotation;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.localEulerAngles = rotation;
	}
}
[Serializable]
public class ArtInstance
{
	[FoldoutGroup("$profile", 0)]
	public PostProcessProfile profile;

	[FoldoutGroup("$profile", 0)]
	public ParticleSystem[] parts;

	public void TogglePart(bool on)
	{
		for (int i = 0; i < parts.Length; i++)
		{
			((Component)parts[i]).gameObject.SetActive(on);
			parts[i].Play();
		}
	}
}
public class ArtHandler : MonoBehaviour
{
	public ArtInstance[] arts;

	public PostProcessVolume volume;

	public static ArtHandler instance;

	private ColorGrading colorGrading;

	private int currentArt = -1;

	private void Awake()
	{
		instance = this;
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)304))
		{
			NextArt();
		}
	}

	public void NextArt()
	{
		for (int i = 0; i < arts.Length; i++)
		{
			arts[i].TogglePart(on: false);
		}
		int num = Random.Range(0, arts.Length);
		if (num >= arts.Length)
		{
			num = 0;
		}
		ApplyArt(arts[num]);
	}

	private void ApplyArt(ArtInstance art)
	{
		art.TogglePart(on: true);
		currentArt = GetArtID(art);
		volume.profile = art.profile;
	}

	public void SetSpecificArt(ArtInstance art)
	{
		ApplyArt(art);
	}

	public void ApplyPost(PostProcessProfile profileToSet)
	{
		volume.profile = profileToSet;
	}

	public void SetSpecificArt(string artName)
	{
		for (int i = 0; i < arts.Length; i++)
		{
			if (((Object)arts[i].profile).name == artName)
			{
				ApplyArt(arts[i]);
				break;
			}
		}
	}

	private int GetArtID(ArtInstance art)
	{
		int result = -1;
		for (int i = 0; i < arts.Length; i++)
		{
			if (art == arts[i])
			{
				result = i;
			}
		}
		return result;
	}
}
public class AttackLevel : MonoBehaviour
{
	public int attackLevel = 1;

	public float levelScaleM = 0.7f;

	public Action<int> LevelUpAction;

	private void Start()
	{
		SpawnedAttack componentInParent = ((Component)this).GetComponentInParent<SpawnedAttack>();
		if (Object.op_Implicit((Object)(object)componentInParent))
		{
			attackLevel = componentInParent.attackLevel;
		}
		bool flag = false;
		AttackLevel[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<AttackLevel>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			if (!((Object)(object)componentsInChildren[i] == (Object)(object)this) && ((Object)((Component)componentsInChildren[i]).gameObject).name == ((Object)((Component)this).gameObject).name)
			{
				componentsInChildren[i].LevelUp();
				flag = true;
			}
		}
		if (flag)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public float LevelScale()
	{
		return 1f + ((float)attackLevel - 1f) * levelScaleM;
	}

	public int LevelsUp()
	{
		return attackLevel - 1;
	}

	public void LevelUp()
	{
		attackLevel++;
		if (LevelUpAction != null)
		{
			LevelUpAction(attackLevel);
		}
	}
}
public class AttackTrigger : MonoBehaviour
{
	public bool triggerOnEveryShot = true;

	public UnityEvent triggerEvent;

	private CharacterData data;

	private void Start()
	{
		data = ((Component)this).GetComponentInParent<CharacterData>();
		Gun gun = data.weaponHandler.gun;
		gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, new Action<GameObject>(Shoot));
		data.weaponHandler.gun.AddAttackAction(Attack);
	}

	private void OnDestroy()
	{
		Gun gun = data.weaponHandler.gun;
		gun.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(gun.ShootPojectileAction, new Action<GameObject>(Shoot));
		data.weaponHandler.gun.RemoveAttackAction(Attack);
	}

	public void Attack()
	{
		if (!triggerOnEveryShot)
		{
			triggerEvent.Invoke();
		}
	}

	public void Shoot(GameObject projectile)
	{
		if (triggerOnEveryShot)
		{
			triggerEvent.Invoke();
		}
	}
}
public class Background : MonoBehaviour
{
	private ParticleSystem[] parts;

	private bool hasBeenInitiated;

	private void Init()
	{
		parts = ((Component)this).GetComponentsInChildren<ParticleSystem>();
		hasBeenInitiated = true;
	}

	public void ToggleBackground(bool on)
	{
		if (!hasBeenInitiated)
		{
			Init();
		}
		for (int i = 0; i < parts.Length; i++)
		{
			if (on)
			{
				parts[i].Play();
			}
			else
			{
				parts[i].Stop();
			}
		}
	}
}
public class BackgroundHandler : MonoBehaviour
{
	private Background[] backgrounds;

	private float untilSwitch;

	private void Start()
	{
		backgrounds = ((Component)this).GetComponentsInChildren<Background>(true);
	}

	private void Update()
	{
		untilSwitch -= TimeHandler.deltaTime;
		if (untilSwitch < 0f)
		{
			SwitchBackground();
		}
	}

	private void SwitchBackground()
	{
		untilSwitch = Random.Range(30, 60);
		for (int i = 0; i < backgrounds.Length; i++)
		{
			backgrounds[i].ToggleBackground(on: false);
		}
		((MonoBehaviour)this).StartCoroutine(StartBackGroundSoon());
	}

	private IEnumerator StartBackGroundSoon()
	{
		yield return (object)new WaitForSeconds(5f);
		backgrounds[Random.Range(0, backgrounds.Length)].ToggleBackground(on: true);
	}
}
public class BeamAttack : MonoBehaviour
{
	public float selfHeal;

	public float damage = 8f;

	public float force = 2500f;

	public float scalingForce;

	public float overTimeForce;

	public float overTimeScalingForce;

	public float overTimeDrag;

	public float effectOverTimeTime = 0.1f;

	public float interval = 0.2f;

	public float slow;

	public float maxSlow = 1f;

	public Color dmgColor;

	private Player attacker;

	private Player thisPlayer;

	private LineEffect[] lineEffects;

	private ParticleSystem[] parts;

	private CharacterStatModifiers stats;

	private float scaleMultiplier = 1f;

	private SpawnedAttack spawnedAttack;

	private float counter;

	private void Start()
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		lineEffects = ((Component)this).GetComponentsInChildren<LineEffect>(true);
		parts = ((Component)this).GetComponentsInChildren<ParticleSystem>();
		thisPlayer = ((Component)this).GetComponentInParent<Player>();
		stats = ((Component)thisPlayer).GetComponent<CharacterStatModifiers>();
		attacker = PlayerManager.instance.GetOtherPlayer(thisPlayer);
		scaleMultiplier = ((Component)this).transform.localScale.x;
		spawnedAttack = ((Component)this).GetComponentInParent<SpawnedAttack>();
		if ((Object)(object)thisPlayer == (Object)(object)spawnedAttack.spawner)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void Update()
	{
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: 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_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: 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_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)attacker) || !Object.op_Implicit((Object)(object)thisPlayer))
		{
			return;
		}
		counter += TimeHandler.deltaTime;
		if (!(counter > interval))
		{
			return;
		}
		CanSeeInfo canSeeInfo = PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)attacker).transform.position), thisPlayer);
		if (canSeeInfo.canSee)
		{
			Vector2 val = Vector2.op_Implicit(((Component)thisPlayer).transform.position - ((Component)attacker).transform.position);
			Vector2 normalized = ((Vector2)(ref val)).normalized;
			if (force != 0f)
			{
				thisPlayer.data.healthHandler.TakeForce(normalized * scaleMultiplier * force, (ForceMode2D)1);
			}
			if (scalingForce != 0f)
			{
				thisPlayer.data.healthHandler.TakeForce(val * scaleMultiplier * scalingForce, (ForceMode2D)1);
			}
			if (damage != 0f)
			{
				thisPlayer.data.healthHandler.TakeDamage(damage * scaleMultiplier * normalized, Vector2.op_Implicit(((Component)this).transform.position), dmgColor, null, attacker);
			}
			if (selfHeal != 0f)
			{
				attacker.data.healthHandler.Heal(selfHeal * scaleMultiplier);
			}
			for (int i = 0; i < lineEffects.Length; i++)
			{
				lineEffects[i].Play(((Component)attacker).transform, ((Component)thisPlayer).transform);
			}
			((MonoBehaviour)this).StartCoroutine(DoOverTimeEffects(attacker));
			if (slow > 0f && Object.op_Implicit((Object)(object)stats))
			{
				stats.AddSlowAddative(slow * scaleMultiplier, maxSlow);
			}
		}
		else
		{
			for (int j = 0; j < lineEffects.Length; j++)
			{
				lineEffects[j].Play(((Component)attacker).transform, Vector2.op_Implicit(canSeeInfo.hitPoint));
			}
			for (int k = 0; k < parts.Length; k++)
			{
				((Component)parts[k]).transform.position = Vector2.op_Implicit(canSeeInfo.hitPoint);
				((Component)parts[k]).transform.localScale = Vector3.one * scaleMultiplier;
				parts[k].Play();
			}
		}
		counter = 0f;
	}

	private IEnumerator DoOverTimeEffects(Player attacker)
	{
		float c = 0f;
		while (c < effectOverTimeTime)
		{
			c += TimeHandler.deltaTime;
			if (Object.op_Implicit((Object)(object)attacker) && Object.op_Implicit((Object)(object)thisPlayer))
			{
				Vector2 val = Vector2.op_Implicit(((Component)thisPlayer).transform.position - ((Component)attacker).transform.position);
				Vector2 normalized = ((Vector2)(ref val)).normalized;
				if (overTimeForce != 0f)
				{
					thisPlayer.data.healthHandler.TakeForce(normalized * scaleMultiplier * TimeHandler.deltaTime * overTimeForce, (ForceMode2D)1);
				}
				if (overTimeScalingForce != 0f)
				{
					thisPlayer.data.healthHandler.TakeForce(val * scaleMultiplier * TimeHandler.deltaTime * overTimeScalingForce, (ForceMode2D)0);
				}
				if (overTimeDrag > 0f)
				{
					thisPlayer.data.playerVel.AddForce(-thisPlayer.data.playerVel.velocity * Mathf.Clamp(TimeHandler.deltaTime * scaleMultiplier * overTimeDrag, 0f, 0.95f), (ForceMode2D)0);
				}
			}
			yield return null;
		}
	}
}
public static class BezierCurve
{
	public static Vector3 CubicBezier(Vector3 Start, Vector3 _P1, Vector3 _P2, Vector3 end, float _t)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: 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_001b: 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_0023: 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)
		return (1f - _t) * QuadraticBezier(Start, _P1, _P2, _t) + _t * QuadraticBezier(_P1, _P2, end, _t);
	}

	public static Vector3 QuadraticBezier(Vector3 start, Vector3 _P1, Vector3 end, float _t)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		return (1f - _t) * LinearBezier(start, _P1, _t) + _t * LinearBezier(_P1, end, _t);
	}

	public static Vector3 LinearBezier(Vector3 start, Vector3 end, float _t)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		return (1f - _t) * start + _t * end;
	}
}
public class Block : MonoBehaviour
{
	[Header("Sounds")]
	public SoundEvent soundBlockStart;

	public SoundEvent soundBlockRecharged;

	public SoundEvent soundBlockBlocked;

	public SoundEvent soundBlockStatusEffect;

	[Header("Settings")]
	public List<GameObject> objectsToSpawn = new List<GameObject>();

	public float sinceBlock;

	private GeneralInput input;

	public ParticleSystem particle;

	public ParticleSystem reloadParticle;

	public ParticleSystem blockedPart;

	public float cooldown;

	public float counter = 1000f;

	public float cdMultiplier = 1f;

	public float cdAdd;

	public float forceToAdd;

	public float forceToAddUp;

	public bool autoBlock;

	public bool blockedThisFrame;

	public int additionalBlocks;

	public float healing;

	private float timeBetweenBlocks = 0.2f;

	private CharacterData data;

	private HealthHandler health;

	private bool active = true;

	public Action BlockRechargeAction;

	private bool blockedLastFrame;

	public Action<BlockTrigger.BlockTriggerType> BlockAction;

	public Action<BlockTrigger.BlockTriggerType> BlockActionEarly;

	public Action<BlockTrigger.BlockTriggerType> FirstBlockActionThatDelaysOthers;

	public Action<BlockTrigger.BlockTriggerType> SuperFirstBlockAction;

	public Vector3 blockedAtPos;

	public bool delayOtherActions;

	public ParticleSystem statusBlockPart;

	private float lastStatusBlock;

	public Action<GameObject, Vector3, Vector3> BlockProjectileAction;

	public float Cooldown()
	{
		return (cooldown + cdAdd) * cdMultiplier;
	}

	private void Start()
	{
		input = ((Component)this).GetComponent<GeneralInput>();
		data = ((Component)this).GetComponent<CharacterData>();
		health = ((Component)this).GetComponent<HealthHandler>();
		sinceBlock = 100f;
	}

	private void Update()
	{
		if (Object.op_Implicit((Object)(object)input) && data.playerVel.simulated)
		{
			if (!blockedLastFrame)
			{
				blockedThisFrame = false;
			}
			blockedLastFrame = false;
			sinceBlock += TimeHandler.deltaTime;
			counter += TimeHandler.deltaTime;
			if (counter > Cooldown() && !active)
			{
				active = true;
				reloadParticle.Play();
				BlockRechargeAction();
				SoundManager.Instance.Play(soundBlockRecharged, ((Component)this).transform);
			}
			if (input.shieldWasPressed)
			{
				TryBlock();
			}
		}
	}

	public void DoBlockAtPosition(bool firstBlock, bool dontSetCD = false, BlockTrigger.BlockTriggerType triggerType = BlockTrigger.BlockTriggerType.Default, Vector3 blockPos = default(Vector3), bool onlyBlockEffects = false)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		blockedAtPos = blockPos;
		RPCA_DoBlock(firstBlock, dontSetCD, triggerType, blockPos, onlyBlockEffects);
	}

	internal void ResetStats()
	{
		objectsToSpawn = new List<GameObject>();
		sinceBlock = 10f;
		cooldown = 4f;
		counter = 1000f;
		cdMultiplier = 1f;
		cdAdd = 0f;
		forceToAdd = 0f;
		forceToAddUp = 0f;
		autoBlock = false;
		blockedThisFrame = false;
		additionalBlocks = 0;
		healing = 0f;
		delayOtherActions = false;
	}

	public void CallDoBlock(bool firstBlock, bool dontSetCD = false, BlockTrigger.BlockTriggerType triggerType = BlockTrigger.BlockTriggerType.Default, Vector3 useBlockPos = default(Vector3), bool onlyBlockEffects = false)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		data.view.RPC("RPCA_DoBlock", (RpcTarget)0, new object[5]
		{
			firstBlock,
			dontSetCD,
			(int)triggerType,
			useBlockPos,
			onlyBlockEffects
		});
	}

	[PunRPC]
	public void RPCA_DoBlock(bool firstBlock, bool dontSetCD = false, BlockTrigger.BlockTriggerType triggerType = BlockTrigger.BlockTriggerType.Default, Vector3 useBlockPos = default(Vector3), bool onlyBlockEffects = false)
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		if (triggerType == BlockTrigger.BlockTriggerType.Default && firstBlock)
		{
			for (int i = 0; i < additionalBlocks; i++)
			{
				((MonoBehaviour)this).StartCoroutine(DelayBlock(((float)i + 1f) * timeBetweenBlocks));
			}
		}
		((MonoBehaviour)this).StartCoroutine(IDoBlock(firstBlock, dontSetCD, triggerType, useBlockPos, onlyBlockEffects));
	}

	private IEnumerator IDoBlock(bool firstBlock, bool dontSetCD = false, BlockTrigger.BlockTriggerType triggerType = BlockTrigger.BlockTriggerType.Default, Vector3 useBlockPos = default(Vector3), bool onlyBlockEffects = false)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		active = false;
		Vector3 position = ((Component)this).transform.position;
		if (useBlockPos != Vector3.zero)
		{
			((Component)this).transform.position = useBlockPos;
		}
		if (SuperFirstBlockAction != null)
		{
			SuperFirstBlockAction(triggerType);
		}
		if (FirstBlockActionThatDelaysOthers != null)
		{
			FirstBlockActionThatDelaysOthers(triggerType);
		}
		if (useBlockPos != Vector3.zero)
		{
			((Component)this).transform.position = position;
		}
		if (!onlyBlockEffects)
		{
			sinceBlock = 0f;
		}
		if (delayOtherActions)
		{
			yield return (object)new WaitForSeconds(0.2f);
		}
		position = ((Component)this).transform.position;
		if (useBlockPos != Vector3.zero)
		{
			((Component)this).transform.position = useBlockPos;
		}
		if (BlockActionEarly != null)
		{
			BlockActionEarly(triggerType);
		}
		if (BlockAction != null)
		{
			BlockAction(triggerType);
		}
		if (firstBlock)
		{
			if (forceToAdd != 0f)
			{
				health.TakeForce(Vector2.op_Implicit(((Component)data.hand).transform.forward * forceToAdd * data.playerVel.mass * 0.01f), (ForceMode2D)1);
			}
			if (forceToAddUp != 0f)
			{
				health.TakeForce(Vector2.op_Implicit(Vector3.up * forceToAddUp * data.playerVel.mass * 0.01f), (ForceMode2D)1);
			}
		}
		blockedLastFrame = true;
		bool flag = false;
		for (int i = 0; i < data.currentCards.Count; i++)
		{
			if (data.currentCards[i].soundDisableBlockBasic)
			{
				flag = true;
				break;
			}
		}
		if (!flag && triggerType != BlockTrigger.BlockTriggerType.ShieldCharge)
		{
			SoundManager.Instance.Play(soundBlockStart, ((Component)this).transform);
		}
		if (!onlyBlockEffects)
		{
			particle.Play();
		}
		if (!dontSetCD)
		{
			counter = 0f;
		}
		Vector2 insideUnitCircle = Random.insideUnitCircle;
		GamefeelManager.GameFeel(((Vector2)(ref insideUnitCircle)).normalized * 1f);
		if (!onlyBlockEffects)
		{
			sinceBlock = 0f;
		}
		Spawn();
		health.Heal(healing);
		if (useBlockPos != Vector3.zero)
		{
			((Component)this).transform.position = position;
		}
	}

	public void ShowStatusEffectBlock()
	{
		if (!(Time.unscaledTime < lastStatusBlock + 0.25f) && data.view.IsMine)
		{
			lastStatusBlock = Time.unscaledTime;
			data.view.RPC("RPCA_ShowStatusEffectBlock", (RpcTarget)0, Array.Empty<object>());
		}
	}

	[PunRPC]
	public void RPCA_ShowStatusEffectBlock()
	{
		SoundManager.Instance.Play(soundBlockStatusEffect, ((Component)this).transform);
		statusBlockPart.Play();
	}

	public void TryBlock()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		if (!(counter < Cooldown()))
		{
			RPCA_DoBlock(firstBlock: true);
			counter = 0f;
		}
	}

	private IEnumerator DelayBlock(float t)
	{
		yield return (object)new WaitForSeconds(t);
		yield return (object)new WaitForEndOfFrame();
		RPCA_DoBlock(firstBlock: false, dontSetCD: true, BlockTrigger.BlockTriggerType.Echo);
	}

	public void Spawn()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < objectsToSpawn.Count; i++)
		{
			SpawnedAttack component = Object.Instantiate<GameObject>(objectsToSpawn[i], ((Component)this).transform.position, Quaternion.identity).GetComponent<SpawnedAttack>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.spawner = ((Component)this).GetComponent<Player>();
			}
		}
	}

	public void blocked(GameObject projectile, Vector3 forward, Vector3 hitPos)
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: 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_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: 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)
		SoundManager.Instance.Play(soundBlockBlocked, ((Component)this).transform);
		projectile.GetComponent<ProjectileHit>().RemoveOwnPlayerFromPlayersHit();
		projectile.GetComponent<ProjectileHit>().AddPlayerToHeld(((Component)this).GetComponent<HealthHandler>());
		MoveTransform component = projectile.GetComponent<MoveTransform>();
		component.velocity *= -1f;
		projectile.GetComponent<RayCastTrail>().WasBlocked();
		((Component)blockedPart).transform.position = hitPos + ((Component)this).transform.forward * 5f;
		((Component)blockedPart).transform.rotation = Quaternion.LookRotation(-forward * 1.5f);
		GamefeelManager.GameFeel(Vector2.op_Implicit(forward));
		blockedPart.Play();
		SpawnedAttack componentInParent = projectile.GetComponentInParent<SpawnedAttack>();
		if ((!Object.op_Implicit((Object)(object)componentInParent) || !((Object)(object)((Component)componentInParent.spawner).gameObject == (Object)(object)((Component)((Component)this).transform.root).gameObject)) && BlockProjectileAction != null)
		{
			BlockProjectileAction(projectile, forward, hitPos);
		}
	}

	public void ResetCD(bool soundPlay)
	{
		active = true;
		reloadParticle.Play();
		counter = Cooldown() + 1f;
		if (soundPlay)
		{
			SoundManager.Instance.Play(soundBlockRecharged, ((Component)this).transform);
		}
	}

	public bool TryBlockMe(GameObject toBlock, Vector3 forward, Vector3 hitPos)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		if (sinceBlock < 0.3f)
		{
			blocked(toBlock, forward, hitPos);
			sinceBlock = 0f;
			particle.Play();
			return true;
		}
		return false;
	}

	public void DoBlock(GameObject toBlock, Vector3 forward, Vector3 hitPos)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		sinceBlock = 0f;
		blocked(toBlock, forward, hitPos);
		particle.Play();
	}

	public bool IsBlocking()
	{
		if (sinceBlock < 0.3f)
		{
			ShowStatusEffectBlock();
		}
		return sinceBlock < 0.3f;
	}

	public bool IsOnCD()
	{
		return counter < Cooldown();
	}
}
public abstract class BlockEffect : MonoBehaviour
{
	public abstract void DoBlockedProjectile(GameObject projectile, Vector3 forward, Vector3 hitPos);
}
public class BlockEffectCounter : BlockEffect
{
	public int ownAttacksToSendBack;

	private SpawnObjectEffect spawn;

	private void Start()
	{
		spawn = ((Component)this).GetComponentInParent<SpawnObjectEffect>();
	}

	public override void DoBlockedProjectile(GameObject projectile, Vector3 forward, Vector3 hitPos)
	{
		//IL_000a: 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)
		for (int i = 0; i < ownAttacksToSendBack; i++)
		{
			spawn.DoEffect(Vector2.op_Implicit(forward));
		}
	}
}
public class BlockTrigger : MonoBehaviour
{
	public enum BlockTriggerType
	{
		Default,
		None,
		ShieldCharge,
		Echo,
		Empower
	}

	public UnityEvent triggerEvent;

	public UnityEvent triggerEventEarly;

	public bool delayOtherActions;

	public UnityEvent triggerFirstBlockThatDelaysOthers;

	public UnityEvent triggerSuperFirstBlock;

	public UnityEvent successfulBlockEvent;

	public UnityEvent blockRechargeEvent;

	private BlockEffect[] effects;

	public float cooldown;

	private float lastTriggerTime = -5f;

	public BlockTriggerType blackListedType = BlockTriggerType.None;

	public float cooldownSuccess;

	private float lastTriggerTimeSuccessful = -5f;

	private void Start()
	{
		effects = ((Component)this).GetComponents<BlockEffect>();
		Block componentInParent = ((Component)this).GetComponentInParent<Block>();
		componentInParent.SuperFirstBlockAction = (Action<BlockTriggerType>)Delegate.Combine(componentInParent.SuperFirstBlockAction, new Action<BlockTriggerType>(DoSuperFirstBlock));
		componentInParent.FirstBlockActionThatDelaysOthers = (Action<BlockTriggerType>)Delegate.Combine(componentInParent.FirstBlockActionThatDelaysOthers, new Action<BlockTriggerType>(DoFirstBlockThatDelaysOthers));
		componentInParent.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(componentInParent.BlockAction, new Action<BlockTriggerType>(DoBlock));
		componentInParent.BlockActionEarly = (Action<BlockTriggerType>)Delegate.Combine(componentInParent.BlockActionEarly, new Action<BlockTriggerType>(DoBlockEarly));
		componentInParent.BlockProjectileAction = (Action<GameObject, Vector3, Vector3>)Delegate.Combine(componentInParent.BlockProjectileAction, new Action<GameObject, Vector3, Vector3>(DoBlockedProjectile));
		componentInParent.BlockRechargeAction = (Action)Delegate.Combine(componentInParent.BlockRechargeAction, new Action(DoBlockRecharge));
		if (delayOtherActions)
		{
			((Component)this).GetComponentInParent<Block>().delayOtherActions = true;
		}
	}

	private void OnDestroy()
	{
		Block componentInParent = ((Component)this).GetComponentInParent<Block>();
		if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.SuperFirstBlockAction != null)
		{
			componentInParent.SuperFirstBlockAction = (Action<BlockTriggerType>)Delegate.Remove(componentInParent.SuperFirstBlockAction, new Action<BlockTriggerType>(DoSuperFirstBlock));
		}
		if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.FirstBlockActionThatDelaysOthers != null)
		{
			componentInParent.FirstBlockActionThatDelaysOthers = (Action<BlockTriggerType>)Delegate.Remove(componentInParent.FirstBlockActionThatDelaysOthers, new Action<BlockTriggerType>(DoFirstBlockThatDelaysOthers));
		}
		if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.BlockAction != null)
		{
			componentInParent.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(componentInParent.BlockAction, new Action<BlockTriggerType>(DoBlock));
		}
		if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.BlockActionEarly != null)
		{
			componentInParent.BlockActionEarly = (Action<BlockTriggerType>)Delegate.Remove(componentInParent.BlockActionEarly, new Action<BlockTriggerType>(DoBlockEarly));
		}
		if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.BlockProjectileAction != null)
		{
			componentInParent.BlockProjectileAction = (Action<GameObject, Vector3, Vector3>)Delegate.Remove(componentInParent.BlockProjectileAction, new Action<GameObject, Vector3, Vector3>(DoBlockedProjectile));
		}
		if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.BlockRechargeAction != null)
		{
			componentInParent.BlockRechargeAction = (Action)Delegate.Remove(componentInParent.BlockRechargeAction, new Action(DoBlockRecharge));
		}
	}

	public void DoSuperFirstBlock(BlockTriggerType triggerType)
	{
		if (triggerType != blackListedType && !(lastTriggerTime + cooldown > Time.time))
		{
			lastTriggerTime = Time.time;
			triggerSuperFirstBlock.Invoke();
		}
	}

	public void DoFirstBlockThatDelaysOthers(BlockTriggerType triggerType)
	{
		if (triggerType != blackListedType && !(lastTriggerTime + cooldown > Time.time))
		{
			lastTriggerTime = Time.time;
			triggerFirstBlockThatDelaysOthers.Invoke();
		}
	}

	public void DoBlockEarly(BlockTriggerType triggerType)
	{
		if (triggerType != blackListedType && !(lastTriggerTime + cooldown > Time.time))
		{
			lastTriggerTime = Time.time;
			triggerEventEarly.Invoke();
		}
	}

	public void DoBlock(BlockTriggerType triggerType)
	{
		if (triggerType != blackListedType && !(lastTriggerTime + cooldown > Time.time))
		{
			lastTriggerTime = Time.time;
			triggerEvent.Invoke();
		}
	}

	public void DoBlockedProjectile(GameObject projectile, Vector3 forward, Vector3 hitPos)
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		if (!(lastTriggerTimeSuccessful + cooldownSuccess > Time.time))
		{
			lastTriggerTimeSuccessful = Time.time;
			successfulBlockEvent.Invoke();
			for (int i = 0; i < effects.Length; i++)
			{
				effects[i].DoBlockedProjectile(projectile, forward, hitPos);
			}
		}
	}

	public void DoBlockRecharge()
	{
		blockRechargeEvent.Invoke();
	}
}
[ExecuteInEditMode]
public class BlurPost : MonoBehaviour
{
	[SerializeField]
	private Material postprocessMaterial;

	private void OnRenderImage(RenderTexture source, RenderTexture destination)
	{
		RenderTexture temporary = RenderTexture.GetTemporary(((Texture)source).width, ((Texture)source).height);
		Graphics.Blit((Texture)(object)source, temporary, postprocessMaterial, 0);
		Graphics.Blit((Texture)(object)temporary, destination, postprocessMaterial, 1);
		RenderTexture.ReleaseTemporary(temporary);
	}
}
public abstract class BounceEffect : MonoBehaviour
{
	public abstract void DoBounce(HitInfo hit);
}
public class BounceEffectRetarget : BounceEffect
{
	[Header("Sound")]
	public SoundEvent soundTargetBounceTargetPlayer;

	private MoveTransform move;

	private PhotonView view;

	private void Start()
	{
		view = ((Component)this).GetComponentInParent<PhotonView>();
		move = ((Component)this).GetComponentInParent<MoveTransform>();
		((Component)this).GetComponentInParent<ChildRPC>().childRPCsVector2.Add("TargetBounce", SetNewVel);
		((Component)this).GetComponentInParent<ChildRPC>().childRPCsInt.Add("TargetBounceLine", DrawLineTo);
	}

	public override void DoBounce(HitInfo hit)
	{
		((MonoBehaviour)this).StartCoroutine(DelayMove(hit));
	}

	private void ActuallyDoBounce(int playerId)
	{
		//IL_00d5: 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)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: 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)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		Player playerWithID = PlayerManager.instance.GetPlayerWithID(playerId);
		if (Object.op_Implicit((Object)(object)playerWithID))
		{
			ChildRPC componentInParent = ((Component)this).GetComponentInParent<ChildRPC>();
			Vector2 val = playerWithID.data.playerVel.position + Vector2.up * move.GetUpwardsCompensation(Vector2.op_Implicit(((Component)this).transform.position), playerWithID.data.playerVel.position) - Vector2.op_Implicit(((Component)this).transform.position);
			componentInParent.CallFunction("TargetBounce", ((Vector2)(ref val)).normalized * ((Vector3)(ref move.velocity)).magnitude);
			SoundManager.Instance.PlayAtPosition(soundTargetBounceTargetPlayer, SoundManager.Instance.GetTransform(), ((Component)this).transform);
		}
		else
		{
			((Component)this).GetComponentInParent<ChildRPC>().CallFunction("TargetBounce", Vector2.op_Implicit(move.velocity));
		}
	}

	private void SetNewVel(Vector2 newVel)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//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)
		((Behaviour)move).enabled = true;
		move.velocity = Vector2.op_Implicit(newVel);
	}

	private Player FindTarget(HitInfo hit)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		Player closestPlayer = PlayerManager.instance.GetClosestPlayer(Vector2.op_Implicit(((Component)this).transform.position + Vector2.op_Implicit(hit.normal) * 0.1f));
		if (PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), closestPlayer).canSee)
		{
			return closestPlayer;
		}
		return null;
	}

	private IEnumerator DelayMove(HitInfo hit)
	{
		Player p = FindTarget(hit);
		if (Object.op_Implicit((Object)(object)p) && view.IsMine)
		{
			((Component)this).GetComponentInParent<ChildRPC>().CallFunction("TargetBounceLine", p.playerID);
		}
		((Behaviour)move).enabled = false;
		if (Object.op_Implicit((Object)(object)hit.rigidbody))
		{
			((Component)move).GetComponent<RayCastTrail>().IgnoreRigFor(hit.rigidbody, 0.5f);
		}
		yield return (object)new WaitForSeconds(0.1f);
		if (view.IsMine)
		{
			if (Object.op_Implicit((Object)(object)p))
			{
				ActuallyDoBounce(p.playerID);
			}
			else
			{
				ActuallyDoBounce(-1);
			}
		}
	}

	private void DrawLineTo(int playerID)
	{
		Player playerWithID = PlayerManager.instance.GetPlayerWithID(playerID);
		if (Object.op_Implicit((Object)(object)playerWithID))
		{
			((MonoBehaviour)this).StartCoroutine(DrawLine(((Component)playerWithID).transform));
		}
	}

	private IEnumerator DrawLine(Transform target)
	{
		LineEffect line = ((Component)this).GetComponentInChildren<LineEffect>(true);
		line.StartDraw();
		while (Object.op_Implicit((Object)(object)line))
		{
			line.DrawLine(((Component)this).transform.position, target.position);
			yield return null;
		}
	}
}
public class BounceTrigger : MonoBehaviour
{
	private BounceEffect[] bounceEffects;

	private void Start()
	{
		bounceEffects = ((Component)this).GetComponents<BounceEffect>();
		RayHitReflect componentInParent = ((Component)this).GetComponentInParent<RayHitReflect>();
		componentInParent.reflectAction = (Action<HitInfo>)Delegate.Combine(componentInParent.reflectAction, new Action<HitInfo>(Reflect));
	}

	public void Reflect(HitInfo hit)
	{
		for (int i = 0; i < bounceEffects.Length; i++)
		{
			bounceEffects[i].DoBounce(hit);
		}
	}
}
public class BulletBase : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}
}
public class BulletSurf : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}
}
public class CameraZoomHandler : MonoBehaviour
{
	private Camera[] cameras;

	private void Start()
	{
		cameras = ((Component)this).GetComponentsInChildren<Camera>();
	}

	private void Update()
	{
		float num = 20f;
		if (MapManager.instance.currentMap != null)
		{
			num = MapManager.instance.currentMap.Map.size;
		}
		for (int i = 0; i < cameras.Length; i++)
		{
			cameras[i].orthographicSize = Mathf.Lerp(cameras[i].orthographicSize, num, Time.unscaledDeltaTime * 5f);
		}
	}
}
public class CappedDeltaTime : MonoBehaviour
{
	public static float time;

	private void Update()
	{
		time = Mathf.Clamp(TimeHandler.deltaTime, 0f, 0.02f);
	}
}
public class CardAudioModifier : MonoBehaviour
{
	public enum StackType
	{
		RTPCValue,
		PostEvent
	}

	public string stackName;

	public StackType stackType;
}
public class CardCategories : MonoBehaviour
{
}
[CreateAssetMenu(fileName = "Card Category", menuName = "Square Brawl/Card Category", order = 1)]
public class CardCategory : ScriptableObject
{
}
public class CardChoice : MonoBehaviour
{
	private enum StickDirection
	{
		Left,
		Right,
		None
	}

	public int pickrID = -1;

	public ArtInstance cardPickArt;

	private Transform[] children;

	public CardInfo[] cards;

	public int picks = 6;

	public static CardChoice instance;

	public bool IsPicking;

	private List<GameObject> spawnedCards = new List<GameObject>();

	public AnimationCurve curve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);

	private float speed = 4f;

	private bool isPlaying;

	private StickDirection lastStickDirection;

	private int currentlySelectedCard;

	private float counter = 1f;

	private PickerType pickerType;

	public CardThemeColor[] cardThemes;

	private void Awake()
	{
		instance = this;
	}

	private void Start()
	{
		for (int i = 0; i < cards.Length; i++)
		{
			PhotonNetwork.PrefabPool.RegisterPrefab(((Object)((Component)cards[i]).gameObject).name, ((Component)cards[i]).gameObject);
		}
		children = (Transform[])(object)new Transform[((Component)this).transform.childCount];
		for (int j = 0; j < children.Length; j++)
		{
			children[j] = ((Component)this).transform.GetChild(j);
		}
	}

	public CardInfo GetSourceCard(CardInfo info)
	{
		for (int i = 0; i < cards.Length; i++)
		{
			if (cards[i].cardName == info.cardName)
			{
				return cards[i];
			}
		}
		return null;
	}

	public void Pick(GameObject pickedCard = null, bool clear = false)
	{
		if (Object.op_Implicit((Object)(object)pickedCard))
		{
			pickedCard.GetComponentInChildren<ApplyCardStats>().Pick(pickrID, forcePick: false, pickerType);
			((Component)this).GetComponent<PhotonView>().RPC("RPCA_DoEndPick", (RpcTarget)0, new object[4]
			{
				CardIDs(),
				pickedCard.GetComponent<PhotonView>().ViewID,
				pickedCard.GetComponent<PublicInt>().theInt,
				pickrID
			});
		}
		else if (PlayerManager.instance.GetPlayerWithID(pickrID).data.view.IsMine)
		{
			((MonoBehaviour)this).StartCoroutine(ReplaceCards(pickedCard, clear));
		}
	}

	private int[] CardIDs()
	{
		int[] array = new int[spawnedCards.Count];
		for (int i = 0; i < spawnedCards.Count; i++)
		{
			array[i] = spawnedCards[i].GetComponent<PhotonView>().ViewID;
		}
		return array;
	}

	private List<GameObject> CardFromIDs(int[] cardIDs)
	{
		List<GameObject> list = new List<GameObject>();
		for (int i = 0; i < cardIDs.Length; i++)
		{
			list.Add(((Component)PhotonNetwork.GetPhotonView(cardIDs[i])).gameObject);
		}
		return list;
	}

	[PunRPC]
	private void RPCA_DoEndPick(int[] cardIDs, int targetCardID, int theInt = 0, int pickId = -1)
	{
		GameObject gameObject = ((Component)PhotonNetwork.GetPhotonView(targetCardID)).gameObject;
		spawnedCards = CardFromIDs(cardIDs);
		((MonoBehaviour)this).StartCoroutine(IDoEndPick(gameObject, theInt, pickId));
	}

	public IEnumerator IDoEndPick(GameObject pickedCard = null, int theInt = 0, int pickId = -1)
	{
		Vector3 startPos = pickedCard.transform.position;
		Vector3 endPos = ((Component)CardChoiceVisuals.instance).transform.position;
		float c2 = 0f;
		while (c2 < 1f)
		{
			CardChoiceVisuals.instance.framesToSnap = 1;
			Vector3 position = Vector3.LerpUnclamped(startPos, endPos, curve.Evaluate(c2));
			pickedCard.transform.position = position;
			((Component)this).transform.GetChild(theInt).position = position;
			c2 += Time.deltaTime * speed;
			yield return null;
		}
		Vector3 val = startPos - endPos;
		GamefeelManager.GameFeel(Vector2.op_Implicit(((Vector3)(ref val)).normalized * 2f));
		for (int i = 0; i < spawnedCards.Count; i++)
		{
			if (Object.op_Implicit((Object)(object)spawnedCards[i]))
			{
				if ((Object)(object)spawnedCards[i].gameObject != (Object)(object)pickedCard)
				{
					spawnedCards[i].AddComponent<Rigidbody>().AddForce((spawnedCards[i].transform.position - endPos) * Random.Range(0f, 50f));
					spawnedCards[i].GetComponent<Rigidbody>().AddTorque(Random.onUnitSphere * Random.Range(0f, 200f));
					spawnedCards[i].AddComponent<RemoveAfterSeconds>().seconds = Random.Range(0.5f, 1f);
					spawnedCards[i].GetComponent<RemoveAfterSeconds>().shrink = true;
				}
				else
				{
					spawnedCards[i].GetComponentInChildren<CardVisuals>().Leave();
				}
			}
		}
		yield return (object)new WaitForSeconds(0.25f);
		AnimationCurve softCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
		Vector3 startPos2 = ((Component)((Component)this).transform.GetChild(theInt)).transform.position;
		Vector3 endPos2 = startPos;
		c2 = 0f;
		while (c2 < 1f)
		{
			Vector3 position2 = Vector3.LerpUnclamped(startPos2, endPos2, softCurve.Evaluate(c2));
			((Component)this).transform.GetChild(theInt).position = position2;
			c2 += Time.deltaTime * speed * 1.5f;
			yield return null;
		}
		SoundPlayerStatic.Instance.PlayPlayerBallDisappear();
		((Component)this).transform.GetChild(theInt).position = startPos;
		spawnedCards.Clear();
		if (PlayerManager.instance.GetPlayerWithID(pickId).data.view.IsMine)
		{
			((MonoBehaviour)this).StartCoroutine(ReplaceCards(pickedCard));
		}
	}

	private GameObject Spawn(GameObject objToSpawn, Vector3 pos, Quaternion rot)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		return PhotonNetwork.Instantiate(GetCardPath(objToSpawn), pos, rot, (byte)0, (object[])null);
	}

	private string GetCardPath(GameObject targetObj)
	{
		return ((Object)targetObj).name;
	}

	public GameObject AddCard(CardInfo cardToSpawn)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Spawn(((Component)cardToSpawn).gameObject, new Vector3(30f, -10f, 0f), Quaternion.identity);
		spawnedCards.Add(val);
		return val;
	}

	public GameObject AddCardVisual(CardInfo cardToSpawn, Vector3 pos)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		GameObject obj = Object.Instantiate<GameObject>(((Component)cardToSpawn).gameObject, pos, Quaternion.identity);
		obj.GetComponentInChildren<CardVisuals>().firstValueToSet = true;
		return obj;
	}

	private IEnumerator ReplaceCards(GameObject pickedCard = null, bool clear = false)
	{
		if (picks > 0)
		{
			SoundPlayerStatic.Instance.PlayPlayerBallAppear();
		}
		isPlaying = true;
		if (clear && spawnedCards != null)
		{
			for (int j = 0; j < spawnedCards.Count; j++)
			{
				if ((Object)(object)pickedCard != (Object)(object)spawnedCards[j])
				{
					spawnedCards[j].GetComponentInChildren<CardVisuals>().Leave();
					yield return (object)new WaitForSecondsRealtime(0.1f);
				}
			}
			yield return (object)new WaitForSecondsRealtime(0.2f);
			if (Object.op_Implicit((Object)(object)pickedCard))
			{
				pickedCard.GetComponentInChildren<CardVisuals>().Pick();
			}
			spawnedCards.Clear();
		}
		yield return (object)new WaitForSecondsRealtime(0.2f);
		if (picks > 0)
		{
			for (int j = 0; j < children.Length; j++)
			{
				spawnedCards.Add(SpawnUniqueCard(((Component)children[j]).transform.position, ((Component)children[j]).transform.rotation));
				spawnedCards[j].AddComponent<PublicInt>().theInt = j;
				yield return (object)new WaitForSecondsRealtime(0.1f);
			}
		}
		else
		{
			((Component)this).GetComponent<PhotonView>().RPC("RPCA_DonePicking", (RpcTarget)0, Array.Empty<object>());
		}
		picks--;
		isPlaying = false;
	}

	[PunRPC]
	private void RPCA_DonePicking()
	{
		IsPicking = false;
	}

	private GameObject GetRanomCard()
	{
		GameObject result = null;
		float num = 0f;
		for (int i = 0; i < cards.Length; i++)
		{
			if (cards[i].rarity == CardInfo.Rarity.Common)
			{
				num += 10f;
			}
			if (cards[i].rarity == CardInfo.Rarity.Uncommon)
			{
				num += 4f;
			}
			if (cards[i].rarity == CardInfo.Rarity.Rare)
			{
				num += 1f;
			}
		}
		float num2 = Random.Range(0f, num);
		for (int j = 0; j < cards.Length; j++)
		{
			if (cards[j].rarity == CardInfo.Rarity.Common)
			{
				num2 -= 10f;
			}
			if (cards[j].rarity == CardInfo.Rarity.Uncommon)
			{
				num2 -= 4f;
			}
			if (cards[j].rarity == CardInfo.Rarity.Rare)
			{
				num2 -= 1f;
			}
			if (num2 <= 0f)
			{
				result = ((Component)cards[j]).gameObject;
				break;
			}
		}
		return result;
	}

	private GameObject SpawnUniqueCard(Vector3 pos, Quaternion rot)
	{
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		GameObject ranomCard = GetRanomCard();
		CardInfo component = ranomCard.GetComponent<CardInfo>();
		Player player = null;
		player = ((pickerType != 0) ? PlayerManager.instance.players[pickrID] : PlayerManager.instance.GetPlayersInTeam(pickrID)[0]);
		for (int i = 0; i < spawnedCards.Count; i++)
		{
			bool flag = spawnedCards[i].GetComponent<CardInfo>().cardName == ranomCard.GetComponent<CardInfo>().cardName;
			if (pickrID != -1)
			{
				Holdable holdable = ((Component)player.data).GetComponent<Holding>().holdable;
				if (Object.op_Implicit((Object)(object)holdable))
				{
					Gun component2 = ((Component)holdable).GetComponent<Gun>();
					Gun component3 = ranomCard.GetComponent<Gun>();
					if (Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)component2) && component3.lockGunToDefault && component2.lockGunToDefault)
					{
						flag = true;
					}
				}
				for (int j = 0; j < player.data.currentCards.Count; j++)
				{
					CardInfo component4 = ((Component)player.data.currentCards[j]).GetComponent<CardInfo>();
					for (int k = 0; k < component4.blacklistedCategories.Length; k++)
					{
						for (int l = 0; l < component.categories.Length; l++)
						{
							if ((Object)(object)component.categories[l] == (Object)(object)component4.blacklistedCategories[k])
							{
								flag = true;
							}
						}
					}
					if (!component4.allowMultiple && component.cardName == component4.cardName)
					{
						flag = true;
					}
				}
			}
			if (flag)
			{
				return SpawnUniqueCard(pos, rot);
			}
		}
		GameObject obj = Spawn(ranomCard.gameObject, pos, rot);
		obj.GetComponent<CardInfo>().sourceCard = ranomCard.GetComponent<CardInfo>();
		((Behaviour)((Component)obj.GetComponentInChildren<DamagableEvent>()).GetComponent<Collider2D>()).enabled = false;
		return obj;
	}

	private void Update()
	{
		counter += Time.deltaTime;
		_ = isPlaying;
		if (pickrID != -1 && IsPicking)
		{
			DoPlayerSelect();
		}
		if (Application.isEditor && !DevConsole.isTyping && Input.GetKeyDown((KeyCode)110))
		{
			picks++;
			instance.Pick(null, clear: true);
		}
	}

	private void DoPlayerSelect()
	{
		SoundMusicManager.Instance.PlayIngame(isCard: true);
		if (spawnedCards.Count == 0 || pickrID == -1)
		{
			return;
		}
		PlayerActions[] array = null;
		array = ((pickerType != 0) ? PlayerManager.instance.GetActionsFromPlayer(pickrID) : PlayerManager.instance.GetActionsFromTeam(pickrID));
		if (array == null)
		{
			Pick(spawnedCards[0]);
			return;
		}
		StickDirection stickDirection = StickDirection.None;
		for (int i = 0; i < array.Length; i++)
		{
			if (array[i] == null)
			{
				continue;
			}
			if (((OneAxisInputControl)array[i].Right).Value > 0.7f)
			{
				stickDirection = StickDirection.Right;
			}
			if (((OneAxisInputControl)array[i].Left).Value > 0.7f)
			{
				stickDirection = StickDirection.Left;
			}
			currentlySelectedCard = Mathf.Clamp(currentlySelectedCard, 0, spawnedCards.Count - 1);
			for (int j = 0; j < spawnedCards.Count; j++)
			{
				if (Object.op_Implicit((Object)(object)spawnedCards[j]) && (spawnedCards[j].GetComponentInChildren<CardVisuals>().isSelected != (currentlySelectedCard == j) || counter > 0.2f))
				{
					counter = 0f;
					spawnedCards[j].GetComponent<PhotonView>().RPC("RPCA_ChangeSelected", (RpcTarget)0, new object[1] { currentlySelectedCard == j });
				}
			}
			if (((OneAxisInputControl)array[i].Jump).WasPressed && !isPlaying && (Object)(object)spawnedCards[currentlySelectedCard] != (Object)null)
			{
				Pick(spawnedCards[currentlySelectedCard]);
				pickrID = -1;
				break;
			}
		}
		if (stickDirection != lastStickDirection)
		{
			if (stickDirection == StickDirection.Left)
			{
				currentlySelectedCard--;
			}
			if (stickDirection == StickDirection.Right)
			{
				currentlySelectedCard++;
			}
			lastStickDirection = stickDirection;
		}
		if (CardChoiceVisuals.instance.currentCardSelected != currentlySelectedCard)
		{
			CardChoiceVisuals.instance.SetCurrentSelected(currentlySelectedCard);
		}
	}

	public IEnumerator DoPick(int picksToSet, int picketIDToSet, PickerType pType = PickerType.Team)
	{
		pickerType = pType;
		StartPick(picksToSet, picketIDToSet);
		while (IsPicking)
		{
			yield return null;
		}
		UIHandler.instance.StopShowPicker();
		CardChoiceVisuals.instance.Hide();
	}

	public void StartPick(int picksToSet, int pickerIDToSet)
	{
		pickrID = pickerIDToSet;
		IsPicking = true;
		picks = picksToSet;
		ArtHandler.instance.SetSpecificArt(cardPickArt);
		Pick();
	}

	public Color GetCardColor(CardThemeColor.CardThemeColorType colorType)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < cardThemes.Length; i++)
		{
			if (cardThemes[i].themeType == colorType)
			{
				return cardThemes[i].targetColor;
			}
		}
		return Color.black;
	}

	public Color GetCardColor2(CardThemeColor.CardThemeColorType colorType)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < cardThemes.Length; i++)
		{
			if (cardThemes[i].themeType == colorType)
			{
				return cardThemes[i].bgColor;
			}
		}
		return Color.black;
	}
}
[Serializable]
public class CardThemeColor
{
	public enum CardThemeColorType
	{
		DestructiveRed,
		FirepowerYellow,
		DefensiveBlue,
		TechWhite,
		EvilPurple,
		PoisonGreen,
		NatureBrown,
		ColdBlue,
		MagicPink
	}

	public CardThemeColorType themeType;

	public Color targetColor;

	public Color bgColor;
}
public enum PickerType
{
	Team,
	Player
}
public class CardInfo : MonoBehaviour
{
	public enum Rarity
	{
		Common,
		Uncommon,
		Rare
	}

	[Header("Sound Settings")]
	public bool soundDisableBlockBasic;

	[Header("Settings")]
	public string cardName = "";

	[TextArea]
	public string cardDestription = "";

	public CardInfoStat[] cardStats;

	public Rarity rarity;

	public GameObject cardArt;

	public Sprite sprite;

	[HideInInspector]
	public CardInfo sourceCard;

	public Color cardColor = new Color(0.14509805f, 0.14509805f, 0.14509805f);

	public CardCategory[] categories;

	[FoldoutGroup("Restrictions", 0)]
	public bool allowMultiple = true;

	[FoldoutGroup("Restrictions", 0)]
	public CardCategory[] blacklistedCategories;

	public GameObject cardBase;

	public CardThemeColor.CardThemeColorType colorTheme;

	private void Awake()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		sourceCard = CardChoice.instance.GetSourceCard(this);
		cardBase = Object.Instantiate<GameObject>(cardBase, ((Component)this).transform.position, ((Component)this).transform.rotation);
		cardBase.transform.SetParent(((Component)this).transform, true);
		bool charge = false;
		Gun component = ((Component)this).GetComponent<Gun>();
		if (Object.op_Implicit((Object)(object)component) && component.useCharge)
		{
			charge = true;
		}
		cardBase.GetComponent<CardInfoDisplayer>().DrawCard(cardStats, cardName, cardDestription, sprite, charge);
		cardBase.GetComponentInChildren<GeneralParticleSystem>().particleSettings.randomColor = cardColor;
	}

	[PunRPC]
	public void RPCA_ChangeSelected(bool setSelected)
	{
		((Component)this).GetComponentInChildren<CardVisuals>().ChangeSelected(setSelected);
	}
}
[Serializable]
public class CardInfoStat
{
	public enum SimpleAmount
	{
		notAssigned,
		aLittleBitOf,
		Some,
		aLotOf,
		aHugeAmountOf,
		slightlyLower,
		lower,
		aLotLower,
		slightlySmaller,
		smaller
	}

	public bool positive;

	public string amount;

	public SimpleAmount simepleAmount;

	public string stat;

	public string GetSimpleAmount()
	{
		string result = "";
		if (simepleAmount == SimpleAmount.aLittleBitOf)
		{
			result = "Slightly more ";
		}
		if (simepleAmount == SimpleAmount.Some)
		{
			result = "More ";
		}
		if (simepleAmount == SimpleAmount.aLotOf)
		{
			result = "A bunch more ";
		}
		if (simepleAmount == SimpleAmount.aHugeAmountOf)
		{
			result = "A huge amount of";
		}
		if (simepleAmount == SimpleAmount.slightlyLower)
		{
			result = "Slightly lower ";
		}
		if (simepleAmount == SimpleAmount.lower)
		{
			result = "Lower ";
		}
		if (simepleAmount == SimpleAmount.aLotLower)
		{
			result = "A lot lower";
		}
		if (simepleAmount == SimpleAmount.smaller)
		{
			result = "Smaller";
		}
		if (simepleAmount == SimpleAmount.slightlySmaller)
		{
			result = "Slightly smaller";
		}
		return result;
	}
}
public class CardInfoDisplayer : MonoBehaviour
{
	public Color negativeColor;

	public Color positiveColor;

	public GameObject statObject;

	public GameObject grid;

	public GameObject chargeObj;

	public TextMeshProUGUI effectText;

	public TextMeshProUGUI nameText;

	public Image icon;

	public void DrawCard(CardInfoStat[] stats, string cardName, string description = "", Sprite image = null, bool charge = false)
	{
		//IL_009b: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: 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)
		if (charge)
		{
			chargeObj.SetActive(true);
			chargeObj.transform.SetParent(grid.transform, true);
		}
		if (description != "")
		{
			((TMP_Text)effectText).text = description;
			((Component)effectText).gameObject.SetActive(true);
			((TMP_Text)effectText).transform.SetParent(grid.transform, true);
		}
		((TMP_Text)nameText).text = cardName.ToUpper();
		for (int i = 0; i < stats.Length; i++)
		{
			GameObject obj = Object.Instantiate<GameObject>(statObject, grid.transform.position, grid.transform.rotation, grid.transform);
			obj.SetActive(true);
			obj.transform.localScale = Vector3.one;
			TextMeshProUGUI component = ((Component)obj.transform.GetChild(0)).GetComponent<TextMeshProUGUI>();
			TextMeshProUGUI component2 = ((Component)obj.transform.GetChild(1)).GetComponent<TextMeshProUGUI>();
			((TMP_Text)component).text = stats[i].stat;
			if (stats[i].simepleAmount != 0 && !Optionshandler.showCardStatNumbers)
			{
				((TMP_Text)component2).text = stats[i].GetSimpleAmount();
			}
			else
			{
				((TMP_Text)component2).text = stats[i].amount;
			}
			((Graphic)component2).color = (stats[i].positive ? positiveColor : negativeColor);
		}
		if (Object.op_Implicit((Object)(object)image))
		{
			icon.sprite = image;
		}
		Transform transform = ((TMP_Text)effectText).transform;
		transform.position += Vector3.up * 0.3f;
	}
}
public class CardVisuals : MonoBehaviour
{
	private ScaleShake shake;

	public bool isSelected;

	private GeneralParticleSystem part;

	private Color selectedColor;

	private Color unSelectedColor = new Color(0.1f, 0.1f, 0.1f);

	public Color defaultColor;

	public Color chillColor;

	public Image[] images;

	public TextMeshProUGUI nameText;

	public GameObject statsObj;

	public GameObject[] objectsToToggle;

	private CardAnimation[] cardAnims;

	private CanvasGroup group;

	public bool firstValueToSet;

	public Action<bool> toggleSelectionAction;

	private void Start()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing re

BestMod/bin/Debug/BepInEx.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.ConsoleUtil;
using BepInEx.Logging;
using BepInEx.Unix;
using HarmonyLib;
using HarmonyLib.Tools;
using Microsoft.Win32.SafeHandles;
using Mono.Cecil;
using MonoMod.Utils;
using UnityEngine;
using UnityInjector.ConsoleUtil;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("BepInEx")]
[assembly: AssemblyDescription("Unity plugin injection framework")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BepInEx")]
[assembly: AssemblyCopyright("Copyright © Bepis 2018")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4ffba620-f5ed-47f9-b90c-dad1316fd9b9")]
[assembly: InternalsVisibleTo("BepInEx.Preloader")]
[assembly: InternalsVisibleTo("BepInExTests")]
[assembly: AssemblyFileVersion("5.4.19.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("5.4.19.0")]
[module: UnverifiableCode]
namespace UnityEngine
{
	internal sealed class UnityLogWriter
	{
		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern void WriteStringToUnityLogImpl(string s);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public static extern void WriteStringToUnityLog(string s);
	}
}
namespace UnityInjector.ConsoleUtil
{
	internal class ConsoleEncoding : Encoding
	{
		private byte[] _byteBuffer = new byte[256];

		private char[] _charBuffer = new char[256];

		private byte[] _zeroByte = new byte[0];

		private char[] _zeroChar = new char[0];

		private readonly uint _codePage;

		public override int CodePage => (int)_codePage;

		public static Encoding OutputEncoding => new ConsoleEncoding(ConsoleCodePage);

		public static uint ConsoleCodePage
		{
			get
			{
				return GetConsoleOutputCP();
			}
			set
			{
				SetConsoleOutputCP(value);
			}
		}

		private void ExpandByteBuffer(int count)
		{
			if (_byteBuffer.Length < count)
			{
				_byteBuffer = new byte[count];
			}
		}

		private void ExpandCharBuffer(int count)
		{
			if (_charBuffer.Length < count)
			{
				_charBuffer = new char[count];
			}
		}

		private void ReadByteBuffer(byte[] bytes, int index, int count)
		{
			for (int i = 0; i < count; i++)
			{
				bytes[index + i] = _byteBuffer[i];
			}
		}

		private void ReadCharBuffer(char[] chars, int index, int count)
		{
			for (int i = 0; i < count; i++)
			{
				chars[index + i] = _charBuffer[i];
			}
		}

		private void WriteByteBuffer(byte[] bytes, int index, int count)
		{
			ExpandByteBuffer(count);
			for (int i = 0; i < count; i++)
			{
				_byteBuffer[i] = bytes[index + i];
			}
		}

		private void WriteCharBuffer(char[] chars, int index, int count)
		{
			ExpandCharBuffer(count);
			for (int i = 0; i < count; i++)
			{
				_charBuffer[i] = chars[index + i];
			}
		}

		public static uint GetActiveCodePage()
		{
			return GetACP();
		}

		private ConsoleEncoding(uint codePage)
		{
			_codePage = codePage;
		}

		public static ConsoleEncoding GetEncoding(uint codePage)
		{
			return new ConsoleEncoding(codePage);
		}

		public override int GetByteCount(char[] chars, int index, int count)
		{
			WriteCharBuffer(chars, index, count);
			return WideCharToMultiByte(_codePage, 0u, _charBuffer, count, _zeroByte, 0, IntPtr.Zero, IntPtr.Zero);
		}

		public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)
		{
			int byteCount = GetByteCount(chars, charIndex, charCount);
			WriteCharBuffer(chars, charIndex, charCount);
			ExpandByteBuffer(byteCount);
			int result = WideCharToMultiByte(_codePage, 0u, chars, charCount, _byteBuffer, byteCount, IntPtr.Zero, IntPtr.Zero);
			ReadByteBuffer(bytes, byteIndex, byteCount);
			return result;
		}

		public override int GetCharCount(byte[] bytes, int index, int count)
		{
			WriteByteBuffer(bytes, index, count);
			return MultiByteToWideChar(_codePage, 0u, bytes, count, _zeroChar, 0);
		}

		public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
		{
			int charCount = GetCharCount(bytes, byteIndex, byteCount);
			WriteByteBuffer(bytes, byteIndex, byteCount);
			ExpandCharBuffer(charCount);
			int result = MultiByteToWideChar(_codePage, 0u, bytes, byteCount, _charBuffer, charCount);
			ReadCharBuffer(chars, charIndex, charCount);
			return result;
		}

		public override int GetMaxByteCount(int charCount)
		{
			return charCount * 2;
		}

		public override int GetMaxCharCount(int byteCount)
		{
			return byteCount;
		}

		[DllImport("kernel32.dll")]
		private static extern uint GetConsoleOutputCP();

		[DllImport("kernel32.dll")]
		private static extern uint GetACP();

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern int MultiByteToWideChar(uint codePage, uint dwFlags, [In][MarshalAs(UnmanagedType.LPArray)] byte[] lpMultiByteStr, int cbMultiByte, [Out][MarshalAs(UnmanagedType.LPWStr)] char[] lpWideCharStr, int cchWideChar);

		[DllImport("kernel32.dll")]
		private static extern IntPtr SetConsoleOutputCP(uint codepage);

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern int WideCharToMultiByte(uint codePage, uint dwFlags, [In][MarshalAs(UnmanagedType.LPWStr)] char[] lpWideCharStr, int cchWideChar, [Out][MarshalAs(UnmanagedType.LPArray)] byte[] lpMultiByteStr, int cbMultiByte, IntPtr lpDefaultChar, IntPtr lpUsedDefaultChar);
	}
	internal class ConsoleWindow
	{
		[UnmanagedFunctionPointer(CallingConvention.Winapi)]
		[return: MarshalAs(UnmanagedType.Bool)]
		private delegate bool SetForegroundWindowDelegate(IntPtr hWnd);

		[UnmanagedFunctionPointer(CallingConvention.Winapi)]
		private delegate IntPtr GetForegroundWindowDelegate();

		[UnmanagedFunctionPointer(CallingConvention.Winapi)]
		private delegate IntPtr GetSystemMenuDelegate(IntPtr hwnd, bool bRevert);

		[UnmanagedFunctionPointer(CallingConvention.Winapi)]
		private delegate bool DeleteMenuDelegate(IntPtr hMenu, uint uPosition, uint uFlags);

		private const uint SC_CLOSE = 61536u;

		private const uint MF_BYCOMMAND = 0u;

		private const uint LOAD_LIBRARY_SEARCH_SYSTEM32 = 2048u;

		public static IntPtr ConsoleOutHandle;

		public static IntPtr OriginalStdoutHandle;

		private static bool methodsInited;

		private static SetForegroundWindowDelegate setForeground;

		private static GetForegroundWindowDelegate getForeground;

		private static GetSystemMenuDelegate getSystemMenu;

		private static DeleteMenuDelegate deleteMenu;

		public static bool IsAttached { get; private set; }

		public static string Title
		{
			set
			{
				if (IsAttached)
				{
					if (value == null)
					{
						throw new ArgumentNullException("value");
					}
					if (value.Length > 24500)
					{
						throw new InvalidOperationException("Console title too long");
					}
					if (!SetConsoleTitle(value))
					{
						throw new InvalidOperationException("Console title invalid");
					}
				}
			}
		}

		public static void Attach()
		{
			if (!IsAttached)
			{
				Initialize();
				if (OriginalStdoutHandle == IntPtr.Zero)
				{
					OriginalStdoutHandle = GetStdHandle(-11);
				}
				IntPtr hWnd = getForeground();
				GetConsoleWindow();
				if (GetConsoleWindow() == IntPtr.Zero && !AllocConsole())
				{
					throw new Exception("AllocConsole() failed");
				}
				setForeground(hWnd);
				ConsoleOutHandle = CreateFile("CONOUT$", 3221225472u, 2, IntPtr.Zero, 3, 0, IntPtr.Zero);
				Kon.conOut = ConsoleOutHandle;
				if (!SetStdHandle(-11, ConsoleOutHandle))
				{
					throw new Exception("SetStdHandle() failed");
				}
				if (OriginalStdoutHandle != IntPtr.Zero && ConsoleManager.ConfigConsoleOutRedirectType.Value == ConsoleManager.ConsoleOutRedirectType.ConsoleOut)
				{
					CloseHandle(OriginalStdoutHandle);
				}
				IsAttached = true;
			}
		}

		public static void PreventClose()
		{
			if (IsAttached)
			{
				Initialize();
				IntPtr consoleWindow = GetConsoleWindow();
				IntPtr intPtr = getSystemMenu(consoleWindow, bRevert: false);
				if (intPtr != IntPtr.Zero)
				{
					deleteMenu(intPtr, 61536u, 0u);
				}
			}
		}

		public static void Detach()
		{
			if (IsAttached)
			{
				if (!CloseHandle(ConsoleOutHandle))
				{
					throw new Exception("CloseHandle() failed");
				}
				ConsoleOutHandle = IntPtr.Zero;
				if (!FreeConsole())
				{
					throw new Exception("FreeConsole() failed");
				}
				if (!SetStdHandle(-11, OriginalStdoutHandle))
				{
					throw new Exception("SetStdHandle() failed");
				}
				IsAttached = false;
			}
		}

		private static void Initialize()
		{
			if (!methodsInited)
			{
				methodsInited = true;
				IntPtr hModule = LoadLibraryEx("user32.dll", IntPtr.Zero, 2048u);
				setForeground = DynDll.AsDelegate<SetForegroundWindowDelegate>(GetProcAddress(hModule, "SetForegroundWindow"));
				getForeground = DynDll.AsDelegate<GetForegroundWindowDelegate>(GetProcAddress(hModule, "GetForegroundWindow"));
				getSystemMenu = DynDll.AsDelegate<GetSystemMenuDelegate>(GetProcAddress(hModule, "GetSystemMenu"));
				deleteMenu = DynDll.AsDelegate<DeleteMenuDelegate>(GetProcAddress(hModule, "DeleteMenu"));
			}
		}

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern IntPtr GetProcAddress(IntPtr hModule, string procName);

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern bool AllocConsole();

		[DllImport("kernel32.dll")]
		private static extern IntPtr GetConsoleWindow();

		[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)]
		private static extern bool CloseHandle(IntPtr handle);

		[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
		private static extern IntPtr CreateFile(string fileName, uint desiredAccess, int shareMode, IntPtr securityAttributes, int creationDisposition, int flagsAndAttributes, IntPtr templateFile);

		[DllImport("kernel32.dll")]
		private static extern bool FreeConsole();

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern IntPtr GetStdHandle(int nStdHandle);

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern bool SetStdHandle(int nStdHandle, IntPtr hConsoleOutput);

		[DllImport("kernel32.dll", BestFitMapping = true, CharSet = CharSet.Auto, SetLastError = true)]
		private static extern bool SetConsoleTitle(string title);

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern IntPtr LoadLibraryEx(string lpLibFileName, IntPtr hFile, uint dwFlags);
	}
	internal static class SafeConsole
	{
		private delegate ConsoleColor GetColorDelegate();

		private delegate void SetColorDelegate(ConsoleColor value);

		private delegate string GetStringDelegate();

		private delegate void SetStringDelegate(string value);

		private static GetColorDelegate _getBackgroundColor;

		private static SetColorDelegate _setBackgroundColor;

		private static GetColorDelegate _getForegroundColor;

		private static SetColorDelegate _setForegroundColor;

		private static GetStringDelegate _getTitle;

		private static SetStringDelegate _setTitle;

		public static bool BackgroundColorExists { get; private set; }

		public static ConsoleColor BackgroundColor
		{
			get
			{
				return _getBackgroundColor();
			}
			set
			{
				_setBackgroundColor(value);
			}
		}

		public static bool ForegroundColorExists { get; private set; }

		public static ConsoleColor ForegroundColor
		{
			get
			{
				return _getForegroundColor();
			}
			set
			{
				_setForegroundColor(value);
			}
		}

		public static bool TitleExists { get; private set; }

		public static string Title
		{
			get
			{
				return _getTitle();
			}
			set
			{
				_setTitle(value);
			}
		}

		static SafeConsole()
		{
			InitColors(typeof(Console));
		}

		private static void InitColors(Type tConsole)
		{
			MethodInfo method = tConsole.GetMethod("get_ForegroundColor", BindingFlags.Static | BindingFlags.Public);
			MethodInfo method2 = tConsole.GetMethod("set_ForegroundColor", BindingFlags.Static | BindingFlags.Public);
			MethodInfo method3 = tConsole.GetMethod("get_BackgroundColor", BindingFlags.Static | BindingFlags.Public);
			MethodInfo method4 = tConsole.GetMethod("set_BackgroundColor", BindingFlags.Static | BindingFlags.Public);
			MethodInfo method5 = tConsole.GetMethod("get_Title", BindingFlags.Static | BindingFlags.Public);
			MethodInfo method6 = tConsole.GetMethod("set_Title", BindingFlags.Static | BindingFlags.Public);
			_setForegroundColor = (((object)method2 != null) ? ((SetColorDelegate)Delegate.CreateDelegate(typeof(SetColorDelegate), method2)) : ((SetColorDelegate)delegate
			{
			}));
			_setBackgroundColor = (((object)method4 != null) ? ((SetColorDelegate)Delegate.CreateDelegate(typeof(SetColorDelegate), method4)) : ((SetColorDelegate)delegate
			{
			}));
			_getForegroundColor = (((object)method != null) ? ((GetColorDelegate)Delegate.CreateDelegate(typeof(GetColorDelegate), method)) : ((GetColorDelegate)(() => ConsoleColor.Gray)));
			_getBackgroundColor = (((object)method3 != null) ? ((GetColorDelegate)Delegate.CreateDelegate(typeof(GetColorDelegate), method3)) : ((GetColorDelegate)(() => ConsoleColor.Black)));
			_getTitle = (((object)method5 != null) ? ((GetStringDelegate)Delegate.CreateDelegate(typeof(GetStringDelegate), method5)) : ((GetStringDelegate)(() => string.Empty)));
			_setTitle = (((object)method6 != null) ? ((SetStringDelegate)Delegate.CreateDelegate(typeof(SetStringDelegate), method6)) : ((SetStringDelegate)delegate
			{
			}));
			BackgroundColorExists = _setBackgroundColor != null && _getBackgroundColor != null;
			ForegroundColorExists = _setForegroundColor != null && _getForegroundColor != null;
			TitleExists = _setTitle != null && _getTitle != null;
		}
	}
}
namespace BepInEx
{
	internal static class ConsoleManager
	{
		public enum ConsoleOutRedirectType
		{
			[Description("Auto")]
			Auto,
			[Description("Console Out")]
			ConsoleOut,
			[Description("Standard Out")]
			StandardOut
		}

		private const uint SHIFT_JIS_CP = 932u;

		private static readonly bool? EnableConsoleArgOverride;

		private const string ENABLE_CONSOLE_ARG = "--enable-console";

		public static readonly ConfigEntry<bool> ConfigConsoleEnabled;

		public static readonly ConfigEntry<bool> ConfigPreventClose;

		public static readonly ConfigEntry<bool> ConfigConsoleShiftJis;

		public static readonly ConfigEntry<ConsoleOutRedirectType> ConfigConsoleOutRedirectType;

		internal static IConsoleDriver Driver { get; set; }

		public static bool ConsoleActive => Driver?.ConsoleActive ?? false;

		public static TextWriter StandardOutStream => Driver?.StandardOut;

		public static TextWriter ConsoleStream => Driver?.ConsoleOut;

		public static bool ConsoleEnabled => EnableConsoleArgOverride ?? ConfigConsoleEnabled.Value;

		static ConsoleManager()
		{
			ConfigConsoleEnabled = ConfigFile.CoreConfig.Bind("Logging.Console", "Enabled", defaultValue: false, "Enables showing a console for log output.");
			ConfigPreventClose = ConfigFile.CoreConfig.Bind("Logging.Console", "PreventClose", defaultValue: false, "If enabled, will prevent closing the console (either by deleting the close button or in other platform-specific way).");
			ConfigConsoleShiftJis = ConfigFile.CoreConfig.Bind("Logging.Console", "ShiftJisEncoding", defaultValue: false, "If true, console is set to the Shift-JIS encoding, otherwise UTF-8 encoding.");
			ConfigConsoleOutRedirectType = ConfigFile.CoreConfig.Bind("Logging.Console", "StandardOutType", ConsoleOutRedirectType.Auto, new StringBuilder().AppendLine("Hints console manager on what handle to assign as StandardOut. Possible values:").AppendLine("Auto - lets BepInEx decide how to redirect console output").AppendLine("ConsoleOut - prefer redirecting to console output; if possible, closes original standard output")
				.AppendLine("StandardOut - prefer redirecting to standard output; if possible, closes console out")
				.ToString());
			try
			{
				string[] commandLineArgs = Environment.GetCommandLineArgs();
				for (int i = 0; i < commandLineArgs.Length; i++)
				{
					if (commandLineArgs[i] == "--enable-console" && i + 1 < commandLineArgs.Length && bool.TryParse(commandLineArgs[i + 1], out var result))
					{
						EnableConsoleArgOverride = result;
					}
				}
			}
			catch (Exception)
			{
			}
		}

		public static void Initialize(bool alreadyActive)
		{
			if (PlatformHelper.Is((Platform)8))
			{
				Driver = new LinuxConsoleDriver();
			}
			else if (PlatformHelper.Is((Platform)37))
			{
				Driver = new WindowsConsoleDriver();
			}
			Driver.Initialize(alreadyActive);
		}

		private static void DriverCheck()
		{
			if (Driver == null)
			{
				throw new InvalidOperationException("Driver has not been initialized");
			}
		}

		public static void CreateConsole()
		{
			if (!ConsoleActive)
			{
				DriverCheck();
				uint codepage = (ConfigConsoleShiftJis.Value ? 932u : ((uint)Encoding.UTF8.CodePage));
				Driver.CreateConsole(codepage);
				if (ConfigPreventClose.Value)
				{
					Driver.PreventClose();
				}
			}
		}

		public static void DetachConsole()
		{
			if (ConsoleActive)
			{
				DriverCheck();
				Driver.DetachConsole();
			}
		}

		public static void SetConsoleTitle(string title)
		{
			DriverCheck();
			Driver.SetConsoleTitle(title);
		}

		public static void SetConsoleColor(ConsoleColor color)
		{
			DriverCheck();
			Driver.SetConsoleColor(color);
		}
	}
	internal interface IConsoleDriver
	{
		TextWriter StandardOut { get; }

		TextWriter ConsoleOut { get; }

		bool ConsoleActive { get; }

		bool ConsoleIsExternal { get; }

		void PreventClose();

		void Initialize(bool alreadyActive);

		void CreateConsole(uint codepage);

		void DetachConsole();

		void SetConsoleColor(ConsoleColor color);

		void SetConsoleTitle(string title);
	}
	internal class WindowsConsoleDriver : IConsoleDriver
	{
		private static readonly ConstructorInfo FileStreamCtor = new ConstructorInfo[2]
		{
			AccessTools.Constructor(typeof(FileStream), new Type[2]
			{
				typeof(SafeFileHandle),
				typeof(FileAccess)
			}, false),
			AccessTools.Constructor(typeof(FileStream), new Type[2]
			{
				typeof(IntPtr),
				typeof(FileAccess)
			}, false)
		}.FirstOrDefault((ConstructorInfo m) => (object)m != null);

		public TextWriter StandardOut { get; private set; }

		public TextWriter ConsoleOut { get; private set; }

		public bool ConsoleActive { get; private set; }

		public bool ConsoleIsExternal => true;

		public void PreventClose()
		{
			ConsoleWindow.PreventClose();
		}

		public void Initialize(bool alreadyActive)
		{
			ConsoleActive = alreadyActive;
			StandardOut = Console.Out;
		}

		private static FileStream OpenFileStream(IntPtr handle)
		{
			SafeFileHandle safeFileHandle = new SafeFileHandle(handle, ownsHandle: false);
			object[] args = AccessTools.ActualParameters((MethodBase)FileStreamCtor, new object[3]
			{
				safeFileHandle,
				safeFileHandle.DangerousGetHandle(),
				FileAccess.Write
			});
			return (FileStream)Activator.CreateInstance(typeof(FileStream), args);
		}

		public void CreateConsole(uint codepage)
		{
			ConsoleWindow.Attach();
			ConsoleEncoding.ConsoleCodePage = codepage;
			IntPtr outHandle = GetOutHandle();
			if (outHandle == IntPtr.Zero)
			{
				StandardOut = TextWriter.Null;
				ConsoleOut = TextWriter.Null;
				return;
			}
			FileStream stream = OpenFileStream(outHandle);
			StandardOut = new StreamWriter(stream, Utility.UTF8NoBom)
			{
				AutoFlush = true
			};
			FileStream stream2 = OpenFileStream(ConsoleWindow.ConsoleOutHandle);
			ConsoleOut = new StreamWriter(stream2, ConsoleEncoding.OutputEncoding)
			{
				AutoFlush = true
			};
			ConsoleActive = true;
		}

		private IntPtr GetOutHandle()
		{
			switch (ConsoleManager.ConfigConsoleOutRedirectType.Value)
			{
			case ConsoleManager.ConsoleOutRedirectType.ConsoleOut:
				return ConsoleWindow.ConsoleOutHandle;
			case ConsoleManager.ConsoleOutRedirectType.StandardOut:
				return ConsoleWindow.OriginalStdoutHandle;
			default:
				if (!(ConsoleWindow.OriginalStdoutHandle != IntPtr.Zero))
				{
					return ConsoleWindow.ConsoleOutHandle;
				}
				return ConsoleWindow.OriginalStdoutHandle;
			}
		}

		public void DetachConsole()
		{
			ConsoleWindow.Detach();
			ConsoleOut.Close();
			ConsoleOut = null;
			ConsoleActive = false;
		}

		public void SetConsoleColor(ConsoleColor color)
		{
			SafeConsole.ForegroundColor = color;
			Kon.ForegroundColor = color;
		}

		public void SetConsoleTitle(string title)
		{
			ConsoleWindow.Title = title;
		}
	}
	public class PluginInfo : ICacheable
	{
		public BepInPlugin Metadata { get; internal set; }

		public IEnumerable<BepInProcess> Processes { get; internal set; }

		public IEnumerable<BepInDependency> Dependencies { get; internal set; }

		public IEnumerable<BepInIncompatibility> Incompatibilities { get; internal set; }

		public string Location { get; internal set; }

		public BaseUnityPlugin Instance { get; internal set; }

		internal string TypeName { get; set; }

		internal Version TargettedBepInExVersion { get; set; }

		void ICacheable.Save(BinaryWriter bw)
		{
			bw.Write(TypeName);
			bw.Write(Metadata.GUID);
			bw.Write(Metadata.Name);
			bw.Write(Metadata.Version.ToString());
			List<BepInProcess> list = Processes.ToList();
			bw.Write(list.Count);
			foreach (BepInProcess item in list)
			{
				bw.Write(item.ProcessName);
			}
			List<BepInDependency> list2 = Dependencies.ToList();
			bw.Write(list2.Count);
			foreach (BepInDependency item2 in list2)
			{
				((ICacheable)item2).Save(bw);
			}
			List<BepInIncompatibility> list3 = Incompatibilities.ToList();
			bw.Write(list3.Count);
			foreach (BepInIncompatibility item3 in list3)
			{
				((ICacheable)item3).Save(bw);
			}
			bw.Write(TargettedBepInExVersion.ToString(4));
		}

		void ICacheable.Load(BinaryReader br)
		{
			TypeName = br.ReadString();
			Metadata = new BepInPlugin(br.ReadString(), br.ReadString(), br.ReadString());
			int num = br.ReadInt32();
			List<BepInProcess> list = new List<BepInProcess>(num);
			for (int i = 0; i < num; i++)
			{
				list.Add(new BepInProcess(br.ReadString()));
			}
			Processes = list;
			int num2 = br.ReadInt32();
			List<BepInDependency> list2 = new List<BepInDependency>(num2);
			for (int j = 0; j < num2; j++)
			{
				BepInDependency bepInDependency = new BepInDependency("");
				((ICacheable)bepInDependency).Load(br);
				list2.Add(bepInDependency);
			}
			Dependencies = list2;
			int num3 = br.ReadInt32();
			List<BepInIncompatibility> list3 = new List<BepInIncompatibility>(num3);
			for (int k = 0; k < num3; k++)
			{
				BepInIncompatibility bepInIncompatibility = new BepInIncompatibility("");
				((ICacheable)bepInIncompatibility).Load(br);
				list3.Add(bepInIncompatibility);
			}
			Incompatibilities = list3;
			TargettedBepInExVersion = new Version(br.ReadString());
		}

		public override string ToString()
		{
			return $"{Metadata?.Name} {Metadata?.Version}";
		}
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
	public class BepInPlugin : Attribute
	{
		public string GUID { get; protected set; }

		public string Name { get; protected set; }

		public Version Version { get; protected set; }

		public BepInPlugin(string GUID, string Name, string Version)
		{
			this.GUID = GUID;
			this.Name = Name;
			try
			{
				this.Version = new Version(Version);
			}
			catch
			{
				this.Version = null;
			}
		}

		internal static BepInPlugin FromCecilType(TypeDefinition td)
		{
			//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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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)
			CustomAttribute val = MetadataHelper.GetCustomAttributes<BepInPlugin>(td, inherit: false).FirstOrDefault();
			if (val == null)
			{
				return null;
			}
			CustomAttributeArgument val2 = val.ConstructorArguments[0];
			string gUID = (string)((CustomAttributeArgument)(ref val2)).Value;
			val2 = val.ConstructorArguments[1];
			string name = (string)((CustomAttributeArgument)(ref val2)).Value;
			val2 = val.ConstructorArguments[2];
			return new BepInPlugin(gUID, name, (string)((CustomAttributeArgument)(ref val2)).Value);
		}
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
	public class BepInDependency : Attribute, ICacheable
	{
		[Flags]
		public enum DependencyFlags
		{
			HardDependency = 1,
			SoftDependency = 2
		}

		public string DependencyGUID { get; protected set; }

		public DependencyFlags Flags { get; protected set; }

		public Version MinimumVersion { get; protected set; }

		public BepInDependency(string DependencyGUID, DependencyFlags Flags = DependencyFlags.HardDependency)
		{
			this.DependencyGUID = DependencyGUID;
			this.Flags = Flags;
			MinimumVersion = new Version();
		}

		public BepInDependency(string DependencyGUID, string MinimumDependencyVersion)
			: this(DependencyGUID)
		{
			MinimumVersion = new Version(MinimumDependencyVersion);
		}

		internal static IEnumerable<BepInDependency> FromCecilType(TypeDefinition td)
		{
			return MetadataHelper.GetCustomAttributes<BepInDependency>(td, inherit: true).Select(delegate(CustomAttribute customAttribute)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: 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)
				CustomAttributeArgument val = customAttribute.ConstructorArguments[0];
				string dependencyGUID = (string)((CustomAttributeArgument)(ref val)).Value;
				val = customAttribute.ConstructorArguments[1];
				object value = ((CustomAttributeArgument)(ref val)).Value;
				return (value is string minimumDependencyVersion) ? new BepInDependency(dependencyGUID, minimumDependencyVersion) : new BepInDependency(dependencyGUID, (DependencyFlags)value);
			}).ToList();
		}

		void ICacheable.Save(BinaryWriter bw)
		{
			bw.Write(DependencyGUID);
			bw.Write((int)Flags);
			bw.Write(MinimumVersion.ToString());
		}

		void ICacheable.Load(BinaryReader br)
		{
			DependencyGUID = br.ReadString();
			Flags = (DependencyFlags)br.ReadInt32();
			MinimumVersion = new Version(br.ReadString());
		}
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
	public class BepInIncompatibility : Attribute, ICacheable
	{
		public string IncompatibilityGUID { get; protected set; }

		public BepInIncompatibility(string IncompatibilityGUID)
		{
			this.IncompatibilityGUID = IncompatibilityGUID;
		}

		internal static IEnumerable<BepInIncompatibility> FromCecilType(TypeDefinition td)
		{
			return MetadataHelper.GetCustomAttributes<BepInIncompatibility>(td, inherit: true).Select(delegate(CustomAttribute customAttribute)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				CustomAttributeArgument val = customAttribute.ConstructorArguments[0];
				return new BepInIncompatibility((string)((CustomAttributeArgument)(ref val)).Value);
			}).ToList();
		}

		void ICacheable.Save(BinaryWriter bw)
		{
			bw.Write(IncompatibilityGUID);
		}

		void ICacheable.Load(BinaryReader br)
		{
			IncompatibilityGUID = br.ReadString();
		}
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
	public class BepInProcess : Attribute
	{
		public string ProcessName { get; protected set; }

		public BepInProcess(string ProcessName)
		{
			this.ProcessName = ProcessName;
		}

		internal static List<BepInProcess> FromCecilType(TypeDefinition td)
		{
			return MetadataHelper.GetCustomAttributes<BepInProcess>(td, inherit: true).Select(delegate(CustomAttribute customAttribute)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				CustomAttributeArgument val = customAttribute.ConstructorArguments[0];
				return new BepInProcess((string)((CustomAttributeArgument)(ref val)).Value);
			}).ToList();
		}
	}
	public static class MetadataHelper
	{
		internal static IEnumerable<CustomAttribute> GetCustomAttributes<T>(TypeDefinition td, bool inherit) where T : Attribute
		{
			List<CustomAttribute> list = new List<CustomAttribute>();
			Type type = typeof(T);
			TypeDefinition val = td;
			do
			{
				list.AddRange(((IEnumerable<CustomAttribute>)val.CustomAttributes).Where((CustomAttribute ca) => ((MemberReference)ca.AttributeType).FullName == type.FullName));
				TypeReference baseType = val.BaseType;
				val = ((baseType != null) ? baseType.Resolve() : null);
			}
			while (inherit && ((val != null) ? ((MemberReference)val).FullName : null) != "System.Object");
			return list;
		}

		public static BepInPlugin GetMetadata(Type pluginType)
		{
			object[] customAttributes = pluginType.GetCustomAttributes(typeof(BepInPlugin), inherit: false);
			if (customAttributes.Length == 0)
			{
				return null;
			}
			return (BepInPlugin)customAttributes[0];
		}

		public static BepInPlugin GetMetadata(object plugin)
		{
			return GetMetadata(plugin.GetType());
		}

		public static T[] GetAttributes<T>(Type pluginType) where T : Attribute
		{
			return (T[])pluginType.GetCustomAttributes(typeof(T), inherit: true);
		}

		public static IEnumerable<T> GetAttributes<T>(object plugin) where T : Attribute
		{
			return GetAttributes<T>(plugin.GetType());
		}

		public static IEnumerable<BepInDependency> GetDependencies(Type plugin)
		{
			return plugin.GetCustomAttributes(typeof(BepInDependency), inherit: true).Cast<BepInDependency>();
		}
	}
	internal class BuildInfoAttribute : Attribute
	{
		public string Info { get; }

		public BuildInfoAttribute(string info)
		{
			Info = info;
		}
	}
	public abstract class BaseUnityPlugin : MonoBehaviour
	{
		public PluginInfo Info { get; }

		protected ManualLogSource Logger { get; }

		public ConfigFile Config { get; }

		protected BaseUnityPlugin()
		{
			BepInPlugin metadata = MetadataHelper.GetMetadata(this);
			if (metadata == null)
			{
				throw new InvalidOperationException("Can't create an instance of " + ((object)this).GetType().FullName + " because it inherits from BaseUnityPlugin and the BepInPlugin attribute is missing.");
			}
			if (!Chainloader.IsEditor && Chainloader.PluginInfos.TryGetValue(metadata.GUID, out var value))
			{
				Info = value;
			}
			else
			{
				Info = new PluginInfo
				{
					Metadata = metadata,
					Instance = this,
					Dependencies = MetadataHelper.GetDependencies(((object)this).GetType()),
					Processes = MetadataHelper.GetAttributes<BepInProcess>(((object)this).GetType()),
					Location = ((object)this).GetType().Assembly.Location
				};
			}
			Logger = BepInEx.Logging.Logger.CreateLogSource(metadata.Name);
			string text = (Chainloader.IsEditor ? "." : Paths.ConfigPath);
			Config = new ConfigFile(Utility.CombinePaths(text, metadata.GUID + ".cfg"), saveOnInit: false, metadata);
		}
	}
	public static class Paths
	{
		public static string[] DllSearchPaths { get; private set; }

		public static string BepInExAssemblyDirectory { get; private set; }

		public static string BepInExAssemblyPath { get; private set; }

		public static string BepInExRootPath { get; private set; }

		public static string ExecutablePath { get; private set; }

		public static string GameRootPath { get; private set; }

		public static string ManagedPath { get; private set; }

		public static string ConfigPath { get; private set; }

		public static string BepInExConfigPath { get; private set; }

		public static string CachePath { get; private set; }

		public static string PatcherPluginPath { get; private set; }

		public static string PluginPath { get; private set; }

		public static string ProcessName { get; private set; }

		internal static void SetExecutablePath(string executablePath, string bepinRootPath = null, string managedPath = null, string[] dllSearchPath = null)
		{
			ExecutablePath = executablePath;
			ProcessName = Path.GetFileNameWithoutExtension(executablePath);
			GameRootPath = (PlatformHelper.Is((Platform)73) ? Utility.ParentDirectory(executablePath, 4) : Path.GetDirectoryName(executablePath));
			ManagedPath = managedPath ?? Utility.CombinePaths(GameRootPath, ProcessName + "_Data", "Managed");
			BepInExRootPath = bepinRootPath ?? Path.Combine(GameRootPath, "BepInEx");
			ConfigPath = Path.Combine(BepInExRootPath, "config");
			BepInExConfigPath = Path.Combine(ConfigPath, "BepInEx.cfg");
			PluginPath = Path.Combine(BepInExRootPath, "plugins");
			PatcherPluginPath = Path.Combine(BepInExRootPath, "patchers");
			BepInExAssemblyDirectory = Path.Combine(BepInExRootPath, "core");
			BepInExAssemblyPath = Path.Combine(BepInExAssemblyDirectory, Assembly.GetExecutingAssembly().GetName().Name + ".dll");
			CachePath = Path.Combine(BepInExRootPath, "cache");
			DllSearchPaths = (dllSearchPath ?? new string[0]).Concat(new string[1] { ManagedPath }).Distinct().ToArray();
		}

		internal static void SetManagedPath(string managedPath)
		{
			if (managedPath != null)
			{
				ManagedPath = managedPath;
			}
		}

		internal static void SetPluginPath(string pluginPath)
		{
			PluginPath = Utility.CombinePaths(BepInExRootPath, pluginPath);
		}
	}
	public sealed class ThreadingHelper : MonoBehaviour, ISynchronizeInvoke
	{
		private sealed class InvokeResult : IAsyncResult
		{
			internal bool ExceptionThrown;

			public bool IsCompleted { get; private set; }

			public WaitHandle AsyncWaitHandle { get; }

			public object AsyncState { get; private set; }

			public bool CompletedSynchronously { get; private set; }

			public InvokeResult()
			{
				AsyncWaitHandle = new EventWaitHandle(initialState: false, EventResetMode.ManualReset);
			}

			public void Finish(object result, bool completedSynchronously)
			{
				AsyncState = result;
				CompletedSynchronously = completedSynchronously;
				IsCompleted = true;
				((EventWaitHandle)AsyncWaitHandle).Set();
			}
		}

		private readonly object _invokeLock = new object();

		private Action _invokeList;

		private Thread _mainThread;

		public static ThreadingHelper Instance { get; private set; }

		public static ISynchronizeInvoke SynchronizingObject => Instance;

		public bool InvokeRequired
		{
			get
			{
				if (_mainThread != null)
				{
					return _mainThread != Thread.CurrentThread;
				}
				return true;
			}
		}

		internal static void Initialize()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			GameObject val = new GameObject("BepInEx_ThreadingHelper");
			if (Chainloader.ConfigHideBepInExGOs.Value)
			{
				((Object)val).hideFlags = (HideFlags)61;
			}
			Object.DontDestroyOnLoad((Object)(object)val);
			Instance = val.AddComponent<ThreadingHelper>();
		}

		public void StartSyncInvoke(Action action)
		{
			if (action == null)
			{
				throw new ArgumentNullException("action");
			}
			lock (_invokeLock)
			{
				_invokeList = (Action)Delegate.Combine(_invokeList, action);
			}
		}

		private void Update()
		{
			if (_mainThread == null)
			{
				_mainThread = Thread.CurrentThread;
			}
			if (_invokeList == null)
			{
				return;
			}
			Action invokeList;
			lock (_invokeLock)
			{
				invokeList = _invokeList;
				_invokeList = null;
			}
			foreach (Action item in invokeList.GetInvocationList().Cast<Action>())
			{
				try
				{
					item();
				}
				catch (Exception ex)
				{
					LogInvocationException(ex);
				}
			}
		}

		public void StartAsyncInvoke(Func<Action> action)
		{
			if (!ThreadPool.QueueUserWorkItem(DoWork))
			{
				throw new NotSupportedException("Failed to queue the action on ThreadPool");
			}
			void DoWork(object _)
			{
				try
				{
					Action action2 = action();
					if (action2 != null)
					{
						StartSyncInvoke(action2);
					}
				}
				catch (Exception ex)
				{
					LogInvocationException(ex);
				}
			}
		}

		private static void LogInvocationException(Exception ex)
		{
			Logger.Log(LogLevel.Error, ex);
			if (ex.InnerException != null)
			{
				Logger.Log(LogLevel.Error, "INNER: " + ex.InnerException);
			}
		}

		IAsyncResult ISynchronizeInvoke.BeginInvoke(Delegate method, object[] args)
		{
			InvokeResult result = new InvokeResult();
			if (!InvokeRequired)
			{
				result.Finish(Invoke(), completedSynchronously: true);
			}
			else
			{
				StartSyncInvoke(delegate
				{
					result.Finish(Invoke(), completedSynchronously: false);
				});
			}
			return result;
			object Invoke()
			{
				try
				{
					return method.DynamicInvoke(args);
				}
				catch (Exception result2)
				{
					result.ExceptionThrown = true;
					return result2;
				}
			}
		}

		object ISynchronizeInvoke.EndInvoke(IAsyncResult result)
		{
			InvokeResult invokeResult = (InvokeResult)result;
			invokeResult.AsyncWaitHandle.WaitOne();
			if (invokeResult.ExceptionThrown)
			{
				throw (Exception)invokeResult.AsyncState;
			}
			return invokeResult.AsyncState;
		}

		object ISynchronizeInvoke.Invoke(Delegate method, object[] args)
		{
			IAsyncResult result = ((ISynchronizeInvoke)this).BeginInvoke(method, args);
			return ((ISynchronizeInvoke)this).EndInvoke(result);
		}
	}
	public static class ThreadingExtensions
	{
		public static IEnumerable<TOut> RunParallel<TIn, TOut>(this IEnumerable<TIn> data, Func<TIn, TOut> work, int workerCount = -1)
		{
			foreach (TOut item in data.ToList().RunParallel(work))
			{
				yield return item;
			}
		}

		public static IEnumerable<TOut> RunParallel<TIn, TOut>(this IList<TIn> data, Func<TIn, TOut> work, int workerCount = -1)
		{
			if (workerCount < 0)
			{
				workerCount = Mathf.Max(2, Environment.ProcessorCount);
			}
			else if (workerCount == 0)
			{
				throw new ArgumentException("Need at least 1 worker", "workerCount");
			}
			int perThreadCount = Mathf.CeilToInt((float)data.Count / (float)workerCount);
			int doneCount = 0;
			object lockObj = new object();
			ManualResetEvent are = new ManualResetEvent(initialState: false);
			IEnumerable<TOut> doneItems = null;
			Exception exceptionThrown = null;
			for (int i = 0; i < workerCount; i++)
			{
				int first = i * perThreadCount;
				int last = Mathf.Min(first + perThreadCount, data.Count);
				ThreadPool.QueueUserWorkItem(delegate
				{
					List<TOut> list = new List<TOut>(perThreadCount);
					try
					{
						for (int j = first; j < last; j++)
						{
							if (exceptionThrown != null)
							{
								break;
							}
							list.Add(work(data[j]));
						}
					}
					catch (Exception ex)
					{
						exceptionThrown = ex;
					}
					lock (lockObj)
					{
						IEnumerable<TOut> enumerable2;
						if (doneItems != null)
						{
							enumerable2 = list.Concat(doneItems);
						}
						else
						{
							IEnumerable<TOut> enumerable3 = list;
							enumerable2 = enumerable3;
						}
						doneItems = enumerable2;
						int num = doneCount;
						doneCount = num + 1;
						are.Set();
					}
				});
			}
			bool isDone;
			do
			{
				are.WaitOne();
				IEnumerable<TOut> enumerable;
				lock (lockObj)
				{
					enumerable = doneItems;
					doneItems = null;
					isDone = doneCount == workerCount;
				}
				if (enumerable == null)
				{
					continue;
				}
				foreach (TOut item in enumerable)
				{
					yield return item;
				}
			}
			while (!isDone);
			if (exceptionThrown != null)
			{
				throw new TargetInvocationException("An exception was thrown inside one of the threads", exceptionThrown);
			}
		}
	}
	public static class Utility
	{
		private static bool? sreEnabled;

		public static bool CLRSupportsDynamicAssemblies => CheckSRE();

		public static Encoding UTF8NoBom { get; } = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);


		private static bool CheckSRE()
		{
			if (sreEnabled.HasValue)
			{
				return sreEnabled.Value;
			}
			try
			{
				new CustomAttributeBuilder(null, new object[0]);
			}
			catch (PlatformNotSupportedException)
			{
				sreEnabled = false;
				return sreEnabled.Value;
			}
			catch (ArgumentNullException)
			{
			}
			sreEnabled = true;
			return sreEnabled.Value;
		}

		public static bool TryDo(Action action, out Exception exception)
		{
			exception = null;
			try
			{
				action();
				return true;
			}
			catch (Exception ex)
			{
				exception = ex;
				return false;
			}
		}

		public static string CombinePaths(params string[] parts)
		{
			return parts.Aggregate(Path.Combine);
		}

		public static string ParentDirectory(string path, int levels = 1)
		{
			for (int i = 0; i < levels; i++)
			{
				path = Path.GetDirectoryName(path);
			}
			return path;
		}

		public static bool SafeParseBool(string input, bool defaultValue = false)
		{
			if (!bool.TryParse(input, out var result))
			{
				return defaultValue;
			}
			return result;
		}

		public static string ConvertToWWWFormat(string path)
		{
			return "file://" + path.Replace('\\', '/');
		}

		public static bool IsNullOrWhiteSpace(this string self)
		{
			return self?.All(char.IsWhiteSpace) ?? true;
		}

		public static IEnumerable<TNode> TopologicalSort<TNode>(IEnumerable<TNode> nodes, Func<TNode, IEnumerable<TNode>> dependencySelector)
		{
			List<TNode> sorted_list = new List<TNode>();
			HashSet<TNode> visited = new HashSet<TNode>();
			HashSet<TNode> sorted = new HashSet<TNode>();
			foreach (TNode node in nodes)
			{
				Stack<TNode> stack2 = new Stack<TNode>();
				if (!Visit(node, stack2))
				{
					throw new Exception("Cyclic Dependency:\r\n" + stack2.Select((TNode x) => $" - {x}").Aggregate((string a, string b) => a + "\r\n" + b));
				}
			}
			return sorted_list;
			bool Visit(TNode node, Stack<TNode> stack)
			{
				if (visited.Contains(node))
				{
					if (!sorted.Contains(node))
					{
						return false;
					}
				}
				else
				{
					visited.Add(node);
					stack.Push(node);
					foreach (TNode item in dependencySelector(node))
					{
						if (!Visit(item, stack))
						{
							return false;
						}
					}
					sorted.Add(node);
					sorted_list.Add(node);
					stack.Pop();
				}
				return true;
			}
		}

		private static bool TryResolveDllAssembly<T>(AssemblyName assemblyName, string directory, Func<string, T> loader, out T assembly) where T : class
		{
			assembly = null;
			List<string> list = new List<string>();
			list.Add(directory);
			list.AddRange(Directory.GetDirectories(directory, "*", SearchOption.AllDirectories));
			foreach (string item in list)
			{
				string text = Path.Combine(item, assemblyName.Name + ".dll");
				if (File.Exists(text))
				{
					try
					{
						assembly = loader(text);
					}
					catch (Exception)
					{
						continue;
					}
					return true;
				}
			}
			return false;
		}

		public static bool IsSubtypeOf(this TypeDefinition self, Type td)
		{
			if (((MemberReference)self).FullName == td.FullName)
			{
				return true;
			}
			if (((MemberReference)self).FullName != "System.Object")
			{
				TypeReference baseType = self.BaseType;
				return ((baseType == null) ? null : baseType.Resolve()?.IsSubtypeOf(td)).GetValueOrDefault();
			}
			return false;
		}

		public static bool TryResolveDllAssembly(AssemblyName assemblyName, string directory, out Assembly assembly)
		{
			return TryResolveDllAssembly(assemblyName, directory, (Func<string, Assembly>)Assembly.LoadFile, out assembly);
		}

		public static bool TryResolveDllAssembly(AssemblyName assemblyName, string directory, ReaderParameters readerParameters, out AssemblyDefinition assembly)
		{
			return TryResolveDllAssembly(assemblyName, directory, (Func<string, AssemblyDefinition>)((string s) => AssemblyDefinition.ReadAssembly(s, readerParameters)), out assembly);
		}

		public static bool TryOpenFileStream(string path, FileMode mode, out FileStream fileStream, FileAccess access = FileAccess.ReadWrite, FileShare share = FileShare.Read)
		{
			try
			{
				fileStream = new FileStream(path, mode, access, share);
				return true;
			}
			catch (IOException)
			{
				fileStream = null;
				return false;
			}
		}

		public static bool TryParseAssemblyName(string fullName, out AssemblyName assemblyName)
		{
			try
			{
				assemblyName = new AssemblyName(fullName);
				return true;
			}
			catch (Exception)
			{
				assemblyName = null;
				return false;
			}
		}

		public static IEnumerable<string> GetUniqueFilesInDirectories(IEnumerable<string> directories, string pattern = "*")
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
			foreach (string directory in directories)
			{
				string[] files = Directory.GetFiles(directory, pattern);
				foreach (string text in files)
				{
					string fileName = Path.GetFileName(text);
					if (!dictionary.ContainsKey(fileName))
					{
						dictionary[fileName] = text;
					}
				}
			}
			return dictionary.Values;
		}
	}
}
namespace BepInEx.Logging
{
	public class DiskLogListener : ILogListener, IDisposable
	{
		public LogLevel DisplayedLogLevel { get; set; }

		public TextWriter LogWriter { get; protected set; }

		public Timer FlushTimer { get; protected set; }

		public bool WriteFromUnityLog { get; set; }

		public DiskLogListener(string localPath, LogLevel displayedLogLevel = LogLevel.Info, bool appendLog = false, bool includeUnityLog = false)
		{
			WriteFromUnityLog = includeUnityLog;
			DisplayedLogLevel = displayedLogLevel;
			int num = 1;
			FileStream fileStream;
			while (!Utility.TryOpenFileStream(Path.Combine(Paths.BepInExRootPath, localPath), appendLog ? FileMode.Append : FileMode.Create, out fileStream, FileAccess.Write))
			{
				if (num == 5)
				{
					Logger.LogError("Couldn't open a log file for writing. Skipping log file creation");
					return;
				}
				Logger.LogWarning("Couldn't open log file '" + localPath + "' for writing, trying another...");
				localPath = $"LogOutput.log.{num++}";
			}
			LogWriter = TextWriter.Synchronized(new StreamWriter(fileStream, Utility.UTF8NoBom));
			FlushTimer = new Timer(delegate
			{
				LogWriter?.Flush();
			}, null, 2000, 2000);
		}

		public void LogEvent(object sender, LogEventArgs eventArgs)
		{
			if ((WriteFromUnityLog || !(eventArgs.Source is UnityLogSource)) && (eventArgs.Level & DisplayedLogLevel) != 0)
			{
				LogWriter.WriteLine(eventArgs.ToString());
			}
		}

		public void Dispose()
		{
			FlushTimer?.Dispose();
			LogWriter?.Flush();
			LogWriter?.Dispose();
		}

		~DiskLogListener()
		{
			Dispose();
		}
	}
	internal class HarmonyLogSource : ILogSource, IDisposable
	{
		private static readonly ConfigEntry<LogChannel> LogChannels = ConfigFile.CoreConfig.Bind<LogChannel>("Harmony.Logger", "LogChannels", (LogChannel)24, "Specifies which Harmony log channels to listen to.\nNOTE: IL channel dumps the whole patch methods, use only when needed!");

		private static readonly Dictionary<LogChannel, LogLevel> LevelMap = new Dictionary<LogChannel, LogLevel>
		{
			[(LogChannel)2] = LogLevel.Info,
			[(LogChannel)8] = LogLevel.Warning,
			[(LogChannel)16] = LogLevel.Error,
			[(LogChannel)4] = LogLevel.Debug
		};

		public string SourceName { get; } = "HarmonyX";


		public event EventHandler<LogEventArgs> LogEvent;

		public HarmonyLogSource()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Logger.ChannelFilter = LogChannels.Value;
			Logger.MessageReceived += HandleHarmonyMessage;
		}

		private void HandleHarmonyMessage(object sender, LogEventArgs e)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (LevelMap.TryGetValue(e.LogChannel, out var value))
			{
				this.LogEvent?.Invoke(this, new LogEventArgs(e.Message, value, this));
			}
		}

		public void Dispose()
		{
			Logger.MessageReceived -= HandleHarmonyMessage;
		}
	}
	public class LogEventArgs : EventArgs
	{
		public object Data { get; protected set; }

		public LogLevel Level { get; protected set; }

		public ILogSource Source { get; protected set; }

		public LogEventArgs(object data, LogLevel level, ILogSource source)
		{
			Data = data;
			Level = level;
			Source = source;
		}

		public override string ToString()
		{
			return $"[{Level,-7}:{Source.SourceName,10}] {Data}";
		}

		public string ToStringLine()
		{
			return ToString() + Environment.NewLine;
		}
	}
	public static class Logger
	{
		private class LogSourceCollection : List<ILogSource>, ICollection<ILogSource>, IEnumerable<ILogSource>, IEnumerable
		{
			void ICollection<ILogSource>.Add(ILogSource item)
			{
				if (item == null)
				{
					throw new ArgumentNullException("item", "Log sources cannot be null when added to the source list.");
				}
				item.LogEvent += InternalLogEvent;
				Add(item);
			}

			void ICollection<ILogSource>.Clear()
			{
				ILogSource[] array = ToArray();
				foreach (ILogSource item in array)
				{
					((ICollection<ILogSource>)this).Remove(item);
				}
			}

			bool ICollection<ILogSource>.Remove(ILogSource item)
			{
				if (item == null)
				{
					return false;
				}
				if (!Contains(item))
				{
					return false;
				}
				item.LogEvent -= InternalLogEvent;
				Remove(item);
				return true;
			}
		}

		private static readonly ManualLogSource InternalLogSource = CreateLogSource("BepInEx");

		private static bool internalLogsInitialized;

		public static ICollection<ILogListener> Listeners { get; } = new List<ILogListener>();


		public static ICollection<ILogSource> Sources { get; } = new LogSourceCollection();


		internal static void InitializeInternalLoggers()
		{
			if (!internalLogsInitialized)
			{
				Sources.Add(new HarmonyLogSource());
				internalLogsInitialized = true;
			}
		}

		internal static void InternalLogEvent(object sender, LogEventArgs eventArgs)
		{
			foreach (ILogListener listener in Listeners)
			{
				listener?.LogEvent(sender, eventArgs);
			}
		}

		internal static void Log(LogLevel level, object data)
		{
			InternalLogSource.Log(level, data);
		}

		internal static void LogFatal(object data)
		{
			Log(LogLevel.Fatal, data);
		}

		internal static void LogError(object data)
		{
			Log(LogLevel.Error, data);
		}

		internal static void LogWarning(object data)
		{
			Log(LogLevel.Warning, data);
		}

		internal static void LogMessage(object data)
		{
			Log(LogLevel.Message, data);
		}

		internal static void LogInfo(object data)
		{
			Log(LogLevel.Info, data);
		}

		internal static void LogDebug(object data)
		{
			Log(LogLevel.Debug, data);
		}

		public static ManualLogSource CreateLogSource(string sourceName)
		{
			ManualLogSource manualLogSource = new ManualLogSource(sourceName);
			Sources.Add(manualLogSource);
			return manualLogSource;
		}
	}
	[Flags]
	public enum LogLevel
	{
		None = 0,
		Fatal = 1,
		Error = 2,
		Warning = 4,
		Message = 8,
		Info = 0x10,
		Debug = 0x20,
		All = 0x3F
	}
	public static class LogLevelExtensions
	{
		public static LogLevel GetHighestLevel(this LogLevel levels)
		{
			Array values = Enum.GetValues(typeof(LogLevel));
			Array.Sort(values);
			foreach (LogLevel item in values)
			{
				if ((levels & item) != 0)
				{
					return item;
				}
			}
			return LogLevel.None;
		}

		public static ConsoleColor GetConsoleColor(this LogLevel level)
		{
			level = level.GetHighestLevel();
			return level switch
			{
				LogLevel.Fatal => ConsoleColor.Red, 
				LogLevel.Error => ConsoleColor.DarkRed, 
				LogLevel.Warning => ConsoleColor.Yellow, 
				LogLevel.Message => ConsoleColor.White, 
				LogLevel.Debug => ConsoleColor.DarkGray, 
				_ => ConsoleColor.Gray, 
			};
		}
	}
	public interface ILogListener : IDisposable
	{
		void LogEvent(object sender, LogEventArgs eventArgs);
	}
	public interface ILogSource : IDisposable
	{
		string SourceName { get; }

		event EventHandler<LogEventArgs> LogEvent;
	}
	public class ManualLogSource : ILogSource, IDisposable
	{
		public string SourceName { get; }

		public event EventHandler<LogEventArgs> LogEvent;

		public ManualLogSource(string sourceName)
		{
			SourceName = sourceName;
		}

		public void Log(LogLevel level, object data)
		{
			this.LogEvent?.Invoke(this, new LogEventArgs(data, level, this));
		}

		public void LogFatal(object data)
		{
			Log(LogLevel.Fatal, data);
		}

		public void LogError(object data)
		{
			Log(LogLevel.Error, data);
		}

		public void LogWarning(object data)
		{
			Log(LogLevel.Warning, data);
		}

		public void LogMessage(object data)
		{
			Log(LogLevel.Message, data);
		}

		public void LogInfo(object data)
		{
			Log(LogLevel.Info, data);
		}

		public void LogDebug(object data)
		{
			Log(LogLevel.Debug, data);
		}

		public void Dispose()
		{
		}
	}
	public class TraceLogSource : TraceListener
	{
		private static TraceLogSource traceListener;

		public static bool IsListening { get; protected set; }

		protected ManualLogSource LogSource { get; }

		public static ILogSource CreateSource()
		{
			if (traceListener == null)
			{
				traceListener = new TraceLogSource();
				Trace.Listeners.Add(traceListener);
				IsListening = true;
			}
			return traceListener.LogSource;
		}

		protected TraceLogSource()
		{
			LogSource = new ManualLogSource("Trace");
		}

		public override void Write(string message)
		{
			LogSource.LogInfo(message);
		}

		public override void WriteLine(string message)
		{
			LogSource.LogInfo(message);
		}

		public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
		{
			TraceEvent(eventCache, source, eventType, id, string.Format(format, args));
		}

		public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
		{
			LogSource.Log(eventType switch
			{
				TraceEventType.Critical => LogLevel.Fatal, 
				TraceEventType.Error => LogLevel.Error, 
				TraceEventType.Warning => LogLevel.Warning, 
				TraceEventType.Information => LogLevel.Info, 
				_ => LogLevel.Debug, 
			}, (message ?? "").Trim());
		}
	}
	public class ConsoleLogListener : ILogListener, IDisposable
	{
		private static readonly ConfigEntry<LogLevel> ConfigConsoleDisplayedLevel = ConfigFile.CoreConfig.Bind("Logging.Console", "LogLevels", LogLevel.Fatal | LogLevel.Error | LogLevel.Warning | LogLevel.Message | LogLevel.Info, "Which log levels to show in the console output.");

		internal bool WriteUnityLogs { get; set; } = true;


		public void LogEvent(object sender, LogEventArgs eventArgs)
		{
			if ((WriteUnityLogs || !(sender is UnityLogSource)) && (eventArgs.Level & ConfigConsoleDisplayedLevel.Value) != 0)
			{
				ConsoleManager.SetConsoleColor(eventArgs.Level.GetConsoleColor());
				ConsoleManager.ConsoleStream?.Write(eventArgs.ToStringLine());
				ConsoleManager.SetConsoleColor(ConsoleColor.Gray);
			}
		}

		public void Dispose()
		{
		}
	}
	public class UnityLogListener : ILogListener, IDisposable
	{
		internal static readonly Action<string> WriteStringToUnityLog;

		private ConfigEntry<bool> LogConsoleToUnity = ConfigFile.CoreConfig.Bind("Logging", "LogConsoleToUnityLog", defaultValue: false, new StringBuilder().AppendLine("If enabled, writes Standard Output messages to Unity log").AppendLine("NOTE: By default, Unity does so automatically. Only use this option if no console messages are visible in Unity log").ToString());

		static UnityLogListener()
		{
			MethodInfo[] methods = typeof(UnityLogWriter).GetMethods(BindingFlags.Static | BindingFlags.Public);
			foreach (MethodInfo methodInfo in methods)
			{
				try
				{
					methodInfo.Invoke(null, new object[1] { "" });
				}
				catch
				{
					continue;
				}
				WriteStringToUnityLog = (Action<string>)Delegate.CreateDelegate(typeof(Action<string>), methodInfo);
				break;
			}
			if (WriteStringToUnityLog == null)
			{
				Logger.LogError("Unable to start Unity log writer");
			}
		}

		public void LogEvent(object sender, LogEventArgs eventArgs)
		{
			if (!(eventArgs.Source is UnityLogSource) && (LogConsoleToUnity.Value || eventArgs.Source.SourceName != "Console"))
			{
				WriteStringToUnityLog?.Invoke(eventArgs.ToStringLine());
			}
		}

		public void Dispose()
		{
		}
	}
	public class UnityLogSource : ILogSource, IDisposable
	{
		private bool disposed;

		public string SourceName { get; } = "Unity Log";


		public event EventHandler<LogEventArgs> LogEvent;

		private static event EventHandler<LogEventArgs> InternalUnityLogMessage;

		public UnityLogSource()
		{
			InternalUnityLogMessage += UnityLogMessageHandler;
		}

		private void UnityLogMessageHandler(object sender, LogEventArgs eventArgs)
		{
			LogEventArgs e = new LogEventArgs(eventArgs.Data, eventArgs.Level, this);
			this.LogEvent?.Invoke(this, e);
		}

		public void Dispose()
		{
			if (!disposed)
			{
				InternalUnityLogMessage -= UnityLogMessageHandler;
				disposed = true;
			}
		}

		static UnityLogSource()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			LogCallback val = new LogCallback(OnUnityLogMessageReceived);
			EventInfo @event = typeof(Application).GetEvent("logMessageReceived", BindingFlags.Static | BindingFlags.Public);
			if ((object)@event != null)
			{
				@event.AddEventHandler(null, (Delegate?)(object)val);
				return;
			}
			typeof(Application).GetMethod("RegisterLogCallback", BindingFlags.Static | BindingFlags.Public).Invoke(null, new object[1] { val });
		}

		private static void OnUnityLogMessageReceived(string message, string stackTrace, LogType type)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected I4, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Invalid comparison between Unknown and I4
			LogLevel level;
			switch ((int)type)
			{
			case 0:
			case 1:
			case 4:
				level = LogLevel.Error;
				break;
			case 2:
				level = LogLevel.Warning;
				break;
			default:
				level = LogLevel.Info;
				break;
			}
			if ((int)type == 4)
			{
				message = message + "\nStack trace:\n" + stackTrace;
			}
			UnityLogSource.InternalUnityLogMessage?.Invoke(null, new LogEventArgs(message, level, null));
		}
	}
}
namespace BepInEx.Bootstrap
{
	public static class Chainloader
	{
		private static readonly List<BaseUnityPlugin> _plugins = new List<BaseUnityPlugin>();

		private static bool? isEditor;

		private static bool _loaded = false;

		private static bool _initialized = false;

		private static readonly string CurrentAssemblyName = Assembly.GetExecutingAssembly().GetName().Name;

		private static readonly Version CurrentAssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;

		internal static readonly ConfigEntry<bool> ConfigHideBepInExGOs = ConfigFile.CoreConfig.Bind("Chainloader", "HideManagerGameObject", defaultValue: false, new StringBuilder().AppendLine("If enabled, hides BepInEx Manager GameObject from Unity.").AppendLine("This can fix loading issues in some games that attempt to prevent BepInEx from being loaded.").AppendLine("Use this only if you know what this option means, as it can affect functionality of some older plugins.")
			.ToString());

		private static readonly ConfigEntry<bool> ConfigUnityLogging = ConfigFile.CoreConfig.Bind("Logging", "UnityLogListening", defaultValue: true, "Enables showing unity log messages in the BepInEx logging system.");

		private static readonly ConfigEntry<bool> ConfigDiskWriteUnityLog = ConfigFile.CoreConfig.Bind("Logging.Disk", "WriteUnityLog", defaultValue: false, "Include unity log messages in log file output.");

		private static readonly ConfigEntry<bool> ConfigDiskAppend = ConfigFile.CoreConfig.Bind("Logging.Disk", "AppendLog", defaultValue: false, "Appends to the log file instead of overwriting, on game startup.");

		private static readonly ConfigEntry<bool> ConfigDiskLogging = ConfigFile.CoreConfig.Bind("Logging.Disk", "Enabled", defaultValue: true, "Enables writing log messages to disk.");

		private static readonly ConfigEntry<LogLevel> ConfigDiskConsoleDisplayedLevel = ConfigFile.CoreConfig.Bind("Logging.Disk", "LogLevels", LogLevel.Fatal | LogLevel.Error | LogLevel.Warning | LogLevel.Message | LogLevel.Info, "Which log leves are saved to the disk log output.");

		public static Dictionary<string, PluginInfo> PluginInfos { get; } = new Dictionary<string, PluginInfo>();


		private static string UnityVersion
		{
			[MethodImpl(MethodImplOptions.NoInlining)]
			get
			{
				return Application.unityVersion;
			}
		}

		private static bool IsHeadless
		{
			get
			{
				MethodInfo methodInfo = AccessTools.PropertyGetter(typeof(Application), "isBatchMode");
				if ((object)methodInfo != null)
				{
					return (bool)methodInfo.Invoke(null, null);
				}
				return SystemInfo.graphicsDeviceID == 0;
			}
		}

		internal static bool IsEditor
		{
			[MethodImpl(MethodImplOptions.NoInlining)]
			get
			{
				bool? flag = isEditor;
				if (!flag.HasValue)
				{
					bool? flag2 = (isEditor = Application.isEditor);
					return flag2.GetValueOrDefault();
				}
				return flag.GetValueOrDefault();
			}
		}

		[Obsolete("Use PluginInfos instead")]
		public static List<BaseUnityPlugin> Plugins
		{
			get
			{
				lock (_plugins)
				{
					_plugins.RemoveAll((BaseUnityPlugin x) => (Object)(object)x == (Object)null);
					return _plugins.ToList();
				}
			}
		}

		public static List<string> DependencyErrors { get; } = new List<string>();


		public static GameObject ManagerObject { get; private set; }

		private static Regex allowedGuidRegex { get; } = new Regex("^[a-zA-Z0-9\\._\\-]+$");


		public static void Initialize(string gameExePath, bool startConsole = true, ICollection<LogEventArgs> preloaderLogEvents = null)
		{
			if (!_initialized)
			{
				ThreadingHelper.Initialize();
				if (gameExePath != null)
				{
					Paths.SetExecutablePath(gameExePath);
				}
				if (ConsoleManager.ConsoleEnabled && startConsole)
				{
					ConsoleManager.CreateConsole();
					Logger.Listeners.Add(new ConsoleLogListener());
				}
				Logger.InitializeInternalLoggers();
				if (ConfigDiskLogging.Value)
				{
					Logger.Listeners.Add(new DiskLogListener("LogOutput.log", ConfigDiskConsoleDisplayedLevel.Value, ConfigDiskAppend.Value, ConfigDiskWriteUnityLog.Value));
				}
				if (!TraceLogSource.IsListening)
				{
					Logger.Sources.Add(TraceLogSource.CreateSource());
				}
				ReplayPreloaderLogs(preloaderLogEvents);
				if (ConfigUnityLogging.Value)
				{
					Logger.Sources.Add(new UnityLogSource());
				}
				if (!IsHeadless)
				{
					Logger.Listeners.Add(new UnityLogListener());
				}
				else if (Logger.Listeners.FirstOrDefault((ILogListener l) => l is ConsoleLogListener) is ConsoleLogListener consoleLogListener)
				{
					consoleLogListener.WriteUnityLogs = false;
				}
				if (PlatformHelper.Is((Platform)8))
				{
					Logger.LogInfo("Detected Unity version: v" + UnityVersion);
				}
				Logger.LogMessage("Chainloader ready");
				_initialized = true;
			}
		}

		private static void ReplayPreloaderLogs(ICollection<LogEventArgs> preloaderLogEvents)
		{
			if (preloaderLogEvents == null)
			{
				return;
			}
			UnityLogListener item = new UnityLogListener();
			Logger.Listeners.Add(item);
			ILogListener logListener = Logger.Listeners.FirstOrDefault((ILogListener logger) => logger is ConsoleLogListener);
			if (logListener != null)
			{
				Logger.Listeners.Remove(logListener);
			}
			ManualLogSource manualLogSource = Logger.CreateLogSource("Preloader");
			foreach (LogEventArgs preloaderLogEvent in preloaderLogEvents)
			{
				Logger.InternalLogEvent(manualLogSource, preloaderLogEvent);
			}
			Logger.Sources.Remove(manualLogSource);
			Logger.Listeners.Remove(item);
			if (logListener != null)
			{
				Logger.Listeners.Add(logListener);
			}
		}

		public static PluginInfo ToPluginInfo(TypeDefinition type)
		{
			if (type.IsInterface || type.IsAbstract)
			{
				return null;
			}
			try
			{
				if (!type.IsSubtypeOf(typeof(BaseUnityPlugin)))
				{
					return null;
				}
			}
			catch (AssemblyResolutionException)
			{
				return null;
			}
			BepInPlugin bepInPlugin = BepInPlugin.FromCecilType(type);
			if (bepInPlugin == null)
			{
				Logger.LogWarning("Skipping over type [" + ((MemberReference)type).FullName + "] as no metadata attribute is specified");
				return null;
			}
			if (string.IsNullOrEmpty(bepInPlugin.GUID) || !allowedGuidRegex.IsMatch(bepInPlugin.GUID))
			{
				Logger.LogWarning("Skipping type [" + ((MemberReference)type).FullName + "] because its GUID [" + bepInPlugin.GUID + "] is of an illegal format.");
				return null;
			}
			if (bepInPlugin.Version == null)
			{
				Logger.LogWarning("Skipping type [" + ((MemberReference)type).FullName + "] because its version is invalid.");
				return null;
			}
			if (bepInPlugin.Name == null)
			{
				Logger.LogWarning("Skipping type [" + ((MemberReference)type).FullName + "] because its name is null.");
				return null;
			}
			List<BepInProcess> processes = BepInProcess.FromCecilType(type);
			IEnumerable<BepInDependency> dependencies = BepInDependency.FromCecilType(type);
			IEnumerable<BepInIncompatibility> incompatibilities = BepInIncompatibility.FromCecilType(type);
			AssemblyNameReference? obj = ((IEnumerable<AssemblyNameReference>)((MemberReference)type).Module.AssemblyReferences).FirstOrDefault((Func<AssemblyNameReference, bool>)((AssemblyNameReference reference) => reference.Name == "BepInEx"));
			Version targettedBepInExVersion = ((obj != null) ? obj.Version : null) ?? new Version();
			return new PluginInfo
			{
				Metadata = bepInPlugin,
				Processes = processes,
				Dependencies = dependencies,
				Incompatibilities = incompatibilities,
				TypeName = ((MemberReference)type).FullName,
				TargettedBepInExVersion = targettedBepInExVersion
			};
		}

		private static bool HasBepinPlugins(AssemblyDefinition ass)
		{
			if (((IEnumerable<AssemblyNameReference>)ass.MainModule.AssemblyReferences).All((AssemblyNameReference r) => r.Name != CurrentAssemblyName))
			{
				return false;
			}
			if (ass.MainModule.GetTypeReferences().All((TypeReference r) => ((MemberReference)r).FullName != typeof(BepInPlugin).FullName))
			{
				return false;
			}
			return true;
		}

		private static bool PluginTargetsWrongBepin(PluginInfo pluginInfo)
		{
			Version targettedBepInExVersion = pluginInfo.TargettedBepInExVersion;
			if (targettedBepInExVersion.Major != CurrentAssemblyVersion.Major)
			{
				return true;
			}
			if (targettedBepInExVersion.Minor > CurrentAssemblyVersion.Minor)
			{
				return true;
			}
			if (targettedBepInExVersion.Minor < CurrentAssemblyVersion.Minor)
			{
				return false;
			}
			return targettedBepInExVersion.Build > CurrentAssemblyVersion.Build;
		}

		public static void Start()
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			if (_loaded)
			{
				return;
			}
			if (!_initialized)
			{
				throw new InvalidOperationException("BepInEx has not been initialized. Please call Chainloader.Initialize prior to starting the chainloader instance.");
			}
			if (!Directory.Exists(Paths.PluginPath))
			{
				Directory.CreateDirectory(Paths.PluginPath);
			}
			if (!Directory.Exists(Paths.PatcherPluginPath))
			{
				Directory.CreateDirectory(Paths.PatcherPluginPath);
			}
			try
			{
				PropertyInfo property = typeof(Application).GetProperty("productName", BindingFlags.Static | BindingFlags.Public);
				if (ConsoleManager.ConsoleActive)
				{
					ConsoleManager.SetConsoleTitle($"{CurrentAssemblyName} {CurrentAssemblyVersion} - {property?.GetValue(null, null) ?? Paths.ProcessName}");
				}
				Logger.LogMessage("Chainloader started");
				ManagerObject = new GameObject("BepInEx_Manager");
				if (ConfigHideBepInExGOs.Value)
				{
					((Object)ManagerObject).hideFlags = (HideFlags)61;
				}
				Object.DontDestroyOnLoad((Object)(object)ManagerObject);
				Dictionary<string, List<PluginInfo>> dictionary = TypeLoader.FindPluginTypes(Paths.PluginPath, ToPluginInfo, HasBepinPlugins, "chainloader");
				foreach (KeyValuePair<string, List<PluginInfo>> item in dictionary)
				{
					foreach (PluginInfo item2 in item.Value)
					{
						item2.Location = item.Key;
					}
				}
				List<PluginInfo> list = dictionary.SelectMany((KeyValuePair<string, List<PluginInfo>> p) => p.Value).ToList();
				Dictionary<string, Assembly> dictionary2 = new Dictionary<string, Assembly>();
				Logger.LogInfo(string.Format("{0} plugin{1} to load", list.Count, (PluginInfos.Count == 1) ? "" : "s"));
				SortedDictionary<string, IEnumerable<string>> dependencyDict = new SortedDictionary<string, IEnumerable<string>>(StringComparer.InvariantCultureIgnoreCase);
				Dictionary<string, PluginInfo> pluginsByGUID = new Dictionary<string, PluginInfo>();
				foreach (IGrouping<string, PluginInfo> item3 in from info in list
					group info by info.Metadata.GUID)
				{
					PluginInfo pluginInfo = null;
					foreach (PluginInfo item4 in item3.OrderByDescending((PluginInfo x) => x.Metadata.Version))
					{
						if (pluginInfo != null)
						{
							Logger.LogWarning($"Skipping [{item4}] because a newer version exists ({pluginInfo})");
							continue;
						}
						List<BepInProcess> list2 = item4.Processes.ToList();
						if (list2.Count != 0 && list2.All((BepInProcess x) => !string.Equals(x.ProcessName.Replace(".exe", ""), Paths.ProcessName, StringComparison.InvariantCultureIgnoreCase)))
						{
							Logger.LogWarning(string.Format("Skipping [{0}] because of process filters ({1})", item4, string.Join(", ", item4.Processes.Select((BepInProcess p) => p.ProcessName).ToArray())));
							continue;
						}
						pluginInfo = item4;
						dependencyDict[item4.Metadata.GUID] = item4.Dependencies.Select((BepInDependency d) => d.DependencyGUID);
						pluginsByGUID[item4.Metadata.GUID] = item4;
					}
				}
				foreach (PluginInfo item5 in pluginsByGUID.Values.ToList())
				{
					if (item5.Incompatibilities.Any((BepInIncompatibility incompatibility) => pluginsByGUID.ContainsKey(incompatibility.IncompatibilityGUID)))
					{
						pluginsByGUID.Remove(item5.Metadata.GUID);
						dependencyDict.Remove(item5.Metadata.GUID);
						string[] value = (from x in item5.Incompatibilities
							select x.IncompatibilityGUID into x
							where pluginsByGUID.ContainsKey(x)
							select x).ToArray();
						string text = string.Format("Could not load [{0}] because it is incompatible with: {1}", item5, string.Join(", ", value));
						DependencyErrors.Add(text);
						Logger.LogError(text);
					}
					else if (PluginTargetsWrongBepin(item5))
					{
						string text2 = $"Plugin [{item5}] targets a wrong version of BepInEx ({item5.TargettedBepInExVersion}) and might not work until you update";
						DependencyErrors.Add(text2);
						Logger.LogWarning(text2);
					}
				}
				string[] emptyDependencies = new string[0];
				IEnumerable<string> value5;
				List<string> list3 = Utility.TopologicalSort(dependencyDict.Keys, (string x) => (!dependencyDict.TryGetValue(x, out value5)) ? emptyDependencies : value5).ToList();
				HashSet<string> hashSet = new HashSet<string>();
				Dictionary<string, Version> dictionary3 = new Dictionary<string, Version>();
				foreach (string item6 in list3)
				{
					if (!pluginsByGUID.TryGetValue(item6, out var value2))
					{
						continue;
					}
					bool flag = false;
					List<BepInDependency> list4 = new List<BepInDependency>();
					foreach (BepInDependency dependency in value2.Dependencies)
					{
						if (!dictionary3.TryGetValue(dependency.DependencyGUID, out var value3) || value3 < dependency.MinimumVersion)
						{
							if (IsHardDependency(dependency))
							{
								list4.Add(dependency);
							}
						}
						else if (hashSet.Contains(dependency.DependencyGUID) && IsHardDependency(dependency))
						{
							flag = true;
							break;
						}
					}
					dictionary3.Add(item6, value2.Metadata.Version);
					if (flag)
					{
						string text3 = $"Skipping [{value2}] because it has a dependency that was not loaded. See previous errors for details.";
						DependencyErrors.Add(text3);
						Logger.LogWarning(text3);
						continue;
					}
					if (list4.Count != 0)
					{
						string text4 = string.Format("Could not load [{0}] because it has missing dependencies: {1}", value2, string.Join(", ", list4.Select((BepInDependency s) => (!IsEmptyVersion(s.MinimumVersion)) ? $"{s.DependencyGUID} (v{s.MinimumVersion} or newer)" : s.DependencyGUID).ToArray()));
						DependencyErrors.Add(text4);
						Logger.LogError(text4);
						hashSet.Add(item6);
						continue;
					}
					try
					{
						Logger.LogInfo($"Loading [{value2}]");
						if (!dictionary2.TryGetValue(value2.Location, out var value4))
						{
							value4 = (dictionary2[value2.Location] = Assembly.LoadFile(value2.Location));
						}
						PluginInfos[item6] = value2;
						value2.Instance = (BaseUnityPlugin)(object)ManagerObject.AddComponent(value4.GetType(value2.TypeName));
						_plugins.Add(value2.Instance);
					}
					catch (Exception ex)
					{
						hashSet.Add(item6);
						PluginInfos.Remove(item6);
						Logger.LogError($"Error loading [{value2}] : {ex.Message}");
						if (ex is ReflectionTypeLoadException ex2)
						{
							Logger.LogDebug(TypeLoader.TypeLoadExceptionToString(ex2));
						}
						else
						{
							Logger.LogDebug(ex);
						}
					}
				}
			}
			catch (Exception ex3)
			{
				try
				{
					ConsoleManager.CreateConsole();
				}
				catch
				{
				}
				Logger.LogFatal("Error occurred starting the game");
				Logger.LogFatal(ex3.ToString());
			}
			Logger.LogMessage("Chainloader startup complete");
			_loaded = true;
			static bool IsEmptyVersion(Version v)
			{
				if (v.Major == 0 && v.Minor == 0 && v.Build <= 0)
				{
					return v.Revision <= 0;
				}
				return false;
			}
			static bool IsHardDependency(BepInDependency dep)
			{
				return (dep.Flags & BepInDependency.DependencyFlags.HardDependency) != 0;
			}
		}
	}
	public interface ICacheable
	{
		void Save(BinaryWriter bw);

		void Load(BinaryReader br);
	}
	public class CachedAssembly<T> where T : ICacheable
	{
		public List<T> CacheItems { get; set; }

		public long Timestamp { get; set; }
	}
	public static class TypeLoader
	{
		public static readonly DefaultAssemblyResolver Resolver;

		public static readonly ReaderParameters ReaderParameters;

		[CompilerGenerated]
		private static AssemblyResolveEventHandler m_AssemblyResolve;

		private static readonly ConfigEntry<bool> EnableAssemblyCache;

		public static event AssemblyResolveEventHandler AssemblyResolve
		{
			[CompilerGenerated]
			add
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Expected O, but got Unknown
				AssemblyResolveEventHandler val = TypeLoader.m_AssemblyResolve;
				AssemblyResolveEventHandler val2;
				do
				{
					val2 = val;
					AssemblyResolveEventHandler value2 = (AssemblyResolveEventHandler)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref TypeLoader.m_AssemblyResolve, value2, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Expected O, but got Unknown
				AssemblyResolveEventHandler val = TypeLoader.m_AssemblyResolve;
				AssemblyResolveEventHandler val2;
				do
				{
					val2 = val;
					AssemblyResolveEventHandler value2 = (AssemblyResolveEventHandler)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref TypeLoader.m_AssemblyResolve, value2, val2);
				}
				while (val != val2);
			}
		}

		static TypeLoader()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			EnableAssemblyCache = ConfigFile.CoreConfig.Bind("Caching", "EnableAssemblyCache", defaultValue: true, "Enable/disable assembly metadata cache\nEnabling this will speed up discovery of plugins and patchers by caching the metadata of all types BepInEx discovers.");
			Resolver = new DefaultAssemblyResolver();
			ReaderParameters = new ReaderParameters
			{
				AssemblyResolver = (IAssemblyResolver)(object)Resolver
			};
			((BaseAssemblyResolver)Resolver).ResolveFailure += (AssemblyResolveEventHandler)delegate(object sender, AssemblyNameReference reference)
			{
				if (!Utility.TryParseAssemblyName(reference.FullName, out var assemblyName))
				{
					AssemblyResolveEventHandler assemblyResolve = TypeLoader.AssemblyResolve;
					if (assemblyResolve == null)
					{
						return null;
					}
					return assemblyResolve.Invoke(sender, reference);
				}
				foreach (string item in new string[3]
				{
					Paths.BepInExAssemblyDirectory,
					Paths.PluginPath,
					Paths.PatcherPluginPath
				}.Concat(Paths.DllSearchPaths))
				{
					if (Utility.TryResolveDllAssembly(assemblyName, item, ReaderParameters, out var assembly))
					{
						return assembly;
					}
				}
				AssemblyResolveEventHandler assemblyResolve2 = TypeLoader.AssemblyResolve;
				return (assemblyResolve2 == null) ? null : assemblyResolve2.Invoke(sender, reference);
			};
		}

		public static Dictionary<string, List<T>> FindPluginTypes<T>(string directory, Func<TypeDefinition, T> typeSelector, Func<AssemblyDefinition, bool> assemblyFilter = null, string cacheName = null) where T : ICacheable, new()
		{
			Dictionary<string, List<T>> dictionary = new Dictionary<string, List<T>>();
			Dictionary<string, CachedAssembly<T>> dictionary2 = null;
			if (cacheName != null)
			{
				dictionary2 = LoadAssemblyCache<T>(cacheName);
			}
			string[] files = Directory.GetFiles(Path.GetFullPath(directory), "*.dll", SearchOption.AllDirectories);
			foreach (string text in files)
			{
				try
				{
					if (dictionary2 != null && dictionary2.TryGetValue(text, out var value) && File.GetLastWriteTimeUtc(text).Ticks == value.Timestamp)
					{
						dictionary[text] = value.CacheItems;
						continue;
					}
					AssemblyDefinition val = AssemblyDefinition.ReadAssembly(text, ReaderParameters);
					if (assemblyFilter != null && !assemblyFilter(val))
					{
						dictionary[text] = new List<T>();
						val.Dispose();
						continue;
					}
					List<T> value2 = (from t in ((IEnumerable<TypeDefinition>)val.MainModule.Types).Select(typeSelector)
						where t != null
						select t).ToList();
					dictionary[text] = value2;
					val.Dispose();
				}
				catch (BadImageFormatException ex)
				{
					Logger.LogDebug("Skipping loading " + text + " because it's not a valid .NET assembly. Full error: " + ex.Message);
				}
				catch (Exception ex2)
				{
					Logger.LogError(ex2.ToString());
				}
			}
			if (cacheName != null)
			{
				SaveAssemblyCache(cacheName, dictionary);
			}
			return dictionary;
		}

		public static Dictionary<string, CachedAssembly<T>> LoadAssemblyCache<T>(string cacheName) where T : ICacheable, new()
		{
			if (!EnableAssemblyCache.Value)
			{
				return null;
			}
			Dictionary<string, CachedAssembly<T>> dictionary = new Dictionary<string, CachedAssembly<T>>();
			try
			{
				string path = Path.Combine(Paths.CachePath, cacheName + "_typeloader.dat");
				if (!File.Exists(path))
				{
					return null;
				}
				using BinaryReader binaryReader = new BinaryReader(File.OpenRead(path));
				int num = binaryReader.ReadInt32();
				for (int i = 0; i < num; i++)
				{
					string key = binaryReader.ReadString();
					long timestamp = binaryReader.ReadInt64();
					int num2 = binaryReader.ReadInt32();
					List<T> list = new List<T>();
					for (int j = 0; j < num2; j++)
					{
						T item = new T();
						item.Load(binaryReader);
						list.Add(item);
					}
					dictionary[key] = new CachedAssembly<T>
					{
						Timestamp = timestamp,
						CacheItems = list
					};
				}
			}
			catch (Exception ex)
			{
				Logger.LogWarning("Failed to load cache \"" + cacheName + "\"; skipping loading cache. Reason: " + ex.Message + ".");
			}
			return dictionary;
		}

		public static void SaveAssemblyCache<T>(string cacheName, Dictionary<string, List<T>> entries) where T : ICacheable
		{
			if (!EnableAssemblyCache.Value)
			{
				return;
			}
			try
			{
				if (!Directory.Exists(Paths.CachePath))
				{
					Directory.CreateDirectory(Paths.CachePath);
				}
				using BinaryWriter binaryWriter = new BinaryWriter(File.OpenWrite(Path.Combine(Paths.CachePath, cacheName + "_typeloader.dat")));
				binaryWriter.Write(entries.Count);
				foreach (KeyValuePair<string, List<T>> entry in entries)
				{
					binaryWriter.Write(entry.Key);
					binaryWriter.Write(File.GetLastWriteTimeUtc(entry.Key).Ticks);
					binaryWriter.Write(entry.Value.Count);
					foreach (T item in entry.Value)
					{
						item.Save(binaryWriter);
					}
				}
			}
			catch (Exception ex)
			{
				Logger.LogWarning("Failed to save cache \"" + cacheName + "\"; skipping saving cache. Reason: " + ex.Message + ".");
			}
		}

		public static string TypeLoadExceptionToString(ReflectionTypeLoadException ex)
		{
			StringBuilder stringBuilder = new StringBuilder();
			Exception[] loaderExceptions = ex.LoaderExceptions;
			foreach (Exception ex2 in loaderExceptions)
			{
				stringBuilder.AppendLine(ex2.Message);
				if (ex2 is FileNotFoundException ex3)
				{
					if (!string.IsNullOrEmpty(ex3.FusionLog))
					{
						stringBuilder.AppendLine("Fusion Log:");
						stringBuilder.AppendLine(ex3.FusionLog);
					}
				}
				else if (ex2 is FileLoadException ex4 && !string.IsNullOrEmpty(ex4.FusionLog))
				{
					stringBuilder.AppendLine("Fusion Log:");
					stringBuilder.AppendLine(ex4.FusionLog);
				}
				stringBuilder.AppendLine();
			}
			return stringBuilder.ToString();
		}
	}
}
namespace BepInEx.ConsoleUtil
{
	internal class Kon
	{
		private struct CONSOLE_SCREEN_BUFFER_INFO
		{
			internal COORD dwSize;

			internal COORD dwCursorPosition;

			internal short wAttributes;

			internal SMALL_RECT srWindow;

			internal COORD dwMaximumWindowSize;
		}

		private struct COORD
		{
			internal short X;

			internal short Y;
		}

		private struct SMALL_RECT
		{
			internal short Left;

			internal short Top;

			internal short Right;

			internal short Bottom;
		}

		private static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);

		internal static IntPtr conOut = IntPtr.Zero;

		public static ConsoleColor ForegroundColor
		{
			get
			{
				return GetConsoleColor(isBackground: false);
			}
			set
			{
				SetConsoleColor(isBackground: false, value);
			}
		}

		public static ConsoleColor BackgroundColor
		{
			get
			{
				return GetConsoleColor(isBackground: true);
			}
			set
			{
				SetConsoleColor(isBackground: true, value);
			}
		}

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern bool GetConsoleScreenBufferInfo(IntPtr hConsoleOutput, out CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern bool SetConsoleTextAttribute(IntPtr hConsoleOutput, short attributes);

		[DllImport("kernel32.dll", SetLastError = true)]
		private static extern IntPtr GetStdHandle(int nStdHandle);

		private static short ConsoleColorToColorAttribute(short color, bool isBackground)
		{
			if (((uint)color & 0xFFFFFFF0u) != 0)
			{
				throw new ArgumentException("Arg_InvalidConsoleColor");
			}
			if (isBackground)
			{
				color <<= 4;
			}
			return color;
		}

		private static CONSOLE_SCREEN_BUFFER_INFO GetBufferInfo(bool throwOnNoConsole, out bool succeeded)
		{
			succeeded = false;
			if (!(conOut == INVALID_HANDLE_VALUE))
			{
				if (!GetConsoleScreenBufferInfo(conOut, out var lpConsoleScreenBufferInfo))
				{
					bool consoleScreenBufferInfo = GetConsoleScreenBufferInfo(GetStdHandle(-12), out lpConsoleScreenBufferInfo);
					if (!consoleScreenBufferInfo)
					{
						consoleScreenBufferInfo = GetConsoleScreenBufferInfo(GetStdHandle(-10), out lpConsoleScreenBufferInfo);
					}
					if (!consoleScreenBufferInfo && Marshal.GetLastWin32Error() == 6 && !throwOnNoConsole)
					{
						return default(CONSOLE_SCREEN_BUFFER_INFO);
					}
				}
				succeeded = true;
				return lpConsoleScreenBufferInfo;
			}
			if (!throwOnNoConsole)
			{
				return default(CONSOLE_SCREEN_BUFFER_INFO);
			}
			throw new Exception("IO.IO_NoConsole");
		}

		private static void SetConsoleColor(bool isBackground, ConsoleColor c)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			((CodeAccessPermission)new UIPermission((UIPermissionWindow)2)).Demand();
			short num = ConsoleColorToColorAttribute((short)c, isBackground);
			bool succeeded;
			CONSOLE_SCREEN_BUFFER_INFO bufferInfo = GetBufferInfo(throwOnNoConsole: false, out succeeded);
			if (succeeded)
			{
				short wAttributes = bufferInfo.wAttributes;
				wAttributes &= (short)(isBackground ? (-241) : (-16));
				wAttributes = (short)((ushort)wAttributes | (ushort)num);
				SetConsoleTextAttribute(conOut, wAttributes);
			}
		}

		private static ConsoleColor GetConsoleColor(bool isBackground)
		{
			bool succeeded;
			CONSOLE_SCREEN_BUFFER_INFO bufferInfo = GetBufferInfo(throwOnNoConsole: false, out succeeded);
			if (!succeeded)
			{
				if (!isBackground)
				{
					return ConsoleColor.Gray;
				}
				return ConsoleColor.Black;
			}
			return ColorAttributeToConsoleColor((short)(bufferInfo.wAttributes & 0xF0));
		}

		private static ConsoleColor ColorAttributeToConsoleColor(short c)
		{
			if ((short)((uint)c & 0xFFu) != 0)
			{
				c >>= 4;
			}
			return (ConsoleColor)c;
		}

		public static void ResetConsoleColor()
		{
			SetConsoleColor(isBackground: true, ConsoleColor.Black);
			SetConsoleColor(isBackground: false, ConsoleColor.Gray);
		}
	}
}
namespace BepInEx.Unix
{
	internal static class ConsoleWriter
	{
		private static Func<Stream, Encoding, bool, StreamWriter> cStreamWriterConstructor;

		private static Func<Stream, Encoding, bool, StreamWriter> CStreamWriterConstructor
		{
			get
			{
				if (cStreamWriterConstructor != null)
				{
					return cStreamWriterConstructor;
				}
				Type cStreamWriter = AccessTools.TypeByName("System.IO.CStreamWriter");
				cStreamWriterConstructor = new int[2][]
				{
					new int[3] { 0, 1, 2 },
					new int[2] { 0, 1 }
				}.Select(GetCtor).FirstOrDefault((Func<Stream, Encoding, bool, StreamWriter> f) => f != null);
				if (cStreamWriterConstructor == null)
				{
					throw new AmbiguousMatchException("Failed to find suitable constructor for CStreamWriter");
				}
				return cStreamWriterConstructor;
				Func<Stream, Encoding, bool, StreamWriter> GetCtor(int[] perm)
				{
					Type[] parameters = new Type[3]
					{
						typeof(Stream),
						typeof(Encoding),
						typeof(bool)
					};
					ConstructorInfo ctor = AccessTools.Constructor(cStreamWriter, perm.Select((int i) => parameters[i]).ToArray(), false);
					if ((object)ctor != null)
					{
						return delegate(Stream stream, Encoding encoding, bool l)
						{
							object[] vals = new object[3] { stream, encoding, l };
							return (StreamWriter)ctor.Invoke(perm.Select((int i) => vals[i]).ToArray());
						};
					}
					return null;
				}
			}
		}

		public static TextWriter CreateConsoleStreamWriter(Stream stream, Encoding encoding, bool leaveOpen)
		{
			StreamWriter streamWriter = CStreamWriterConstructor(stream, encoding, leaveOpen);
			streamWriter.AutoFlush = true;
			return streamWriter;
		}
	}
	internal class LinuxConsoleDriver : IConsoleDriver
	{
		private static readonly ConfigEntry<bool> ForceCustomTtyDriverConfig;

		public static bool UseMonoTtyDriver { get; }

		public TextWriter StandardOut { get; private set; }

		public TextWriter ConsoleOut { get; private set; }

		public bool ConsoleActive { get; private set; }

		public bool ConsoleIsExternal => false;

		public bool StdoutRedirected { get; private set; }

		public TtyInfo TtyInfo { get; private set; }

		static LinuxConsoleDriver()
		{
			ForceCustomTtyDriverConfig = ConfigFile.CoreConfig.Bind("Logging.Console", "ForceBepInExTTYDriver", defaultValue: false, "If enabled, forces to use custom BepInEx TTY driver for handling terminal output on unix.");
			UseMonoTtyDriver = false;
			if (!ForceCustomTtyDriverConfig.Value && (object)typeof(Console).Assembly.GetType("System.ConsoleDriver") != null)
			{
				UseMonoTtyDriver = (object)typeof(Console).Assembly.GetType("System.ParameterizedStrings") != null;
			}
		}

		public void PreventClose()
		{
		}

		public void Initialize(bool alreadyActive)
		{
			ConsoleActive = true;
			StdoutRedirected = UnixStreamHelper.isatty(1) != 1;
			Stream stream = UnixStreamHelper.CreateDuplicateStream(1);
			if (UseMonoTtyDriver && !StdoutRedirected)
			{
				TextWriter textWriter = ConsoleWriter.CreateConsoleStreamWriter(stream, Console.Out.Encoding, leaveOpen: true);
				StandardOut = TextWriter.Synchronized(textWriter);
				object value = AccessTools.Field(AccessTools.TypeByName("System.ConsoleDriver"), "driver").GetValue(null);
				AccessTools.Field(AccessTools.TypeByName("System.TermInfoDriver"), "stdout").SetValue(value, textWriter);
			}
			else
			{
				StreamWriter streamWriter = new StreamWriter(stream, Console.Out.Encoding);
				streamWriter.AutoFlush = true;
				StandardOut = TextWriter.Synchronized(streamWriter);
				TtyInfo = TtyHandler.GetTtyInfo();
			}
			ConsoleOut = StandardOut;
		}

		public void CreateConsole(uint codepage)
		{
			Logger.LogWarning("An external console currently cannot be spawned on a Unix platform.");
		}

		public void DetachConsole()
		{
			throw new PlatformNotSupportedException("Cannot detach console on a Unix platform");
		}

		public void SetConsoleColor(ConsoleColor color)
		{
			if (!StdoutRedirected)
			{
				if (UseMonoTtyDriver)
				{
					SafeConsole.ForegroundColor = color;
				}
				else
				{
					ConsoleOut.Write(TtyInfo.GetAnsiCode(color));
				}
			}
		}

		public void SetConsoleTitle(string title)
		{
			if (!StdoutRedirected)
			{
				if (UseMonoTtyDriver && SafeConsole.TitleExists)
				{
					SafeConsole.Title = title;
				}
				else
				{
					ConsoleOut.Write("\u001b]2;" + title.Replace("\\", "\\\\") + "\a");
				}
			}
		}
	}
	internal class TtyInfo
	{
		public string TerminalType { get; set; } = "default";


		public int MaxColors { get; set; }

		public string[] ForegroundColorStrings { get; set; }

		public static TtyInfo Default { get; } = new TtyInfo
		{
			MaxColors = 0
		};


		public string GetAnsiCode(ConsoleColor color)
		{
			if (MaxColors <= 0 || ForegroundColorStrings == null)
			{
				return string.Empty;
			}
			int num = (int)color % MaxColors;
			return ForegroundColorStrings[num];
		}
	}
	internal static class TtyHandler
	{
		private static readonly string[] ncursesLocations = new string[4] { "/usr/share/terminfo", "/etc/terminfo", "/usr/lib/terminfo", "/lib/terminfo" };

		private static string TryTermInfoDir(string dir, string term)
		{
			string text = $"{dir}/{(int)term[0]:x}/{term}";
			if (File.Exists(text))
			{
				return text;
			}
			text = Utility.CombinePaths(dir, term.Substring(0, 1), term);
			if (File.Exists(text))
			{
				return text;
			}
			return null;
		}

		private static string FindTermInfoPath(string term)
		{
			if (string.IsNullOrEmpty(term))
			{
				return null;
			}
			string environmentVariable = Environment.GetEnvironmentVariable("TERMINFO");
			if (environmentVariable != null && Directory.Exists(environmentVariable))
			{
				string text = TryTermInfoDir(environmentVariable, term);
				if (text != null)
				{
					return text;
				}
			}
			string[] array = ncursesLocations;
			foreach (string text2 in array)
			{
				if (Directory.Exists(text2))
				{
					string text3 = TryTermInfoDir(text2, term);
					if (text3 != null)
					{
						return text3;
					}
				}
			}
			return null;
		}

		public static TtyInfo GetTtyInfo(string terminal = null)
		{
			terminal = terminal ?? Environment.GetEnvironmentVariable("TERM");
			string text = FindTermInfoPath(terminal);
			if (text == null)
			{
				return TtyInfo.Default;
			}
			TtyInfo ttyInfo = TtyInfoParser.Parse(File.ReadAllBytes(text));
			ttyInfo.TerminalType = terminal;
			return ttyInfo;
		}
	}
	internal static class TtyInfoParser
	{
		internal enum TermInfoNumbers
		{
			MaxColors = 13
		}

		internal enum TermInfoStrings
		{
			SetAForeground = 359
		}

		private static readonly int[] ansiColorMapping = new int[16]
		{
			0, 4, 2, 6, 1, 5, 3, 7, 8, 12,
			10, 14, 9, 13, 11, 15
		};

		public static TtyInfo Parse(byte[] buffer)
		{
			int num;
			switch (GetInt16(buffer, 0))
			{
			case 282:
				num = 2;
				break;
			case 542:
				num = 4;
				break;
			default:
				return TtyInfo.Default;
			}
			int @int = GetInt16(buffer, 4);
			GetInt16(buffer, 6);
			GetInt16(buffer, 8);
			int num2 = 12 + GetString(buffer, 12).Length + 1 + @int;
			int offset = num2 + num2 % 2 + num * 13;
			return new TtyInfo
			{
				MaxColors = GetInteger(num, buffer, offset),
				ForegroundColorStrings = ansiColorMapping.Select((int x) => $"\u001b[{((x > 7) ? (82 + x) : (30 + x))}m").ToArray()
			};
		}

		private static int GetInt32(byte[] buffer, int offset)
		{
			return buffer[offset] | (buffer[offset + 1] << 8) | (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24);
		}

		private static short GetInt16(byte[] buffer, int offset)
		{
			return (short)(buffer[offset] | (buffer[offset + 1] << 8));
		}

		private static int GetInteger(int intSize, byte[] buffer, int offset)
		{
			if (intSize != 2)
			{
				return GetInt32(buffer, offset);
			}
			return GetInt16(buffer, offset);
		}

		private static string GetString(byte[] buffer, int offset)
		{
			int i;
			for (i = 0; buffer[offset + i] != 0; i++)
			{
			}
			return Encoding.ASCII.GetString(buffer, offset, i);
		}
	}
	internal class UnixStream : Stream
	{
		public override bool CanRead
		{
			get
			{
				if (Access != FileAccess.Read)
				{
					return Access == FileAccess.ReadWrite;
				}
				return true;
			}
		}

		public override bool CanSeek => false;

		public override bool CanWrite
		{
			get
			{
				if (Access != FileAccess.Write)
				{
					return Access == FileAccess.ReadWrite;
				}
				return true;
			}
		}

		public override long Length
		{
			get
			{
				throw new InvalidOperationException();
			}
		}

		public override long Position
		{
			get
			{
				throw new InvalidOperationException();
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		public FileAccess Access { get; }

		public IntPtr FileHandle { get; }

		public UnixStream(int fileDescriptor, FileAccess access)
		{
			Access = access;
			int fd = UnixStreamHelper.dup(fileDescriptor);
			FileHandle = UnixStreamHelper.fdopen(fd, (access == FileAccess.Write) ? "w" : "r");
		}

		public override void Flush()
		{
			UnixStreamHelper.fflush(FileHandle);
		}

		public override long Seek(long offset, SeekOrigin origin)
		{
			throw new InvalidOperationException();
		}

		public override void SetLength(long value)
		{
			throw new InvalidOperationException();
		}

		public override int Read(byte[] buffer, int offset, int count)
		{
			GCHandle gCHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
			IntPtr intPtr = UnixStreamHelper.fread(new IntPtr(gCHandle.AddrOfPinnedObject().ToInt64() + offset), (IntPtr)count, (IntPtr)1, FileHandle);
			gCHandle.Free();
			return intPtr.ToInt32();
		}

		public override void Write(byte[] buffer, int offset, int count)
		{
			GCHandle gCHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
			UnixStreamHelper.fwrite(new IntPtr(gCHandle.AddrOfPinnedObject().ToInt64() + offset), (IntPtr)count, (IntPtr)1, FileHandle);
			gCHandle.Free();
		}

		private void ReleaseUnmanagedResources()
		{
			UnixStreamHelper.fclose(FileHandle);
		}

		protected override void Dispose(bool disposing)
		{
			ReleaseUnmanagedResources();
			base.Dispose(disposing);
		}

		~UnixStream()
		{
			Dispose(disposing: false);
		}
	}
	internal static class UnixStreamHelper
	{
		public delegate int dupDelegate(int fd);

		public delegate IntPtr fdopenDelegate(int fd, string mode);

		public delegate IntPtr freadDelegate(IntPtr ptr, IntPtr size, IntPtr nmemb, IntPtr stream);

		public delegate int fwriteDelegate(IntPtr ptr, IntPtr size, IntPtr nmemb, IntPtr stream);

		public delegate int fcloseDelegate(IntPtr stream);

		public delegate int fflushDelegate(IntPtr stream);

		public delegate int isattyDelegate(int fd);

		[DynDllImport("libc", new string[] { })]
		public static dupDelegate dup;

		[DynDllImport("libc", new string[] { })]
		public static fdopenDelegate fdopen;

		[DynDllImport("libc", new string[] { })]
		public static freadDelegate fread;

		[DynDllImport("libc", new string[] { })]
		public static fwriteDelegate fwrite;

		[DynDllImport("libc", new string[] { })]
		public static fcloseDelegate fclose;

		[DynDllImport("libc", new string[] { })]
		public static fflushDelegate fflush;

		[DynDllImport("libc", new string[] { })]
		public static isattyDelegate isatty;

		static UnixStreamHelper()
		{
			Dictionary<string, List<DynDllMapping>> dictionary = new Dictionary<string, List<DynDllMapping>> { ["libc"] = new List<DynDllMapping>
			{
				DynDllMapping.op_Implicit("libc.so.6"),
				DynDllMapping.op_Implicit("libc"),
				DynDllMapping.op_Implicit("/usr/lib/libSystem.dylib")
			} };
			DynDll.ResolveDynDllImports(typeof(UnixStreamHelper), dictionary);
		}

		public static Stream CreateDuplicateStream(int fileDescriptor)
		{
			return new UnixStream(dup(fileDescriptor), FileAccess.Write);
		}
	}
}
namespace BepInEx.Configuration
{
	public abstract class AcceptableValueBase
	{
		public Type ValueType { get; }

		protected AcceptableValueBase(Type valueType)
		{
			ValueType = valueType;
		}

		public abstract object Clamp(object value);

		public abstract bool IsValid(object value);

		public abstract string ToDescriptionString();
	}
	public class AcceptableValueList<T> : AcceptableValueBase where T : IEquatable<T>
	{
		public virtual T[] AcceptableValues { get; }

		public AcceptableValueList(params T[] acceptableValues)
			: base(typeof(T))
		{
			if (acceptableValues == null)
			{
				throw new ArgumentNullException("acceptableValues");
			}
			if (acceptableValues.Length == 0)
			{
				throw new ArgumentException("At least one acceptable value is needed", "acceptableValues");
			}
			AcceptableValues = acceptableValues;
		}

		public override object Clamp(object value)
		{
			if (IsValid(value))
			{
				return value;
			}
			return AcceptableValues[0];
		}

		public override bool IsValid(object value)
		{
			if (value is T)
			{
				T v = (T)value;
				return AcceptableValues.Any((T x) => x.Equals(v));
			}
			return false;
		}

		public override string ToDescriptionString()
		{
			return "# Acceptable values: " + string.Join(", ", AcceptableValues.Select((T x) => x.ToString()).ToArray());
		}
	}
	public class AcceptableValueRange<T> : AcceptableValueBase where T : IComparable
	{
		public virtual T MinValue { get; }

		public virtual T MaxValue { get; }

		public AcceptableValueRange(T minValue, T maxValue)
			: base(typeof(T))
		{
			if (maxValue == null)
			{
				throw new ArgumentNullException("maxValue");
			}
			if (minValue == null)
			{
				throw new ArgumentNullException("minValue");
			}
			if (minValue.CompareTo(maxValue) >= 0)
			{
				throw new ArgumentException("minValue has to be lower than maxValue");
			}
			MinValue = minValue;
			MaxValue = maxValue;
		}

		public override object Clamp(object value)
		{
			if (MinValue.CompareTo(value) > 0)
			{
				return MinValue;
			}
			if (MaxValue.CompareTo(value) < 0)
			{
				return MaxValue;
			}
			return value;
		}

		public override bool IsValid(object value)
		{
			if (MinValue.CompareTo(value) <= 0)
			{
				return MaxValue.CompareTo(value) >= 0;
			}
			return false;
		}

		public override string ToDescriptionString()
		{
			return $"# Acceptable value range: From {MinValue} to {MaxValue}";
		}
	}
	public sealed class ConfigEntry<T> : ConfigEntryBase
	{
		private T _typedValue;

		public T Value
		{
			get
			{
				return _typedValue;
			}
			set
			{
				value = ClampValue(value);
				if (!object.Equals(_typedValue, value))
				{
					_typedValue = value;
					OnSettingChanged(this);
				}
			}
		}

		public override object BoxedValue
		{
			get
			{
				return Value;
			}
			set
			{
				Value = (T)value;
			}
		}

		public event EventHandler SettingChanged;

		internal ConfigEntry(ConfigFile configFile, ConfigDefinition definition, T defaultValue, ConfigDescription configDescription)
			: base(configFile, definition, typeof(T), defaultValue, configDescription)
		{
			configFile.SettingChanged += delegate(object sender, SettingChangedEventArgs args)
			{
				if (args.ChangedSetting == this)
				{
					this.SettingChanged?.Invoke(sender, args);
				}
			};
		}
	}
	public abstract class ConfigEntryBase
	{
		public ConfigFile

BestMod/bin/Debug/BestMod.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BestMod.Cards;
using HarmonyLib;
using UnboundLib.Cards;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("BestMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("BestMod")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9cd7e498-5d14-469a-870c-e17ccbf03a30")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BestMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.My.Mod.Id", "Best Mod", "1.1.0")]
	[BepInProcess("Rounds.exe")]
	public class BestMod : BaseUnityPlugin
	{
		private const string ModId = "com.My.Mod.Id";

		private const string ModName = "Best Mod";

		public const string Version = "1.1.0";

		public const string ModInitials = "BM";

		public static BestMod instance { get; private set; }

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.My.Mod.Id");
			val.PatchAll();
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<InfiniteJumps>();
			CustomCard.BuildCard<Heavy>();
			CustomCard.BuildCard<Floaty>();
			CustomCard.BuildCard<ZeroGravity>();
			CustomCard.BuildCard<NegGravity>();
			CustomCard.BuildCard<LazerOfDEATH>();
			CustomCard.BuildCard<EyeDestroyer>();
		}
	}
}
namespace BestMod.Cards
{
	internal class Floaty : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = 0.5f;
			statModifiers.health = 0.5f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Floaty";
		}

		protected override string GetDescription()
		{
			return "You have less gravity, but you have less health.";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Gravity",
					amount = "Less",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "Also Less",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class Heavy : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = 10f;
			statModifiers.health = 10f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Heavy";
		}

		protected override string GetDescription()
		{
			return "You have a lot of gravity, but also a lot of health.";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Gravity",
					amount = "A whole lot",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "Also a whole lot",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)6;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class InfiniteJumps : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.numberOfJumps = 999999;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Infinite Jumps!";
		}

		protected override string GetDescription()
		{
			return "Yes yes yes yes why isnt this a thing in normal rounds its so fun i think idk i havent tested it yet lol but yeah i think its cool";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Jumps",
					amount = "Way too many",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)0;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class EyeDestroyer : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.shake = 500f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Eye Destroyer";
		}

		protected override string GetDescription()
		{
			return "DO NOT PICK THIS CARD IF YOU DONT WANT TO LOSE FRIENDS";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Eyesores",
					amount = "A lot of",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)4;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class LazerOfDEATH : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.projectileSpeed = 100f;
			gun.attackSpeed = 100f;
			gun.reloadTime = 0f;
			gun.reflects = 1;
			gun.spread = 0f;
			gun.timeBetweenBullets = 0f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Lazer Of DEATH";
		}

		protected override string GetDescription()
		{
			return "Uh yeah uh oh";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Lazerness",
					amount = "A whole lot of epic",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class Template : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "CardName";
		}

		protected override string GetDescription()
		{
			return "CardDescription";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Effect",
					amount = "No",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class NegGravity : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = -1f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Negitive Gravity";
		}

		protected override string GetDescription()
		{
			return "How does this even work?!?!?!?!!!";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Gravity",
					amount = "Opposite",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)4;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class ZeroGravity : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = 0f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Zero Gravity";
		}

		protected override string GetDescription()
		{
			return "Who needs gravity when you got... not gravity!";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Gravity",
					amount = "Basically No",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)3;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
}

BestMod/bin/Debug/CardChoiceSpawnUniqueCardPatch.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using ModdingUtils.Utils;
using UnboundLib.Cards;
using UnboundLib.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("CardChoiceSpawnUniqueCardPatch")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CardChoiceSpawnUniqueCardPatch")]
[assembly: AssemblyTitle("CardChoiceSpawnUniqueCardPatch")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CardChoiceSpawnUniqueCardPatch
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("pykess.rounds.plugins.cardchoicespawnuniquecardpatch", "CardChoiceSpawnUniqueCardPatch", "0.1.9")]
	[BepInProcess("Rounds.exe")]
	public class CardChoiceSpawnUniqueCardPatch : BaseUnityPlugin
	{
		private const string ModId = "pykess.rounds.plugins.cardchoicespawnuniquecardpatch";

		private const string ModName = "CardChoiceSpawnUniqueCardPatch";

		internal static CardInfo NullCard;

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("pykess.rounds.plugins.cardchoicespawnuniquecardpatch").PatchAll();
			_ = CustomCardCategories.instance;
		}

		private void Start()
		{
			CustomCard.BuildCard<NullCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				NullCard = cardInfo;
			});
		}
	}
	[Serializable]
	[HarmonyPatch(typeof(CardChoice), "SpawnUniqueCard")]
	internal class CardChoicePatchSpawnUniqueCard
	{
		private static bool Prefix(ref GameObject __result, CardChoice __instance, Vector3 pos, Quaternion rot)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Expected O, but got Unknown
			Player val = (((int)(PickerType)Traverse.Create((object)__instance).Field("pickerType").GetValue() != 0) ? PlayerManager.instance.players[__instance.pickrID] : PlayerManager.instance.GetPlayersInTeam(__instance.pickrID)[0]);
			CardInfo val2 = null;
			if (CardChoice.instance.cards.Length != 0)
			{
				val2 = Cards.instance.GetRandomCardWithCondition(val, (Gun)null, (GunAmmo)null, (CharacterData)null, (HealthHandler)null, (Gravity)null, (Block)null, (CharacterStatModifiers)null, GetCondition(__instance), 1000);
			}
			if ((Object)(object)val2 != (Object)null)
			{
				GameObject val3 = (GameObject)typeof(CardChoice).InvokeMember("Spawn", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, __instance, new object[3]
				{
					((Component)val2).gameObject,
					pos,
					rot
				});
				val3.GetComponent<CardInfo>().sourceCard = ((Component)val2).GetComponent<CardInfo>();
				((Behaviour)((Component)val3.GetComponentInChildren<DamagableEvent>()).GetComponent<Collider2D>()).enabled = false;
				__result = val3;
			}
			else
			{
				GameObject val4 = (GameObject)typeof(CardChoice).InvokeMember("Spawn", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, __instance, new object[3]
				{
					((Component)CardChoiceSpawnUniqueCardPatch.NullCard).gameObject,
					pos,
					rot
				});
				val4.GetComponent<CardInfo>().sourceCard = ((Component)CardChoiceSpawnUniqueCardPatch.NullCard).GetComponent<CardInfo>();
				((Behaviour)((Component)val4.GetComponentInChildren<DamagableEvent>()).GetComponent<Collider2D>()).enabled = false;
				__result = val4;
			}
			return false;
		}

		private static Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> GetCondition(CardChoice instance)
		{
			return (CardInfo card, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers stats) => ModifiedBaseCondition(instance)(card, player) && CorrectedCondition(instance)(card, player);
		}

		private static Func<CardInfo, Player, bool> CorrectedCondition(CardChoice instance)
		{
			return (CardInfo card, Player player) => Cards.instance.PlayerIsAllowedCard(player, card);
		}

		private static Func<CardInfo, Player, bool> ModifiedBaseCondition(CardChoice instance)
		{
			return delegate(CardInfo card, Player player)
			{
				List<GameObject> list = (List<GameObject>)Traverse.Create((object)instance).Field("spawnedCards").GetValue();
				for (int i = 0; i < list.Count; i++)
				{
					bool flag = !card.categories.Contains(CustomCardCategories.CanDrawMultipleCategory) && ((Object)((Component)list[i].GetComponent<CardInfo>()).gameObject).name.Replace("(Clone)", "") == ((Object)((Component)card).gameObject).name;
					if (instance.pickrID != -1)
					{
						Holdable holdable = ((Component)player.data).GetComponent<Holding>().holdable;
						if (Object.op_Implicit((Object)(object)holdable))
						{
							Gun component = ((Component)holdable).GetComponent<Gun>();
							Gun component2 = ((Component)card).GetComponent<Gun>();
							if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component) && component2.lockGunToDefault && component.lockGunToDefault)
							{
								flag = true;
							}
						}
						for (int j = 0; j < player.data.currentCards.Count; j++)
						{
							CardInfo component3 = ((Component)player.data.currentCards[j]).GetComponent<CardInfo>();
							for (int k = 0; k < component3.blacklistedCategories.Length; k++)
							{
								for (int l = 0; l < card.categories.Length; l++)
								{
									if ((Object)(object)card.categories[l] == (Object)(object)component3.blacklistedCategories[k])
									{
										flag = true;
									}
								}
							}
							if (!component3.allowMultiple && ((Object)((Component)card).gameObject).name == ((Object)((Component)component3).gameObject).name)
							{
								flag = true;
							}
						}
					}
					if (flag)
					{
						return false;
					}
				}
				return true;
			};
		}
	}
	public class NullCard : CustomCard
	{
		public const string cardName = "  ";

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
		{
			cardInfo.sourceCard = CardChoiceSpawnUniqueCardPatch.NullCard;
			cardInfo.categories = cardInfo.categories.ToList().Concat(new List<CardCategory> { CustomCardCategories.CanDrawMultipleCategory }).ToArray();
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			((Component)this).gameObject.GetComponent<CardInfo>().sourceCard = CardChoiceSpawnUniqueCardPatch.NullCard;
		}

		public override void OnRemoveCard()
		{
		}

		protected override string GetTitle()
		{
			return "  ";
		}

		protected override string GetDescription()
		{
			return "";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			return null;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}

		public override bool GetEnabled()
		{
			return false;
		}

		public override string GetModName()
		{
			return "NULL";
		}
	}
}
namespace CardChoiceSpawnUniqueCardPatch.CustomCategories
{
	public class CustomCardCategories
	{
		public static readonly CustomCardCategories instance = new CustomCardCategories();

		private List<CardCategory> cardCategories = new List<CardCategory>();

		public static CardCategory CanDrawMultipleCategory => instance.CardCategory("__CanDrawMultiple__");

		private CustomCardCategories()
		{
			CardInfo[] array = (from obj in Resources.LoadAll<GameObject>("0 Cards/")
				where Object.op_Implicit((Object)(object)obj.GetComponent<CardInfo>())
				select obj into obj2
				select obj2.GetComponent<CardInfo>()).ToArray();
			foreach (CardInfo card in array)
			{
				UpdateAndPullCategoriesFromCard(card);
			}
			foreach (CardInfo item in CardManager.cards.Values.Select((Card c) => c.cardInfo))
			{
				UpdateAndPullCategoriesFromCard(item);
			}
			CardManager.AddAllCardsCallback((Action<CardInfo[]>)FirstStartAction);
		}

		private void FirstStartAction(CardInfo[] cards)
		{
			foreach (CardInfo card in cards)
			{
				UpdateAndPullCategoriesFromCard(card);
			}
		}

		public CardCategory[] GetCategoriesFromCard(CardInfo card)
		{
			return card.categories;
		}

		public CardCategory[] GetBlacklistedCategoriesFromCard(CardInfo card)
		{
			return card.blacklistedCategories;
		}

		public void UpdateAndPullCategoriesFromCard(CardInfo card)
		{
			List<CardCategory> list = new List<CardCategory>();
			for (int i = 0; i < card.categories.Length; i++)
			{
				CardCategory val = card.categories[i];
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				if (!cardCategories.Contains(val))
				{
					CardCategory categoryWithName = GetCategoryWithName(((Object)val).name);
					if ((Object)(object)categoryWithName != (Object)null)
					{
						card.categories[i] = categoryWithName;
						val = card.categories[i];
					}
					else
					{
						cardCategories.Add(val);
					}
				}
				list.Add(val);
			}
			card.categories = list.ToArray();
			list = new List<CardCategory>();
			for (int j = 0; j < card.blacklistedCategories.Length; j++)
			{
				CardCategory val2 = card.blacklistedCategories[j];
				if ((Object)(object)val2 == (Object)null)
				{
					continue;
				}
				if (!cardCategories.Contains(val2))
				{
					CardCategory categoryWithName2 = GetCategoryWithName(((Object)val2).name);
					if ((Object)(object)categoryWithName2 != (Object)null)
					{
						card.blacklistedCategories[j] = categoryWithName2;
						val2 = card.blacklistedCategories[j];
					}
					else
					{
						cardCategories.Add(val2);
					}
				}
				list.Add(val2);
			}
			card.blacklistedCategories = list.ToArray();
		}

		public CardInfo[] GetActiveCardsFromCategory(CardCategory cardCategory)
		{
			return Cards.instance.GetAllCardsWithCondition(((ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToArray(), (Player)null, (Func<CardInfo, Player, bool>)((CardInfo card, Player player) => card.categories.Intersect((IEnumerable<CardCategory>)(object)new CardCategory[1] { cardCategory }).Any()));
		}

		public CardInfo[] GetInactiveCardsFromCategory(CardCategory cardCategory)
		{
			return Cards.instance.GetAllCardsWithCondition(((List<CardInfo>)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToArray(), (Player)null, (Func<CardInfo, Player, bool>)((CardInfo card, Player player) => card.categories.Intersect((IEnumerable<CardCategory>)(object)new CardCategory[1] { cardCategory }).Any()));
		}

		public CardInfo[] GetAllCardsFromCategory(CardCategory cardCategory)
		{
			return GetActiveCardsFromCategory(cardCategory).Concat(GetInactiveCardsFromCategory(cardCategory)).ToArray();
		}

		private CardCategory GetCategoryWithName(string categoryName)
		{
			foreach (CardCategory cardCategory in cardCategories)
			{
				if ((Object)(object)cardCategory != (Object)null && ((Object)cardCategory).name != null && ((Object)cardCategory).name.ToLower() == categoryName.ToLower())
				{
					return cardCategory;
				}
			}
			return null;
		}

		public CardCategory CardCategory(string categoryName)
		{
			CardCategory val = GetCategoryWithName(categoryName);
			if ((Object)(object)val == (Object)null)
			{
				CardCategory val2 = ScriptableObject.CreateInstance<CardCategory>();
				((Object)val2).name = categoryName.ToLower();
				cardCategories.Add(val2);
				val = val2;
			}
			return val;
		}

		public void MakeCardsExclusive(CardInfo card1, CardInfo card2)
		{
			string categoryName = "__" + ((Object)card1).name + "_" + ((Object)card2).name + "_EXCLUSIVE__";
			string categoryName2 = "__" + ((Object)card2).name + "_" + ((Object)card1).name + "_EXCLUSIVE__";
			CardCategory val = CardCategory(categoryName);
			CardCategory val2 = CardCategory(categoryName2);
			card1.categories = card1.categories.Concat((IEnumerable<CardCategory>)(object)new CardCategory[1] { val }).ToArray();
			card2.categories = card2.categories.Concat((IEnumerable<CardCategory>)(object)new CardCategory[1] { val2 }).ToArray();
			card1.blacklistedCategories = card1.blacklistedCategories.Concat((IEnumerable<CardCategory>)(object)new CardCategory[1] { val2 }).ToArray();
			card2.blacklistedCategories = card2.blacklistedCategories.Concat((IEnumerable<CardCategory>)(object)new CardCategory[1] { val }).ToArray();
		}
	}
}

BestMod/bin/Debug/ModdingUtils.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using HarmonyLib;
using InControl;
using ModdingUtils.AIMinion;
using ModdingUtils.AIMinion.Extensions;
using ModdingUtils.Extensions;
using ModdingUtils.GameModes;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.Patches;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using Photon.Pun;
using Sonigon;
using SoundImplementation;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.Extensions;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnityEngine;
using UnityEngine.Audio;
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("ModdingUtils")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ModdingUtils")]
[assembly: AssemblyTitle("ModdingUtils")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ModdingUtils
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("pykess.rounds.plugins.moddingutils", "Modding Utilities", "0.4.5")]
	[BepInProcess("Rounds.exe")]
	public class ModdingUtils : BaseUnityPlugin
	{
		private const string ModId = "pykess.rounds.plugins.moddingutils";

		private const string ModName = "Modding Utilities";

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("pykess.rounds.plugins.moddingutils").PatchAll();
		}

		private void Start()
		{
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			Unbound.RegisterCredits("Modding Utilities", new string[3] { "Pykess", "BossSloth (Migration of several tools from PCE)", "Willuwontu (game mode hooks interface)" }, new string[2] { "github", "Support Pykess" }, new string[2] { "https://github.com/Rounds-Modding/ModdingUtils", "https://ko-fi.com/pykess" });
			((Component)this).gameObject.AddComponent<InterfaceGameModeHooksManager>();
			GameModeManager.AddHook("PickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => EndPickPhaseShow()));
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)CharacterStatModifiersExtension.Reset);
			GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ResetEffectsBetweenBattles()));
			GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ResetTimers()));
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ResetEffectsBetweenBattles()));
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ResetTimers()));
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)AIMinionHandler.InitPlayerAssigner);
			GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)AIMinionHandler.CreateAllAIs);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)AIMinionHandler.RemoveAllAIs);
			GameModeManager.AddHook("PickStart", (Func<IGameModeHandler, IEnumerator>)AIMinionHandler.RemoveAllAIs);
			GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)TimeSinceBattleStart.BattleStart);
			GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)AIMinionHandler.StartStalemateHandler);
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)TimeSinceBattleStart.FreezeTimer);
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => AIMinionHandler.SetPlayersCanJoin(playersCanJoin: false)));
			GameModeManager.AddHook("InitStart", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => AIMinionHandler.SetPlayersCanJoin(playersCanJoin: true)));
			CardChoicePatchGetRanomCard.CardChoiceSpawnUniqueCardPatch = ((List<BaseUnityPlugin>)typeof(Chainloader).GetField("_plugins", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "pykess.rounds.plugins.cardchoicespawnuniquecardpatch");
			if (CardChoicePatchGetRanomCard.CardChoiceSpawnUniqueCardPatch)
			{
				CardChoicePatchGetRanomCard.UniqueCardPatch = AppDomain.CurrentDomain.GetAssemblies().First((Assembly a) => a.FullName == "CardChoiceSpawnUniqueCardPatch, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
			}
			((GameObject)Resources.Load("Bullet_EMP")).AddComponent<StopRecursion>();
			((GameObject)Resources.Load("Bullet_NoTrail")).AddComponent<StopRecursion>();
		}

		private IEnumerator EndPickPhaseShow()
		{
			yield return (object)new WaitForSecondsRealtime(0.5f);
			yield return CardBarUtils.instance.EndPickPhaseShow();
		}

		private IEnumerator ResetEffectsBetweenBattles()
		{
			Player[] players = PlayerManager.instance.players.ToArray();
			for (int i = 0; i < players.Length; i++)
			{
				CustomEffects.ClearAllReversibleEffects(((Component)players[i]).gameObject);
				InConeEffect[] components = ((Component)players[i]).GetComponents<InConeEffect>();
				foreach (InConeEffect effect in components)
				{
					effect.RemoveAllEffects();
				}
			}
			yield break;
		}

		private IEnumerator ResetTimers()
		{
			Player[] players = PlayerManager.instance.players.ToArray();
			for (int i = 0; i < players.Length; i++)
			{
				CustomEffects.ResetAllTimers(((Component)players[i]).gameObject);
			}
			yield break;
		}
	}
}
namespace ModdingUtils.Utils
{
	[RequireComponent(typeof(SoundUnityEventPlayer))]
	public class AudioMixerFixer : MonoBehaviour
	{
		public enum AudioType
		{
			SFX,
			MASTER,
			MUSIC
		}

		public AudioType type;

		private Dictionary<AudioType, string> groupNames = new Dictionary<AudioType, string>
		{
			{
				AudioType.MASTER,
				"MasterPrivate"
			},
			{
				AudioType.MUSIC,
				"MUS"
			},
			{
				AudioType.SFX,
				"SFX"
			}
		};

		private AudioMixerGroup audioGroup;

		private void Awake()
		{
			audioGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups(groupNames[type])[0];
			SoundUnityEventPlayer component = ((Component)this).GetComponent<SoundUnityEventPlayer>();
			SetAudioMixerGroup(component.soundStart);
			SetAudioMixerGroup(component.soundStartLoop);
			SetAudioMixerGroup(component.soundEnd);
		}

		private void SetAudioMixerGroup(SoundEvent soundEvent)
		{
			if (!((Object)(object)soundEvent == (Object)null))
			{
				soundEvent.variables.audioMixerGroup = audioGroup;
			}
		}
	}
	public sealed class CardBarUtils
	{
		public static readonly CardBarUtils instance = new CardBarUtils();

		private static readonly float displayDuration = 1.5f;

		public static readonly Vector3 localShift = new Vector3(-50f, 0f, 0f);

		public static readonly float barlocalScaleMult = 1.1f;

		public static readonly float cardLocalScaleMult = 1f;

		private DictionaryOfLists<Player, CardInfo> cardsToShow = new DictionaryOfLists<Player, CardInfo>();

		private CardBar[] CardBars => (CardBar[])Traverse.Create((object)CardBarHandler.instance).Field("cardBars").GetValue();

		public CardBar PlayersCardBar(int playerID)
		{
			return CardBars[playerID];
		}

		public CardBar PlayersCardBar(Player player)
		{
			return CardBars[player.playerID];
		}

		private CardBarUtils()
		{
		}

		private void Reset()
		{
			cardsToShow = new DictionaryOfLists<Player, CardInfo>();
		}

		private void Reset(Player player)
		{
			cardsToShow[player] = new List<CardInfo>();
		}

		public void ShowAtEndOfPhase(Player player, CardInfo card)
		{
			if (!((Object)(object)card == (Object)null))
			{
				List<CardInfo> list = new List<CardInfo>(cardsToShow[player]);
				list.Add(card);
				cardsToShow[player] = list;
			}
		}

		public void ShowCard(Player player, CardInfo card)
		{
			ShowCard(player.playerID, ((Object)card).name);
		}

		public void ShowCard(int playerID, CardInfo card)
		{
			ShowCard(playerID, ((Object)card).name);
		}

		public void ShowCard(Player player, int cardID)
		{
			ShowCard(player.playerID, ((Object)Cards.instance.GetCardWithID(cardID)).name);
		}

		public void ShowCard(int playerID, int cardID)
		{
			ShowCard(playerID, ((Object)Cards.instance.GetCardWithID(cardID)).name);
		}

		public void ShowCard(int playerID, string objectName)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				NetworkingManager.RPC(typeof(CardBarUtils), "RPCA_ShowCard", new object[2] { playerID, objectName });
			}
		}

		[UnboundRPC]
		private static void RPCA_ShowCard(int playerID, string objectName)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			int cardIDFromObjectName = Cards.instance.GetCardIDFromObjectName(objectName);
			try
			{
				if ((Object)(object)Cards.instance.GetCardWithID(cardIDFromObjectName) == (Object)null)
				{
					return;
				}
			}
			catch
			{
				return;
			}
			instance.PlayersCardBar(playerID).OnHover(Cards.instance.GetCardWithID(cardIDFromObjectName), Vector3.zero);
			((GameObject)Traverse.Create((object)instance.PlayersCardBar(playerID)).Field("currentCard").GetValue()).gameObject.transform.localScale = Vector3.one * cardLocalScaleMult;
		}

		public void HideCard(Player player)
		{
			HideCard(player.playerID);
		}

		public void HideCard(int playerID)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				NetworkingManager.RPC(typeof(CardBarUtils), "RPCA_HideCard", new object[1] { playerID });
			}
		}

		[UnboundRPC]
		private static void RPCA_HideCard(int playerID)
		{
			instance.PlayersCardBar(playerID).StopHover();
		}

		[UnboundRPC]
		private static void RPCA_HighlightCardBar(int playerID)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			((Component)instance.PlayersCardBar(playerID)).gameObject.transform.localScale = Vector3.one * barlocalScaleMult;
			Transform transform = ((Component)instance.PlayersCardBar(playerID)).gameObject.transform;
			transform.localPosition += localShift;
			instance.ChangePlayersLineColor(playerID, Color.white);
			float num = default(float);
			float num2 = default(float);
			float num3 = default(float);
			Color.RGBToHSV(instance.GetPlayersBarColor(playerID), ref num, ref num2, ref num3);
			instance.ChangePlayersBarColor(playerID, Color.HSVToRGB(num, num2 + 0.1f, num3 + 0.1f));
		}

		[UnboundRPC]
		private static void RPCA_UnhighlightCardBar(int playerID, float r, float g, float b, float a)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			((Component)instance.PlayersCardBar(playerID)).gameObject.transform.localScale = Vector3.one * 1f;
			Transform transform = ((Component)instance.PlayersCardBar(playerID)).gameObject.transform;
			transform.localPosition -= localShift;
			instance.ResetPlayersLineColor(playerID);
			instance.ChangePlayersBarColor(playerID, new Color(r, g, b, a));
		}

		public Color HighlightCardBar(int playerID)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			Color playersBarColor = GetPlayersBarColor(playerID);
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				NetworkingManager.RPC(typeof(CardBarUtils), "RPCA_HighlightCardBar", new object[1] { playerID });
			}
			return playersBarColor;
		}

		public void UnhighlightCardBar(int playerID, Color original_color)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				NetworkingManager.RPC(typeof(CardBarUtils), "RPCA_UnhighlightCardBar", new object[5] { playerID, original_color.r, original_color.g, original_color.b, original_color.a });
			}
		}

		public GameObject GetCardBarSquare(int playerID, int idx)
		{
			return GetCardBarSquares(playerID)[idx + 1];
		}

		public GameObject GetCardBarSquare(Player player, int idx)
		{
			return GetCardBarSquare(player.playerID, idx);
		}

		public GameObject[] GetCardBarSquares(int playerID)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			List<GameObject> list = new List<GameObject>();
			foreach (Transform item in ((Component)PlayersCardBar(playerID)).transform)
			{
				Transform val = item;
				list.Add(((Component)val).gameObject);
			}
			return list.ToArray();
		}

		public GameObject[] GetCardBarSquares(Player player)
		{
			return GetCardBarSquares(player.playerID);
		}

		public void ResetPlayersLineColor(int playerID)
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			List<Graphic> list = (from gr in ((Component)PlayersCardBar(playerID)).gameObject.GetComponentsInChildren<Graphic>()
				where !((Object)((Component)gr).gameObject).name.Contains("CarrdOrange")
				select gr).ToList();
			foreach (Graphic item in list)
			{
				if (((Object)((Component)item).gameObject).name.Contains("Card"))
				{
					item.color = new Color(0.462f, 0.462f, 0.462f, 1f);
				}
				else if (((Object)((Component)item).gameObject).name.Contains("Text"))
				{
					item.color = new Color(0.6509f, 0.6509f, 0.6509f, 1f);
				}
			}
		}

		public void ResetPlayersLineColor(Player player)
		{
			ResetPlayersLineColor(player.playerID);
		}

		public void ChangePlayersLineColor(int playerID, Color color)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			List<Graphic> list = (from gr in ((Component)PlayersCardBar(playerID)).gameObject.GetComponentsInChildren<Graphic>()
				where !((Object)((Component)gr).gameObject).name.Contains("CarrdOrange")
				select gr).ToList();
			foreach (Graphic item in list)
			{
				item.color = color;
			}
		}

		public void ChangePlayersLineColor(Player player, Color color)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			ChangePlayersLineColor(player.playerID, color);
		}

		public Color GetPlayersBarColor(int playerID)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			List<Graphic> list = (from gr in ((Component)PlayersCardBar(playerID)).gameObject.GetComponentsInChildren<Graphic>()
				where ((Object)((Component)gr).gameObject).name.Contains("CarrdOrange")
				select gr).ToList();
			return list[0].color;
		}

		public Color GetPlayersBarColor(Player player)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			return GetPlayersBarColor(player.playerID);
		}

		public Color ChangePlayersBarColor(int playerID, Color color)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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)
			List<Graphic> list = (from gr in ((Component)PlayersCardBar(playerID)).gameObject.GetComponentsInChildren<Graphic>()
				where ((Object)((Component)gr).gameObject).name.Contains("CarrdOrange")
				select gr).ToList();
			Color color2 = list[0].color;
			foreach (Graphic item in list)
			{
				item.color = color;
			}
			return color2;
		}

		public Color ChangePlayersBarColor(Player player, Color color)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			return ChangePlayersBarColor(player.playerID, color);
		}

		public Color GetCardSquareColor(GameObject cardSquare)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			List<Graphic> list = cardSquare.GetComponentsInChildren<Graphic>().ToList();
			return list[0].color;
		}

		public Color ChangeCardSquareColor(GameObject cardSquare, Color color)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: 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)
			//IL_0051: 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)
			List<Graphic> list = cardSquare.GetComponentsInChildren<Graphic>().ToList();
			Color color2 = list[0].color;
			foreach (Graphic item in list)
			{
				item.color = color;
			}
			return color2;
		}

		public static void SilentAddToCardBar(int playerID, CardInfo card, string twoLetterCode = "")
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			Traverse.Create((object)instance.PlayersCardBar(playerID)).Field("ci").SetValue((object)card);
			GameObject val = (GameObject)Traverse.Create((object)instance.PlayersCardBar(playerID)).Field("source").GetValue();
			GameObject val2 = Object.Instantiate<GameObject>(val, val.transform.position, val.transform.rotation, val.transform.parent);
			val2.transform.localScale = Vector3.one;
			string text = card.cardName;
			if (twoLetterCode != "")
			{
				text = twoLetterCode;
			}
			while (text.Length < 2)
			{
				text += " ";
			}
			text = text.Substring(0, 2);
			string text2 = text[0].ToString().ToUpper();
			if (text.Length > 1)
			{
				string text3 = text[1].ToString().ToLower();
				text = text2 + text3;
			}
			else
			{
				text = text2;
			}
			((TMP_Text)val2.GetComponentInChildren<TextMeshProUGUI>()).text = text;
			Traverse.Create((object)val2.GetComponent<CardBarButton>()).Field("card").SetValue((object)card);
			val2.gameObject.SetActive(true);
		}

		public static void SilentAddToCardBar(Player player, CardInfo card, string twoLetterCode = "")
		{
			SilentAddToCardBar(player.playerID, card, twoLetterCode);
		}

		internal IEnumerator EndPickPhaseShow()
		{
			foreach (Player player in PlayerManager.instance.players)
			{
				_ = Color.clear;
				Color orig;
				try
				{
					orig = GetPlayersBarColor(player);
				}
				catch
				{
					continue;
				}
				if (cardsToShow[player].Count > 0)
				{
					orig = HighlightCardBar(player.playerID);
				}
				using (IEnumerator<CardInfo> enumerator2 = cardsToShow[player].Where((CardInfo card) => player.data.currentCards.Select((CardInfo card) => ((Object)card).name).Contains(((Object)card).name)).GetEnumerator())
				{
					while (enumerator2.MoveNext())
					{
						ShowCard(card: enumerator2.Current, player: player);
						yield return (object)new WaitForSecondsRealtime(displayDuration);
						HideCard(player);
					}
				}
				if (cardsToShow[player].Count > 0)
				{
					UnhighlightCardBar(player.playerID, orig);
				}
			}
			Reset();
		}

		public IEnumerator ShowImmediate(int playerID, int cardID, float? duration = null)
		{
			float displayDuration = duration ?? CardBarUtils.displayDuration;
			Color orig = HighlightCardBar(playerID);
			ShowCard(playerID, cardID);
			yield return (object)new WaitForSecondsRealtime(displayDuration);
			HideCard(playerID);
			UnhighlightCardBar(playerID, orig);
		}

		public IEnumerator ShowImmediate(Player player, int cardID, float? duration = null)
		{
			return ShowImmediate(player.playerID, cardID, duration);
		}

		public IEnumerator ShowImmediate(Player player, CardInfo card, float? duration = null)
		{
			return ShowImmediate(player.playerID, Cards.instance.GetCardID(card), duration);
		}

		public IEnumerator ShowImmediate(int playerID, CardInfo card, float? duration = null)
		{
			return ShowImmediate(playerID, Cards.instance.GetCardID(card), duration);
		}

		public IEnumerator ShowImmediate(Player player, int[] cardIDs, float? duration = null)
		{
			return ShowImmediate(player.playerID, cardIDs, duration);
		}

		public IEnumerator ShowImmediate(int playerID, CardInfo[] cards, float? duration = null)
		{
			List<int> list = new List<int>();
			foreach (CardInfo card in cards)
			{
				list.Add(Cards.instance.GetCardID(card));
			}
			return ShowImmediate(playerID, list.ToArray(), duration);
		}

		public IEnumerator ShowImmediate(Player player, CardInfo[] cards, float? duration = null)
		{
			List<int> list = new List<int>();
			foreach (CardInfo card in cards)
			{
				list.Add(Cards.instance.GetCardID(card));
			}
			return ShowImmediate(player.playerID, list.ToArray(), duration);
		}

		public IEnumerator ShowImmediate(Player player, int cardID)
		{
			return ShowImmediate(player, cardID, null);
		}

		public IEnumerator ShowImmediate(Player player, CardInfo card)
		{
			return ShowImmediate(player, card, null);
		}

		public IEnumerator ShowImmediate(int playerID, CardInfo card)
		{
			return ShowImmediate(playerID, card, null);
		}

		public IEnumerator ShowImmediate(Player player, int[] cardIDs)
		{
			return ShowImmediate(player, cardIDs, null);
		}

		public IEnumerator ShowImmediate(int playerID, CardInfo[] cards)
		{
			return ShowImmediate(playerID, cards, null);
		}

		public IEnumerator ShowImmediate(Player player, CardInfo[] cards)
		{
			return ShowImmediate(player, cards, null);
		}

		public IEnumerator ShowImmediate(int playerID, int[] cardIDs, float? duration = null)
		{
			float displayDuration = duration ?? CardBarUtils.displayDuration;
			Color orig = HighlightCardBar(playerID);
			foreach (int cardID in cardIDs)
			{
				ShowCard(playerID, cardID);
				yield return (object)new WaitForSecondsRealtime(displayDuration);
				HideCard(playerID);
			}
			UnhighlightCardBar(playerID, orig);
		}

		public void ClearCardBar(Player player)
		{
			if (PhotonNetwork.OfflineMode)
			{
				PlayersCardBar(player).ClearBar();
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				NetworkingManager.RPC(typeof(CardBarUtils), "RPCA_ClearCardBar", new object[1] { player.playerID });
			}
		}

		[UnboundRPC]
		private static void RPCA_ClearCardBar(int playerID)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			Player val = (Player)ExtensionMethods.InvokeMethod((object)PlayerManager.instance, "GetPlayerWithID", new object[1] { playerID });
			instance.PlayersCardBar(val.playerID).ClearBar();
		}
	}
	public class DictionaryOfLists<TKey, TListValue> : Dictionary<TKey, List<TListValue>>
	{
		public new List<TListValue> this[TKey key]
		{
			get
			{
				List<TListValue> value;
				return TryGetValue(key, out value) ? value : new List<TListValue>();
			}
			set
			{
				base[key] = value;
			}
		}
	}
	public sealed class Cards
	{
		public enum SelectionType
		{
			All,
			Oldest,
			Newest,
			Random
		}

		public static readonly Cards instance = new Cards();

		private static readonly Random rng = new Random();

		private List<CardInfo> hiddenCards = new List<CardInfo>();

		private List<Action<Player, CardInfo, int>> removalCallbacks = new List<Action<Player, CardInfo, int>>();

		private List<Func<Player, CardInfo, bool>> cardValidationFunctions = new List<Func<Player, CardInfo, bool>>();

		public static List<CardInfo> active
		{
			get
			{
				return ((ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToList();
			}
			set
			{
			}
		}

		public static List<CardInfo> inactive
		{
			get
			{
				return (List<CardInfo>)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
			}
			set
			{
			}
		}

		public static List<CardInfo> all
		{
			get
			{
				return active.Concat(inactive).ToList();
			}
			set
			{
			}
		}

		public ReadOnlyCollection<CardInfo> HiddenCards => new ReadOnlyCollection<CardInfo>(hiddenCards);

		private List<CardInfo> allCards => ((ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToList().Concat((List<CardInfo>)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).Concat(hiddenCards)
			.ToList();

		private List<CardInfo> ACTIVEANDHIDDENCARDS
		{
			get
			{
				return activeCards.ToList().Concat(hiddenCards).ToList();
			}
			set
			{
			}
		}

		private CardInfo[] activeCards => CardChoice.instance.cards;

		private Cards()
		{
		}

		public void AddOnRemoveCallback(Action<Player, CardInfo, int> callback)
		{
			removalCallbacks.Add(callback);
		}

		public void AddCardToPlayer(Player player, CardInfo card, bool reassign = false, string twoLetterCode = "", float forceDisplay = 0f, float forceDisplayDelay = 0f)
		{
			AddCardToPlayer(player, card, reassign, twoLetterCode, forceDisplay, forceDisplayDelay, addToCardBar: true);
		}

		public void AddCardToPlayer(Player player, CardInfo card, bool reassign = false, string twoLetterCode = "", float forceDisplay = 0f, float forceDisplayDelay = 0f, bool addToCardBar = true)
		{
			if ((Object)(object)card == (Object)null)
			{
				return;
			}
			if (PhotonNetwork.OfflineMode)
			{
				ApplyCardStats componentInChildren = ((Component)card).gameObject.GetComponentInChildren<ApplyCardStats>();
				typeof(ApplyCardStats).InvokeMember("Start", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, componentInChildren, new object[0]);
				((Component)componentInChildren).GetComponent<CardInfo>().sourceCard = card;
				Traverse.Create((object)componentInChildren).Field("playerToUpgrade").SetValue((object)player);
				if (reassign && (Object)(object)((Component)card).GetComponent<CustomCard>() != (Object)null)
				{
					try
					{
						Gun component = ((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>();
						CharacterData component2 = ((Component)player).GetComponent<CharacterData>();
						HealthHandler component3 = ((Component)player).GetComponent<HealthHandler>();
						Gravity component4 = ((Component)player).GetComponent<Gravity>();
						Block component5 = ((Component)player).GetComponent<Block>();
						GunAmmo componentInChildren2 = ((Component)component).GetComponentInChildren<GunAmmo>();
						CharacterStatModifiers component6 = ((Component)player).GetComponent<CharacterStatModifiers>();
						((Component)card).GetComponent<CustomCard>().OnReassignCard(player, component, componentInChildren2, component2, component3, component4, component5, component6);
					}
					catch (NotImplementedException)
					{
					}
					catch (Exception ex2)
					{
						Debug.LogError((object)("[ModdingUtils] EXCEPTION: " + ex2.GetType().ToString() + "\nThrown by: " + ((Component)card).GetComponent<CustomCard>().GetModName() + " - " + card.cardName + " - OnReassignCard(Player, Gun, GunAmmo, HealthHandler, Gravity, Block, CharacterStatModifiers)"));
					}
				}
				if (!reassign || card.GetAdditionalData().canBeReassigned)
				{
					typeof(ApplyCardStats).InvokeMember("ApplyStats", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, componentInChildren, new object[0]);
				}
				else
				{
					player.data.currentCards.Add(card);
				}
				if (addToCardBar)
				{
					SilentAddToCardBar(player.playerID, ((Component)componentInChildren).GetComponent<CardInfo>().sourceCard, twoLetterCode, forceDisplay, forceDisplayDelay);
				}
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				if (addToCardBar)
				{
					NetworkingManager.RPC(typeof(Cards), "RPCA_AssignCard", new object[6]
					{
						((Object)card).name,
						player.playerID,
						reassign,
						twoLetterCode,
						forceDisplay,
						forceDisplayDelay
					});
				}
				else
				{
					NetworkingManager.RPC(typeof(Cards), "RPCA_AssignCardWithoutCardBar", new object[6]
					{
						((Object)card).name,
						player.playerID,
						reassign,
						twoLetterCode,
						forceDisplay,
						forceDisplayDelay
					});
				}
			}
		}

		public void AddCardsToPlayer(Player player, CardInfo[] cards, bool reassign = false, string[] twoLetterCodes = null, float[] forceDisplays = null, float[] forceDisplayDelays = null)
		{
			AddCardsToPlayer(player, cards, reassign, twoLetterCodes, forceDisplays, forceDisplayDelays, addToCardBar: true);
		}

		public void AddCardsToPlayer(Player player, CardInfo[] cards, bool reassign = false, string[] twoLetterCodes = null, float[] forceDisplays = null, float[] forceDisplayDelays = null, bool addToCardBar = true)
		{
			bool[] array = new bool[cards.Length];
			for (int i = 0; i < cards.Length; i++)
			{
				array[i] = reassign;
			}
			AddCardsToPlayer(player, cards, array, twoLetterCodes, forceDisplays, forceDisplayDelays, addToCardBar);
		}

		public void AddCardsToPlayer(Player player, CardInfo[] cards, bool[] reassigns = null, string[] twoLetterCodes = null, float[] forceDisplays = null, float[] forceDisplayDelays = null)
		{
			AddCardsToPlayer(player, cards, reassigns, twoLetterCodes, forceDisplays, forceDisplayDelays, addToCardBar: true);
		}

		public void AddCardsToPlayer(Player player, CardInfo[] cards, bool[] reassigns = null, string[] twoLetterCodes = null, float[] forceDisplays = null, float[] forceDisplayDelays = null, bool addToCardBar = true)
		{
			if (reassigns == null)
			{
				reassigns = new bool[cards.Length];
				for (int i = 0; i < reassigns.Length; i++)
				{
					reassigns[i] = false;
				}
			}
			if (twoLetterCodes == null)
			{
				twoLetterCodes = new string[cards.Length];
				for (int j = 0; j < twoLetterCodes.Length; j++)
				{
					twoLetterCodes[j] = "";
				}
			}
			if (forceDisplays == null)
			{
				forceDisplays = new float[cards.Length];
				for (int k = 0; k < forceDisplays.Length; k++)
				{
					forceDisplays[k] = 0f;
				}
			}
			if (forceDisplayDelays == null)
			{
				forceDisplayDelays = new float[cards.Length];
				for (int l = 0; l < forceDisplayDelays.Length; l++)
				{
					forceDisplayDelays[l] = 0f;
				}
			}
			for (int m = 0; m < cards.Length; m++)
			{
				AddCardToPlayer(player, cards[m], reassigns[m], twoLetterCodes[m], forceDisplays[m], forceDisplayDelays[m], addToCardBar);
			}
		}

		public CardInfo[] RemoveCardsFromPlayer(Player player, int[] indeces)
		{
			return RemoveCardsFromPlayer(player, indeces, editCardBar: true);
		}

		public CardInfo[] RemoveCardsFromPlayer(Player player, int[] indeces, bool editCardBar = true)
		{
			List<CardInfo> list = new List<CardInfo>();
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				list.Add(currentCard);
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int i = 0; i < list.Count; i++)
			{
				if (!indeces.Contains(i))
				{
					newCards.Add(list[i]);
				}
			}
			RemoveAllCardsFromPlayer(player);
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 0.1f, (Action)delegate
			{
				if (editCardBar)
				{
					CardBarUtils.instance.ClearCardBar(player);
				}
				AddCardsToPlayer(player, newCards.ToArray(), reassign: true, null, null, null, editCardBar);
			});
			foreach (Action<Player, CardInfo, int> removalCallback in removalCallbacks)
			{
				foreach (int num in indeces)
				{
					try
					{
						removalCallback(player, list[num], num);
					}
					catch
					{
					}
				}
			}
			return list.Except(newCards).ToArray();
		}

		public int RemoveCardsFromPlayer(Player player, CardInfo[] cards, SelectionType selectType = SelectionType.All)
		{
			return RemoveCardsFromPlayer(player, cards, selectType, editCardBar: true);
		}

		public int RemoveCardsFromPlayer(Player player, CardInfo[] cards, SelectionType selectType = SelectionType.All, bool editCardBar = true)
		{
			List<CardInfo> list = new List<CardInfo>();
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				list.Add(currentCard);
			}
			List<int> list2 = new List<int>();
			foreach (CardInfo card in cards)
			{
				List<int> list3 = (from idx in Enumerable.Range(0, player.data.currentCards.Count)
					where ((Object)player.data.currentCards[idx]).name == ((Object)card).name
					select idx).ToList();
				int num = 0;
				int num2 = list3.Count;
				switch (selectType)
				{
				case SelectionType.All:
					num = 0;
					num2 = list3.Count;
					break;
				case SelectionType.Newest:
					num = list3.Count - 1;
					num2 = num + 1;
					break;
				case SelectionType.Oldest:
					num = 0;
					num2 = num + 1;
					break;
				case SelectionType.Random:
					num = rng.Next(0, list3.Count);
					num2 = num + 1;
					break;
				}
				for (int j = num; j < num2; j++)
				{
					list2.Add(list3[j]);
				}
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int k = 0; k < list.Count; k++)
			{
				if (!list2.Contains(k))
				{
					newCards.Add(list[k]);
				}
			}
			RemoveAllCardsFromPlayer(player, clearBar: false);
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 0.1f, (Action)delegate
			{
				if (editCardBar)
				{
					CardBarUtils.instance.ClearCardBar(player);
				}
				AddCardsToPlayer(player, newCards.ToArray(), reassign: true, null, null, null, editCardBar);
			});
			foreach (Action<Player, CardInfo, int> removalCallback in removalCallbacks)
			{
				foreach (int item in list2)
				{
					try
					{
						removalCallback(player, list[item], item);
					}
					catch
					{
					}
				}
			}
			return list2.Count;
		}

		public CardInfo RemoveCardFromPlayer(Player player, int idx)
		{
			return RemoveCardFromPlayer(player, idx, editCardBar: true);
		}

		public CardInfo RemoveCardFromPlayer(Player player, int idx, bool editCardBar)
		{
			List<CardInfo> list = new List<CardInfo>();
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				list.Add(currentCard);
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int i = 0; i < list.Count; i++)
			{
				if (i != idx)
				{
					newCards.Add(list[i]);
				}
			}
			RemoveAllCardsFromPlayer(player);
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 0.1f, (Action)delegate
			{
				if (editCardBar)
				{
					CardBarUtils.instance.ClearCardBar(player);
				}
				AddCardsToPlayer(player, newCards.ToArray(), reassign: true, null, null, null, editCardBar);
			});
			foreach (Action<Player, CardInfo, int> removalCallback in removalCallbacks)
			{
				try
				{
					removalCallback(player, list[idx], idx);
				}
				catch
				{
				}
			}
			return list[idx];
		}

		public int RemoveCardFromPlayer(Player player, CardInfo card, SelectionType selectType = SelectionType.All)
		{
			return RemoveCardFromPlayer(player, card, selectType, editCardBar: true);
		}

		public int RemoveCardFromPlayer(Player player, CardInfo card, SelectionType selectType = SelectionType.All, bool editCardBar = true)
		{
			List<CardInfo> list = new List<CardInfo>();
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				list.Add(currentCard);
			}
			List<int> list2 = (from idx in Enumerable.Range(0, player.data.currentCards.Count)
				where ((Object)player.data.currentCards[idx]).name == ((Object)card).name
				select idx).ToList();
			int num = 0;
			int num2 = list2.Count;
			switch (selectType)
			{
			case SelectionType.All:
				num = 0;
				num2 = list2.Count;
				break;
			case SelectionType.Newest:
				num = list2.Count - 1;
				num2 = num + 1;
				break;
			case SelectionType.Oldest:
				num = 0;
				num2 = 1;
				break;
			case SelectionType.Random:
				num = rng.Next(0, list2.Count);
				num2 = num + 1;
				break;
			}
			List<int> list3 = new List<int>();
			for (int i = num; i < num2; i++)
			{
				list3.Add(list2[i]);
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int j = 0; j < list.Count; j++)
			{
				if (!list3.Contains(j))
				{
					newCards.Add(list[j]);
				}
			}
			RemoveAllCardsFromPlayer(player, clearBar: false);
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 0.1f, (Action)delegate
			{
				if (editCardBar)
				{
					CardBarUtils.instance.ClearCardBar(player);
				}
				AddCardsToPlayer(player, newCards.ToArray(), reassign: true, null, null, null, editCardBar);
			});
			foreach (Action<Player, CardInfo, int> removalCallback in removalCallbacks)
			{
				foreach (int item in list3)
				{
					try
					{
						removalCallback(player, list[item], item);
					}
					catch
					{
					}
				}
			}
			return list3.Count;
		}

		public CardInfo[] RemoveAllCardsFromPlayer(Player player, bool clearBar = true)
		{
			List<CardInfo> list = new List<CardInfo>();
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				list.Add(currentCard);
			}
			if (PhotonNetwork.OfflineMode)
			{
				typeof(Player).InvokeMember("FullReset", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, player, new object[0]);
				if (clearBar)
				{
					CardBarUtils.instance.ClearCardBar(player);
				}
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				NetworkingManager.RPC(typeof(Cards), "RPCA_FullReset", new object[1] { player.playerID });
				if (clearBar)
				{
					CardBarUtils.instance.ClearCardBar(player);
				}
			}
			return list.ToArray();
		}

		public IEnumerator ReplaceCard(Player player, int idx, CardInfo newCard, string twoLetterCode = "", float forceDisplay = 0f, float forceDisplayDelay = 0f)
		{
			yield return ReplaceCard(player, idx, newCard, twoLetterCode, forceDisplay, forceDisplayDelay, editCardBar: true);
		}

		public IEnumerator ReplaceCard(Player player, int idx, CardInfo newCard, string twoLetterCode = "", float forceDisplay = 0f, float forceDisplayDelay = 0f, bool editCardBar = true)
		{
			if ((Object)(object)newCard == (Object)null)
			{
				yield break;
			}
			List<string> twoLetterCodes = new List<string>();
			List<float> forceDisplays = new List<float>();
			List<float> forceDisplayDelays = new List<float>();
			List<bool> reassigns = new List<bool>();
			List<CardInfo> originalCards = new List<CardInfo>();
			foreach (CardInfo origCard in player.data.currentCards)
			{
				originalCards.Add(origCard);
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int j = 0; j < originalCards.Count; j++)
			{
				if (j != idx)
				{
					newCards.Add(originalCards[j]);
					twoLetterCodes.Add("");
					forceDisplays.Add(0f);
					forceDisplayDelays.Add(0f);
					reassigns.Add(item: true);
				}
				else
				{
					newCards.Add(newCard);
					twoLetterCodes.Add(twoLetterCode);
					forceDisplays.Add(forceDisplay);
					forceDisplayDelays.Add(forceDisplayDelay);
					reassigns.Add(item: false);
				}
			}
			RemoveAllCardsFromPlayer(player, editCardBar);
			for (int i = 0; i < 20; i++)
			{
				yield return null;
			}
			if (editCardBar)
			{
				CardBarUtils.instance.ClearCardBar(player);
			}
			yield return null;
			AddCardsToPlayer(player, newCards.ToArray(), reassigns.ToArray(), twoLetterCodes.ToArray(), forceDisplays.ToArray(), forceDisplayDelays.ToArray(), editCardBar);
		}

		public IEnumerator ReplaceCards(Player player, int[] indeces, CardInfo[] newCards, string[] twoLetterCodes = null)
		{
			yield return ReplaceCards(player, indeces, newCards, twoLetterCodes, editCardBar: true);
		}

		public IEnumerator ReplaceCards(Player player, int[] indeces, CardInfo[] newCards, string[] twoLetterCodes = null, bool editCardBar = true)
		{
			if (twoLetterCodes == null)
			{
				twoLetterCodes = new string[indeces.Length];
				for (int k = 0; k < twoLetterCodes.Length; k++)
				{
					twoLetterCodes[k] = "";
				}
			}
			List<CardInfo> originalCards = new List<CardInfo>();
			foreach (CardInfo origCard in player.data.currentCards)
			{
				originalCards.Add(origCard);
			}
			List<CardInfo> newCardsToAssign = new List<CardInfo>();
			List<string> twoLetterCodesToAssign = new List<string>();
			List<bool> reassigns = new List<bool>();
			int l = 0;
			for (int j = 0; j < originalCards.Count; j++)
			{
				if (!indeces.Contains(j))
				{
					newCardsToAssign.Add(originalCards[j]);
					twoLetterCodesToAssign.Add("");
					reassigns.Add(item: true);
				}
				else if ((Object)(object)newCards[l] == (Object)null)
				{
					newCardsToAssign.Add(originalCards[j]);
					twoLetterCodesToAssign.Add("");
					reassigns.Add(item: true);
					l++;
				}
				else
				{
					newCardsToAssign.Add(newCards[l]);
					twoLetterCodesToAssign.Add(twoLetterCodes[l]);
					reassigns.Add(item: false);
					l++;
				}
			}
			RemoveAllCardsFromPlayer(player, editCardBar);
			for (int i = 0; i < 20; i++)
			{
				yield return null;
			}
			if (editCardBar)
			{
				CardBarUtils.instance.ClearCardBar(player);
			}
			yield return null;
			AddCardsToPlayer(player, newCardsToAssign.ToArray(), reassigns.ToArray(), twoLetterCodesToAssign.ToArray(), null, null, editCardBar);
		}

		public IEnumerator ReplaceCard(Player player, CardInfo cardToReplace, CardInfo newCard, string twoLetterCode = "", float forceDisplay = 0f, float forceDisplayDelay = 0f, SelectionType selectType = SelectionType.All)
		{
			yield return ReplaceCard(player, cardToReplace, newCard, twoLetterCode, forceDisplay, forceDisplayDelay, selectType, editCardBar: true);
		}

		public IEnumerator ReplaceCard(Player player, CardInfo cardToReplace, CardInfo newCard, string twoLetterCode = "", float forceDisplay = 0f, float forceDisplayDelay = 0f, SelectionType selectType = SelectionType.All, bool editCardBar = true)
		{
			if ((Object)(object)newCard == (Object)null)
			{
				yield break;
			}
			List<string> twoLetterCodes = new List<string>();
			List<float> forceDisplays = new List<float>();
			List<float> forceDisplayDelays = new List<float>();
			List<bool> reassigns = new List<bool>();
			List<CardInfo> originalCards = new List<CardInfo>();
			foreach (CardInfo origCard in player.data.currentCards)
			{
				originalCards.Add(origCard);
			}
			List<int> indeces = (from idx in Enumerable.Range(0, player.data.currentCards.Count)
				where ((Object)player.data.currentCards[idx]).name == ((Object)cardToReplace).name
				select idx).ToList();
			int start = 0;
			int end = indeces.Count;
			switch (selectType)
			{
			case SelectionType.All:
				start = 0;
				end = indeces.Count;
				break;
			case SelectionType.Newest:
				start = indeces.Count - 1;
				end = start + 1;
				break;
			case SelectionType.Oldest:
				start = 0;
				end = 1;
				break;
			case SelectionType.Random:
				start = rng.Next(0, indeces.Count);
				end = start + 1;
				break;
			}
			List<int> indecesToReplace = new List<int>();
			for (int k = start; k < end; k++)
			{
				indecesToReplace.Add(indeces[k]);
			}
			List<CardInfo> newCards = new List<CardInfo>();
			for (int j = 0; j < originalCards.Count; j++)
			{
				if (!indecesToReplace.Contains(j))
				{
					newCards.Add(originalCards[j]);
					twoLetterCodes.Add("");
					forceDisplays.Add(0f);
					forceDisplayDelays.Add(0f);
					reassigns.Add(item: true);
				}
				else
				{
					newCards.Add(newCard);
					twoLetterCodes.Add(twoLetterCode);
					forceDisplays.Add(forceDisplay);
					forceDisplayDelays.Add(forceDisplayDelay);
					reassigns.Add(item: false);
				}
			}
			RemoveAllCardsFromPlayer(player, editCardBar);
			for (int i = 0; i < 20; i++)
			{
				yield return null;
			}
			if (editCardBar)
			{
				CardBarUtils.instance.ClearCardBar(player);
			}
			yield return null;
			AddCardsToPlayer(player, newCards.ToArray(), reassigns.ToArray(), twoLetterCodes.ToArray(), forceDisplays.ToArray(), forceDisplayDelays.ToArray(), editCardBar);
		}

		[UnboundRPC]
		internal static void RPCA_AssignCard(string cardObjectName, int playerID, bool reassign, string twoLetterCode, float forceDisplay, float forceDisplayDelay)
		{
			RPCA_AssignCard(cardObjectName, playerID, reassign, twoLetterCode, forceDisplay, forceDisplayDelay, addToCardBar: true);
		}

		[UnboundRPC]
		internal static void RPCA_AssignCard(string cardObjectName, int playerID, bool reassign, string twoLetterCode, float forceDisplay, float forceDisplayDelay, bool addToCardBar)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			CardInfo cardWithObjectName = instance.GetCardWithObjectName(cardObjectName);
			ApplyCardStats componentInChildren = ((Component)cardWithObjectName).gameObject.GetComponentInChildren<ApplyCardStats>();
			typeof(ApplyCardStats).InvokeMember("Start", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, componentInChildren, new object[0]);
			((Component)componentInChildren).GetComponent<CardInfo>().sourceCard = cardWithObjectName;
			Player val = (Player)ExtensionMethods.InvokeMethod((object)PlayerManager.instance, "GetPlayerWithID", new object[1] { playerID });
			Traverse.Create((object)componentInChildren).Field("playerToUpgrade").SetValue((object)val);
			if (reassign && (Object)(object)((Component)cardWithObjectName).GetComponent<CustomCard>() != (Object)null)
			{
				try
				{
					Gun component = ((Component)((Component)val).GetComponent<Holding>().holdable).GetComponent<Gun>();
					CharacterData component2 = ((Component)val).GetComponent<CharacterData>();
					HealthHandler component3 = ((Component)val).GetComponent<HealthHandler>();
					Gravity component4 = ((Component)val).GetComponent<Gravity>();
					Block component5 = ((Component)val).GetComponent<Block>();
					GunAmmo componentInChildren2 = ((Component)component).GetComponentInChildren<GunAmmo>();
					CharacterStatModifiers component6 = ((Component)val).GetComponent<CharacterStatModifiers>();
					((Component)cardWithObjectName).GetComponent<CustomCard>().OnReassignCard(val, component, componentInChildren2, component2, component3, component4, component5, component6);
				}
				catch (NotImplementedException)
				{
				}
				catch (Exception ex2)
				{
					Debug.LogError((object)("[ModdingUtils] EXCEPTION: " + ex2.GetType().ToString() + "\nThrown by: " + ((Component)cardWithObjectName).GetComponent<CustomCard>().GetModName() + " - " + cardWithObjectName.cardName + " - OnReassignCard(Player, Gun, GunAmmo, HealthHandler, Gravity, Block, CharacterStatModifiers)"));
				}
			}
			if (!reassign || cardWithObjectName.GetAdditionalData().canBeReassigned)
			{
				typeof(ApplyCardStats).InvokeMember("ApplyStats", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, componentInChildren, new object[0]);
			}
			else
			{
				val.data.currentCards.Add(cardWithObjectName);
			}
			if (addToCardBar)
			{
				SilentAddToCardBar(val.playerID, ((Component)componentInChildren).GetComponent<CardInfo>().sourceCard, twoLetterCode, forceDisplay, forceDisplayDelay);
			}
		}

		[UnboundRPC]
		internal static void RPCA_AssignCardWithoutCardBar(string cardObjectName, int playerID, bool reassign, string twoLetterCode, float forceDisplay, float forceDisplayDelay)
		{
			RPCA_AssignCard(cardObjectName, playerID, reassign, twoLetterCode, forceDisplay, forceDisplayDelay, addToCardBar: false);
		}

		[UnboundRPC]
		public static void RPCA_FullReset(int playerID)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			Player target = (Player)ExtensionMethods.InvokeMethod((object)PlayerManager.instance, "GetPlayerWithID", new object[1] { playerID });
			typeof(Player).InvokeMember("FullReset", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, target, new object[0]);
		}

		[UnboundRPC]
		public static void RPCA_ClearCardBar(int playerID)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			CardBar[] array = (CardBar[])Traverse.Create((object)CardBarHandler.instance).Field("cardBars").GetValue();
			Player val = (Player)ExtensionMethods.InvokeMethod((object)PlayerManager.instance, "GetPlayerWithID", new object[1] { playerID });
			array[val.playerID].ClearBar();
		}

		public bool CardIsUniqueFromCards(CardInfo card, CardInfo[] cards)
		{
			if ((Object)(object)card == (Object)null)
			{
				return false;
			}
			bool result = true;
			foreach (CardInfo val in cards)
			{
				if (((Object)card).name == ((Object)val).name)
				{
					result = false;
				}
			}
			return result;
		}

		public bool CardIsNotBlacklisted(CardInfo card, CardCategory[] blacklistedCategories)
		{
			if ((Object)(object)card == (Object)null)
			{
				return false;
			}
			bool flag = card.categories.Intersect(blacklistedCategories).Any();
			return !flag;
		}

		public bool CardDoesNotConflictWithCardsCategories(CardInfo card, CardInfo[] cards)
		{
			if ((Object)(object)card == (Object)null)
			{
				return false;
			}
			bool flag = false;
			if (cards.Length == 0)
			{
				return !flag;
			}
			foreach (CardInfo val in cards)
			{
				if (card.categories != null && val.blacklistedCategories != null && card.categories.Intersect(val.blacklistedCategories).Any())
				{
					flag = true;
				}
			}
			return !flag;
		}

		public bool CardDoesNotConflictWithCards(CardInfo card, CardInfo[] cards)
		{
			if ((Object)(object)card == (Object)null)
			{
				return false;
			}
			bool flag = false;
			if (cards.Length == 0)
			{
				return !flag;
			}
			foreach (CardInfo val in cards)
			{
				if (card.categories != null && val.blacklistedCategories != null && card.categories.Intersect(val.blacklistedCategories).Any())
				{
					flag = true;
				}
			}
			return !flag && (card.allowMultiple || cards.All((CardInfo cardinfo) => ((Object)cardinfo).name != ((Object)card).name));
		}

		public bool PlayerIsAllowedCard(Player player, CardInfo card)
		{
			if ((Object)(object)card == (Object)null)
			{
				return false;
			}
			if ((Object)(object)player == (Object)null)
			{
				return true;
			}
			bool flag = false;
			foreach (CardInfo currentCard in player.data.currentCards)
			{
				if (card.categories.Intersect(currentCard.blacklistedCategories).Any())
				{
					flag = true;
				}
			}
			if (card.categories.Intersect(player.data.stats.GetAdditionalData().blacklistedCategories).Any())
			{
				flag = true;
			}
			bool flag2 = true;
			if (cardValidationFunctions.Count > 0)
			{
				flag2 = !cardValidationFunctions.Any(delegate(Func<Player, CardInfo, bool> f)
				{
					bool flag3 = true;
					try
					{
						flag3 = f(player, card);
					}
					catch
					{
						flag3 = true;
					}
					return !flag3;
				});
			}
			return !flag && (card.allowMultiple || player.data.currentCards.All((CardInfo cardinfo) => ((Object)((Component)cardinfo).gameObject).name != ((Object)((Component)card).gameObject).name)) && flag2;
		}

		public void AddCardValidationFunction(Func<Player, CardInfo, bool> function)
		{
			cardValidationFunctions.Add(function);
		}

		public int CountPlayerCardsWithCondition(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> condition)
		{
			return GetPlayerCardsWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, condition).Length;
		}

		public CardInfo[] GetPlayerCardsWithCondition(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> condition)
		{
			if (player?.data?.currentCards == null)
			{
				return (CardInfo[])(object)new CardInfo[0];
			}
			return player.data.currentCards.Where((CardInfo cardinfo) => condition(cardinfo, player, gun, gunAmmo, data, health, gravity, block, characterStats)).ToArray();
		}

		public int NORARITY_GetRandomCardIDWithCondition(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> condition, int maxattempts = 1000)
		{
			CardInfo val = NORARITY_GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, condition, maxattempts);
			if ((Object)(object)val != (Object)null)
			{
				return GetCardID(val);
			}
			return -1;
		}

		public CardInfo NORARITY_GetRandomCardWithCondition(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> condition, int maxattempts = 1000)
		{
			CardInfo[] array = activeCards.Where((CardInfo card) => condition(card, player, gun, gunAmmo, data, health, gravity, block, characterStats) && PlayerIsAllowedCard(player, card)).ToArray();
			if (array.Length == 0)
			{
				return null;
			}
			int num = rng.Next(0, array.Length);
			return array[num];
		}

		public CardInfo NORARITY_DrawRandomCardWithCondition(CardInfo[] cardsToDrawFrom, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> condition, int maxattempts = 1000)
		{
			cardsToDrawFrom = cardsToDrawFrom.Where((CardInfo card) => condition(card, player, gun, gunAmmo, data, health, gravity, block, characterStats) && PlayerIsAllowedCard(player, card)).ToArray();
			if (cardsToDrawFrom.Length == 0)
			{
				return null;
			}
			int num = rng.Next(0, cardsToDrawFrom.Length);
			return cardsToDrawFrom[num];
		}

		public CardInfo DrawRandomCardWithCondition(CardInfo[] cardsToDrawFrom, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> condition, int maxattempts = 1000)
		{
			cardsToDrawFrom = cardsToDrawFrom.Where((CardInfo card) => condition(card, player, gun, gunAmmo, data, health, gravity, block, characterStats) && PlayerIsAllowedCard(player, card)).ToArray();
			if (cardsToDrawFrom.Length == 0)
			{
				return null;
			}
			return CardChoicePatchGetRanomCard.OrignialGetRanomCard(cardsToDrawFrom).GetComponent<CardInfo>();
		}

		public CardInfo GetRandomCardWithCondition(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats, Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool> condition, int maxattempts = 1000)
		{
			CardInfo[] array = activeCards.Where((CardInfo card) => condition(card, player, gun, gunAmmo, data, health, gravity, block, characterStats) && PlayerIsAllowedCard(player, card)).ToArray();
			if (array.Length == 0)
			{
				return null;
			}
			return CardChoicePatchGetRanomCard.OrignialGetRanomCard(array).GetComponent<CardInfo>();
		}

		[Obsolete("GetCardID(string) is deprecated, use GetCardIDFromObjectName(string) instead.")]
		public int GetCardID(string cardName)
		{
			try
			{
				return (from card in allCards
					where card.cardName == cardName
					select GetCardID(card)).First();
			}
			catch
			{
				return -1;
			}
		}

		public int GetCardIDFromObjectName(string objectName)
		{
			try
			{
				return (from card in allCards
					where ((Object)card).name == objectName
					select GetCardID(card)).First();
			}
			catch
			{
				return -1;
			}
		}

		public int GetCardID(CardInfo card)
		{
			return Array.IndexOf(allCards.ToArray(), card);
		}

		public CardInfo GetCardWithID(int cardID)
		{
			try
			{
				return allCards[cardID];
			}
			catch
			{
				return null;
			}
		}

		[Obsolete("GetCardWithName is deprecated since multiple cards can have the same cardName. Use GetCardWithObjectName instead and provided the desired Card's .name field.")]
		public CardInfo GetCardWithName(string cardName)
		{
			return allCards.Where((CardInfo card) => card.cardName == cardName).First();
		}

		public CardInfo GetCardWithObjectName(string name)
		{
			return allCards.Where((CardInfo card) => ((Object)card).name == name).First();
		}

		public CardInfo[] GetAllCardsWithCondition(CardChoice cardChoice, Player player, Func<CardInfo, Player, bool> condition)
		{
			List<CardInfo> list = new List<CardInfo>();
			CardInfo[] cards = cardChoice.cards;
			foreach (CardInfo val in cards)
			{
				if (condition(val, player))
				{
					list.Add(val);
				}
			}
			return list.ToArray();
		}

		public CardInfo[] GetAllCardsWithCondition(CardInfo[] cards, Player player, Func<CardInfo, Player, bool> condition)
		{
			List<CardInfo> list = new List<CardInfo>();
			foreach (CardInfo val in cards)
			{
				if (condition(val, player))
				{
					list.Add(val);
				}
			}
			return list.ToArray();
		}

		public static void SilentAddToCardBar(int playerID, CardInfo card, string twoLetterCode = "", float forceDisplay = 0f, float forceDisplayDelay = 0f)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_005d: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			CardBar[] array = (CardBar[])Traverse.Create((object)CardBarHandler.instance).Field("cardBars").GetValue();
			Traverse.Create((object)array[playerID]).Field("ci").SetValue((object)card);
			GameObject val = (GameObject)Traverse.Create((object)array[playerID]).Field("source").GetValue();
			GameObject val2 = Object.Instantiate<GameObject>(val, val.transform.position, val.transform.rotation, val.transform.parent);
			val2.transform.localScale = Vector3.one;
			string text = card.cardName;
			if (twoLetterCode != "")
			{
				text = twoLetterCode;
			}
			text = text.Substring(0, 2);
			string text2 = text[0].ToString().ToUpper();
			if (text.Length > 1)
			{
				string text3 = text[1].ToString().ToLower();
				text = text2 + text3;
			}
			else
			{
				text = text2;
			}
			((TMP_Text)val2.GetComponentInChildren<TextMeshProUGUI>()).text = text;
			Traverse.Create((object)val2.GetComponent<CardBarButton>()).Field("card").SetValue((object)card);
			val2.gameObject.SetActive(true);
		}

		public void AddHiddenCard(CardInfo card)
		{
			hiddenCards.Add(card);
		}
	}
	public static class FindPlayer
	{
		public static Player GetPlayerWithActorAndPlayerIDs(int actorID, int playerID)
		{
			Player result = null;
			foreach (Player player in PlayerManager.instance.players)
			{
				if (player.data.view.ControllerActorNr == actorID && player.playerID == playerID)
				{
					result = player;
					break;
				}
			}
			return result;
		}
	}
	public static class PlayerStatus
	{
		public static bool PlayerAlive(Player player)
		{
			return !player.data.dead;
		}

		public static bool PlayerSimulated(Player player)
		{
			return (bool)Traverse.Create((object)player.data.playerVel).Field("simulated").GetValue();
		}

		public static bool PlayerAliveAndSimulated(Player player)
		{
			return PlayerAlive(player) && PlayerSimulated(player);
		}

		public static int GetNumberOfEnemyPlayers(Player player)
		{
			int num = 0;
			foreach (Player player2 in PlayerManager.instance.players)
			{
				if (player2.teamID != player.teamID)
				{
					num++;
				}
			}
			return num;
		}

		public static List<Player> GetEnemyPlayers(Player player)
		{
			List<Player> list = new List<Player>();
			foreach (Player player2 in PlayerManager.instance.players)
			{
				if (player2.teamID != player.teamID)
				{
					list.Add(player2);
				}
			}
			return list;
		}

		public static Player GetRandomEnemyPlayer(Player player)
		{
			List<Player> enemyPlayers = GetEnemyPlayers(player);
			if (GetNumberOfEnemyPlayers(player) == 0)
			{
				return null;
			}
			return enemyPlayers[Random.Range(0, GetNumberOfEnemyPlayers(player))];
		}

		public static List<Player> GetOtherPlayers(Player player)
		{
			List<Player> list = new List<Player>();
			foreach (Player player2 in PlayerManager.instance.players)
			{
				if (player2.playerID != player.playerID)
				{
					list.Add(player2);
				}
			}
			return list;
		}
	}
	public class SortingController : MonoBehaviour
	{
		public enum Layer
		{
			Default,
			Background,
			UI,
			Map,
			Card,
			Player1,
			Player2,
			Player3,
			Player4,
			Player5,
			Player6,
			Player7,
			Player8,
			Player9,
			Player10,
			Front,
			MapParticle,
			MostFront
		}

		[SerializeField]
		private Layer sortingLayer;

		[SerializeField]
		private int sortingOrder = 0;

		[SerializeField]
		private Renderer[] objectToSet;

		private void Start()
		{
			Renderer[] array = objectToSet;
			foreach (Renderer val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					val.sortingLayerName = sortingLayer.ToString();
					val.sortingOrder = sortingOrder;
				}
			}
		}
	}
}
namespace ModdingUtils.RoundsEffects
{
	public class GravityDealtDamageEffect : HitEffect
	{
		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
		{
			if (!((Object)(object)damagedPlayer == (Object)null))
			{
				GravityEffect orAddComponent = ExtensionMethods.GetOrAddComponent<GravityEffect>(((Component)damagedPlayer).gameObject, false);
				orAddComponent.SetDuration(((Component)this).GetComponent<CharacterStatModifiers>().GetAdditionalData().gravityDurationOnDoDamage);
				orAddComponent.SetGravityForceMultiplier(((Component)this).GetComponent<CharacterStatModifiers>().GetAdditionalData().gravityMultiplierOnDoDamage);
				orAddComponent.ResetTimer();
				if (((Component)this).GetComponent<CharacterStatModifiers>().GetAdditionalData().gravityMultiplierOnDoDamage < 0f && damagedPlayer.data.isGrounded)
				{
					damagedPlayer.data.jump.Jump(true, 1f / damagedPlayer.data.stats.jump);
					CharacterData data = damagedPlayer.data;
					data.currentJumps++;
				}
			}
		}
	}
	public abstract class HitEffect : MonoBehaviour
	{
		public abstract void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null);

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
	public abstract class HitSurfaceEffect : MonoBehaviour
	{
		public abstract void Hit(Vector2 position, Vector2 normal, Vector2 velocity);

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
	public abstract class WasHitEffect : MonoBehaviour
	{
		public abstract void WasDealtDamage(Vector2 damage, bool selfDamage);

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
}
namespace ModdingUtils.Patches
{
	[HarmonyPatch(typeof(ApplyCardStats))]
	internal class CheckBulletsAfterGettingCards
	{
		[HarmonyPostfix]
		[HarmonyPatch("CopyGunStats")]
		private static void StopStackingObjectsToSpawn(ApplyCardStats __instance, Gun copyFromGun, Gun copyToGun)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			List<ObjectsToSpawn> list = new List<ObjectsToSpawn>();
			ObjectsToSpawn[] objectsToSpawn = copyToGun.objectsToSpawn;
			foreach (ObjectsToSpawn val in objectsToSpawn)
			{
				if (copyFromGun.objectsToSpawn.Contains(val))
				{
					ObjectsToSpawn val2 = new ObjectsToSpawn();
					int stacks = 0;
					if (val.stacks > 0)
					{
						stacks = val.stacks;
						val.stacks = 0;
					}
					CopyObjectsToSpawn(val2, val);
					val2.stacks = stacks;
					list.Add(val2);
				}
				else
				{
					list.Add(val);
				}
			}
			copyToGun.objectsToSpawn = list.ToArray();
		}

		private static void CopyObjectsToSpawn(ObjectsToSpawn to, ObjectsToSpawn from)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			to.effect = from.effect;
			to.direction = from.direction;
			to.spawnOn = from.spawnOn;
			to.spawnAsChild = from.spawnAsChild;
			to.numberOfSpawns = from.numberOfSpawns;
			to.normalOffset = from.normalOffset;
			to.stickToBigTargets = from.stickToBigTargets;
			to.stickToAllTargets = from.stickToAllTargets;
			to.zeroZ = from.zeroZ;
			to.AddToProjectile = from.AddToProjectile;
			to.removeScriptsFromProjectileObject = from.removeScriptsFromProjectileObject;
			to.scaleStacks = from.scaleStacks;
			to.scaleStackM = from.scaleStackM;
			to.scaleFromDamage = from.scaleFromDamage;
			to.stacks = from.stacks;
		}
	}
	[Serializable]
	[HarmonyPatch(typeof(CardChoice), "GetRanomCard")]
	public class CardChoicePatchGetRanomCard
	{
		internal static bool CardChoiceSpawnUniqueCardPatch;

		internal static Assembly UniqueCardPatch;

		[HarmonyPriority(800)]
		private static bool Prefix(CardChoice __instance, ref GameObject __result)
		{
			__result = null;
			if ((bool)ExtensionMethods.GetFieldValue((object)CardChoiceVisuals.instance, "isShowinig") && (Object)(object)PickingPlayer(__instance) != (Object)null)
			{
				__result = EfficientGetRanomCard(PickingPlayer(__instance));
			}
			else
			{
				__result = OrignialGetRanomCard();
			}
			return true;
		}

		public static GameObject EfficientGetRanomCard(Player player)
		{
			return EfficientGetRanomCard(player, CardChoice.instance.cards);
		}

		public static GameObject EfficientGetRanomCard(Player player, CardInfo[] cards)
		{
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			CardInfo[] source = cards.Where((CardInfo c) => Cards.instance.PlayerIsAllowedCard(player, c)).ToArray();
			CardInfo[] array = source.ToArray();
			try
			{
				if ((bool)ExtensionMethods.GetFieldValue((object)CardChoiceVisuals.instance, "isShowinig"))
				{
					List<string> spawnedCards = ((List<GameObject>)ExtensionMethods.GetFieldValue((object)CardChoice.instance, "spawnedCards")).Select((GameObject obj) => obj.GetComponent<CardInfo>().cardName).ToList();
					array = ((!CardChoiceSpawnUniqueCardPatch) ? source.Where((CardInfo c) => !spawnedCards.Contains(c.cardName)).ToArray() : source.Where((CardInfo c) => c.categories.Contains(ExtensionMethods.GetFieldValue((object)UniqueCardPatch.GetType("CustomCardCategories"), "CanDrawMultipleCategory")) || !spawnedCards.Contains(c.cardName)).ToArray());
				}
			}
			catch (NullReferenceException)
			{
				array = source.ToArray();
			}
			if (!array.Any())
			{
				if (CardChoiceSpawnUniqueCardPatch)
				{
					return ((Component)(CardInfo)UniqueCardPatch.GetType("CardChoiceSpawnUniqueCardPatch").GetField("NullCard", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).gameObject;
				}
				return ((Component)((IEnumerable<CardInfo>)CardChoice.instance.cards).FirstOrDefault((Func<CardInfo, bool>)((CardInfo c) => c.cardName.ToLower() == "huge"))).gameObject;
			}
			return OrignialGetRanomCard(array);
		}

		public static GameObject OrignialGetRanomCard()
		{
			return OrignialGetRanomCard(CardChoice.instance.cards);
		}

		public static GameObject OrignialGetRanomCard(CardInfo[] cards)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Invalid comparison between Unknown and I4
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Invalid comparison between Unknown and I4
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Invalid comparison between Unknown and I4
			GameObject result = null;
			float num = 0f;
			for (int i = 0; i < cards.Length; i++)
			{
				if ((int)cards[i].rarity == 0)
				{
					num += 10f;
				}
				if ((int)cards[i].rarity == 1)
				{
					num += 4f;
				}
				if ((int)cards[i].rarity == 2)
				{
					num += 1f;
				}
			}
			float num2 = Random.Range(0f, num);
			for (int j = 0; j < cards.Length; j++)
			{
				if ((int)cards[j].rarity == 0)
				{
					num2 -= 10f;
				}
				if ((int)cards[j].rarity == 1)
				{
					num2 -= 4f;
				}
				if ((int)cards[j].rarity == 2)
				{
					num2 -= 1f;
				}
				if (num2 <= 0f)
				{
					result = ((Component)cards[j]).gameObject;
					break;
				}
			}
			return result;
		}

		internal static Player PickingPlayer(CardChoice cardChoice)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Invalid comparison between Unknown and I4
			Player val = null;
			try
			{
				if ((int)(PickerType)ExtensionMethods.GetFieldValue((object)cardChoice, "pickerType") == 0)
				{
					return PlayerManager.instance.GetPlayersInTeam(cardChoice.pickrID).FirstOrDefault();
				}
				return (cardChoice.pickrID < PlayerManager.instance.players.Count() && cardChoice.pickrID >= 0) ? PlayerManager.instance.players[cardChoice.pickrID] : null;
			}
			catch
			{
				return null;
			}
		}
	}
	[HarmonyPatch(typeof(CardChoice))]
	public class CardChoicePatchGetSourceCard
	{
		[HarmonyPostfix]
		[HarmonyPatch("GetSourceCard")]
		private static void CheckHiddenCards(CardInfo info, ref CardInfo __result)
		{
			if ((Object)(object)__result != (Object)null)
			{
				return;
			}
			CardInfo[] array = Cards.instance.HiddenCards.ToArray();
			for (int i = 0; i < array.Length; i++)
			{
				if (((Object)((Component)array[i]).gameObject).name + "(Clone)" == ((Object)((Component)info).gameObject).name)
				{
					__result = array[i];
					break;
				}
			}
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
	internal class CharacterStatModifiers_Patch_ResetStats
	{
		private static void TryDestroy(Object obj)
		{
			if (obj != (Object)null)
			{
				Object.Destroy(obj);
			}
		}

		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			MethodInfo m_destroy = ExtensionMethods.GetMethodInfo(typeof(GameObject), "Destroy", new Type[1] { typeof(Object) });
			MethodInfo m_tryDestroy = ExtensionMethods.GetMethodInfo(typeof(CharacterStatModifiers_Patch_ResetStats), "TryDestroy");
			foreach (CodeInstruction code in instructions)
			{
				if (CodeInstructionExtensions.Calls(code, m_destroy))
				{
					yield return new CodeInstruction(OpCodes.Call, (object)m_tryDestroy);
				}
				else
				{
					yield return code;
				}
			}
		}
	}
	[Serializable]
	[HarmonyPatch(typeof(GunAmmo), "ReloadAmmo")]
	internal class GunAmmoPatchReloadAmmo
	{
		private static void Postfix(GunAmmo __instance)
		{
			__instance.ReDrawTotalBullets();
		}
	}
	[Serializable]
	[HarmonyPriority(800)]
	[HarmonyPatch(typeof(Player), "FullReset")]
	internal class PlayerPatchFullReset
	{
		private static void Prefix(Player __instance)
		{
			CustomEffects.DestroyAllEffects(((Component)__instance).gameObject);
		}
	}
	[Serializable]
	[HarmonyPatch(typeof(ProjectileHit), "Start")]
	internal class ProjectileHitPatchStart
	{
		private static void Prefix(ProjectileHit __instance)
		{
			__instance.GetAdditionalData().startTime = Time.time;
		}
	}
	[Serializable]
	[HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")]
	internal class ProjectileHitPatchRPCA_DoHit
	{
		private static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, bool wasBlocked, out bool __state)
		{
			__state = false;
			if (Time.time < __instance.GetAdditionalData().startTime + __instance.GetAdditionalData().inactiveDelay || ((Object)(object)__instance.ownPlayer != (Object)null && (Object)(object)((Component)((Component)__instance.ownPlayer).GetComponent<Holding>().holdable).GetComponent<Gun>() != (Object)null && Time.time < __instance.GetAdditionalData().startTime + ((Component)((Component)__instance.ownPlayer).GetComponent<Holding>().holdable).GetComponent<Gun>().GetAdditionalData().inactiveDelay))
			{
				__state = false;
				return false;
			}
			__state = true;
			return true;
		}

		private static void Postfix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, bool wasBlocked, bool __state)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: 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_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Expected O, but got Unknown
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Invalid comparison between Unknown and I4
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Invalid comparison between Unknown and I4
			if (!__state)
			{
				return;
			}
			HitInfo val = new HitInfo();
			val.collider = null;
			if (viewID != -1)
			{
				PhotonView photonView = PhotonNetwork.GetPhotonView(viewID);
				val.collider = ((Component)photonView).GetComponentInChildren<Collider2D>();
				val.transform = ((Component)photonView).transform;
			}
			else if (colliderID != -1)
			{
				val.collider = ((Component)MapManager.instance.currentMap.Map).GetComponentsInChildren<Collider2D>()[colliderID];
				val.transform = ((Component)val.collider).transform;
			}
			if (Object.op_Implicit((Object)(object)val.collider) && (Object)(object)((Component)__instance).gameObject.GetComponentInChildren<StopRecursion>() == (Object)null)
			{
				HitSurfaceEffect[] hitSurfaceEffects = __instance.ownPlayer.data.stats.GetAdditionalData().HitSurfaceEffects;
				HitSurfaceEffect[] array = hitSurfaceEffects;
				foreach (HitSurfaceEffect hitSurfaceEffect in array)
				{
					hitSurfaceEffect.Hit(hitPoint, hitNormal, vel);
				}
			}
			HealthHandler val2 = null;
			if (Object.op_Implicit((Object)(object)val.transform))
			{
				val2 = ((Component)val.transform).GetComponent<HealthHandler>();
			}
			if ((Object)(object)val2 == (Object)null)
			{
				return;
			}
			CharacterStatModifiers component = ((Component)val2).GetComponent<CharacterStatModifiers>();
			if ((Object)(object)component == (Object)null)
			{
				return;
			}
			Player ownPlayer = __instance.ownPlayer;
			Player player = ((CharacterData)Traverse.Create((object)component).Field("data").GetValue()).player;
			bool selfDamage = (Object)(object)ownPlayer != (Object)null && (Object)(object)((Component)ownPlayer).transform.root == (Object)(object)((Component)player).transform;
			WasHitEffect[] wasHitEffects = component.GetAdditionalData().WasHitEffects;
			HitEffect[] hitEffects = ownPlayer.data.stats.GetAdditionalData().HitEffects;
			if (!wasBlocked)
			{
				WasHitEffect[] array2 = wasHitEffects;
				foreach (WasHitEffect wasHitEffect in array2)
				{
					wasHitEffect.WasDealtDamage(Vector2.op_Implicit(((Component)__instance).transform.forward * __instance.damage * __instance.dealDamageMultiplierr), selfDamage);
				}
				HitEffect[] array3 = hitEffects;
				foreach (HitEffect hitEffect in array3)
				{
					hitEffect.DealtDamage(Vector2.op_Implicit(((Component)__instance).transform.forward * __instance.damage * __instance.dealDamageMultiplierr), selfDamage, player);
				}
			}
			if (!(__instance.ownPlayer.data.stats.GetAdditionalData().punch && wasBlocked))
			{
				return;
			}
			WasHitEffect[] array4 = wasHitEffects;
			foreach (WasHitEffect wasHitEffect2 in array4)
			{
				wasHitEffect2.WasDealtDamage(Vector2.op_Implicit(((Component)__instance).transform.forward * __instance.damage * __instance.dealDamageMultiplierr), selfDamage);
			}
			HitEffect[] array5 = hitEffects;
			foreach (HitEffect hitEffect2 in array5)
			{
				hitEffect2.DealtDamage(Vector2.op_Implicit(((Component)__instance).transform.forward * __instance.damage * __instance.dealDamageMultiplierr), selfDamage, player);
			}
			if (__instance.isAllowedToSpawnObjects)
			{
				GamefeelManager.GameFeel(Vector2.op_Implicit(((Component)__instance).transform.forward * 3f * __instance.shake));
				DynamicParticles.instance.PlayBulletHit(__instance.damage, ((Component)__instance).transform, val, __instance.projectileColor);
				for (int n = 0; n < __instance.objectsToSpawn.Length; n++)
				{
					ObjectsToSpawn.SpawnObject(((Component)__instance).transform, val, __instance.objectsToSpawn[n], val2, __instance.team, __instance.damage, (SpawnedAttack)Traverse.Create((object)__instance).Field("spawnedAttack").GetValue(), false);
				}
			}
			bool flag = false;
			if (__instance.effects != null && __instance.effects.Count != 0)
			{
				for (int num = 0; num < __instance.effects.Count; num++)
				{
					HasToReturn val3 = __instance.effects[num].DoHitEffect(val);
					if ((int)val3 == 0)
					{
						flag = true;
					}
					if ((int)val3 == 2)
					{
						return;
					}
				}
			}
			if (!flag)
			{
				if ((Action)Traverse.Create((object)__instance).Field("hitAction").GetValue() != null)
				{
					((Action)Traverse.Create((object)__instance).Field("hitAction").GetValue())();
				}
				if ((Action<HitInfo>)Traverse.Create((object)__instance).Field("hitActionWithData").GetValue() != null)
				{
					((Action<HitInfo>)Traverse.Create((object)__instance).Field("hitActionWithData").GetValue())(val);
				}
				Object.Destroy((Object)(object)__instance);
			}
		}
	}
}
namespace ModdingUtils.MonoBehaviours
{
	public class ReversibleColorEffect : ColorEffect
	{
		private int livesToEffect = 1;

		private int livesEffected;

		public void OnEnable()
		{
			if (livesEffected >= livesToEffect)
			{
				Object.Destroy((Object)(object)this);
			}
		}

		public void OnDisable()
		{
			livesEffected++;
			if (livesEffected >= livesToEffect)
			{
				Object.Destroy((Object)(object)this);
			}
		}

		public void SetLivesToEffect(int lives = 1)
		{
			livesToEffect = lives;
		}
	}
	public class ColorEffect : MonoBehaviour
	{
		internal ColorEffectBase colorEffectBase;

		private SetTeamColor[] teamColors;

		private Player player;

		private Color colorMinToSet;

		private Color colorMaxToSet;

		public void Awake()
		{
			player = ((Component)this).gameObject.GetComponent<Player>();
			colorEffectBase = ExtensionMethods.GetOrAddComponent<ColorEffectBase>(((Component)player).gameObject, false);
			colorEffectBase.colorEffectDrones.Add(this);
			teamColors = ((Component)((Component)player).transform.root).GetComponentsInChildren<SetTeamColor>();
		}

		public void Start()
		{
			ApplyColor();
		}

		public void Update()
		{
		}

		public void OnDestroy()
		{
			colorEffectBase.OnDroneDestroy(this);
		}

		public void ApplyColor()
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: 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)
			//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_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Expected O, but got Unknown
			if (((Component)player).gameObject.GetComponentInChildren<PlayerSkinHandler>().simpleSkin)
			{
				SpriteMask[] componentsInChildren = ((Component)((Component)((Component)player).gameObject.GetComponentInChildren<SetPlayerSpriteLayer>()).transform.root).GetComponentsInChildren<SpriteMask>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					((Component)componentsInChildren[i]).GetComponent<SpriteRenderer>().color = colorMaxToSet;
				}
				return;
			}
			PlayerSkinParticle[] componentsInChildren2 = ((Component)player).gameObject.GetComponentsInChildren<PlayerSkinParticle>();
			for (int j = 0; j < componentsInChildren2.Length; j++)
			{
				ParticleSystem val = (ParticleSystem)ExtensionMethods.GetFieldValue((object)componentsInChildren2[j], "part");
				MainModule main = val.main;
				MainModule main2 = val.main;
				MinMaxGradient startColor = ((MainModule)(ref main2)).startColor;
				((MinMaxGradient)(ref startColor)).colorMin = colorMinToSet;
				((MinMaxGradient)(ref startColor)).colorMax = colorMaxToSet;
				((MainModule)(ref main)).startColor = startColor;
			}
			SetTeamColor[] array = teamColors;
			for (int k = 0; k < array.Length; k++)
			{
				array[k].Set(new PlayerSkin
				{
					color = colorMaxToSet,
					backgroundColor = colorMaxToSet,
					winText = colorMaxToSet,
					particleEffect = colorMaxToSet
				});
			}
		}

		public void SetColor(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			colorMaxToSet = color;
			colorMinToSet = color;
		}

		public void SetColorMax(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			colorMaxToSet = color;
		}

		public void SetColorMin(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			colorMinToSet = color;
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}

		public Color GetOriginalColorMax()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			return colorEffectBase.originalColorMax;
		}

		public Color GetOriginalColorMin()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			return colorEffectBase.originalColorMin;
		}
	}
	internal sealed class ColorEffectBase : MonoBehaviour
	{
		internal List<ColorEffect> colorEffectDrones = new List<ColorEffect>();

		internal Color originalColorMax;

		internal Color originalColorMin;

		private Player player;

		private SetTeamColor[] teamColors;

		public void Awake()
		{
			//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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			player = ((Component)this).gameObject.GetComponent<Player>();
			originalColorMin = GetPlayerColor.GetColorMin(player);
			originalColorMax = GetPlayerColor.GetColorMax(player);
			teamColors = ((Component)((Component)player).transform.root).GetComponentsInChildren<SetTeamColor>();
		}

		public void OnDroneDestroy(ColorEffect colorEffect)
		{
			int num = colorEffectDrones.IndexOf(colorEffect);
			if (colorEffectDrones.Count == 1 && num == 0)
			{
				ResetColor();
			}
			else if (num == colorEffectDrones.Count - 1)
			{
				colorEffectDrones[num - 1].ApplyColor();
			}
			colorEffectDrones.Remove(colorEffect);
		}

		private void ResetColor()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			PlayerSkinParticle[] componentsInChildren = ((Component)player).gameObject.GetComponentsInChildren<PlayerSkinParticle>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				ParticleSystem val = (ParticleSystem)ExtensionMethods.GetFieldValue((object)componentsInChildren[i], "part");
				MainModule main = val.main;
				MainModule main2 = val.main;
				MinMaxGradient startColor = ((MainModule)(ref main2)).startColor;
				((MinMaxGradient)(ref startColor)).colorMin = originalColorMin;
				((MinMaxGradient)(ref startColor)).colorMax = originalColorMax;
				((MainModule)(ref main)).startColor = startColor;
			}
			SetTeamColor[] array = teamColors;
			for (int j = 0; j < array.Length; j++)
			{
				array[j].Set(new PlayerSkin
				{
					color = originalColorMax,
					backgroundColor = originalColorMax,
					winText = originalColorMax,
					particleEffect = originalColorMax
				});
			}
		}

		public void OnDestroy()
		{
			foreach (ColorEffect colorEffectDrone in colorEffectDrones)
			{
				if ((Object)(object)colorEffectDrone != (Object)null)
				{
					Object.Destroy((Object)(object)colorEffectDrone);
				}
			}
			ResetColor();
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
	public class GunColorEffect : MonoBehaviour
	{
		private GunColorEffectBase gunColorEffectBase;

		private Player player;

		private Gun gun;

		private Color colorToSet;

		public void Awake()
		{
			player = ((Component)this).gameObject.GetComponent<Player>();
			gun = ((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>();
			gunColorEffectBase = ExtensionMethods.GetOrAddComponent<GunColorEffectBase>(((Component)player).gameObject, false);
			gunColorEffectBase.gunColorEffectDrones.Add(this);
		}

		private void Start()
		{
			ApplyColor();
		}

		private void Update()
		{
		}

		public void OnDestroy()
		{
			gunColorEffectBase.OnDroneDestroy(this);
		}

		public void ApplyColor()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			gun.projectileColor = colorToSet;
		}

		public void SetColor(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			colorToSet = color;
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
	internal sealed class GunColorEffectBase : MonoBehaviour
	{
		internal List<GunColorEffect> gunColorEffectDrones = new List<GunColorEffect>();

		private Color originalColor;

		private Player player;

		private Gun gun;

		public void Awake()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			player = ((Component)this).gameObject.GetComponent<Player>();
			gun = ((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>();
			originalColor = gun.projectileColor;
		}

		public void OnDroneDestroy(GunColorEffect gunColorEffect)
		{
			int num = gunColorEffectDrones.IndexOf(gunColorEffect);
			if (gunColorEffectDrones.Count == 1 && num == 0)
			{
				ResetColor();
			}
			else if (num == gunColorEffectDrones.Count - 1)
			{
				gunColorEffectDrones[num - 1].ApplyColor();
			}
			gunColorEffectDrones.Remove(gunColorEffect);
		}

		private void ResetColor()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			gun.projectileColor = originalColor;
		}

		public void OnDestroy()
		{
			foreach (GunColorEffect gunColorEffectDrone in gunColorEffectDrones)
			{
				if ((Object)(object)gunColorEffectDrone != (Object)null)
				{
					Object.Destroy((Object)(object)gunColorEffectDrone);
				}
			}
			ResetColor();
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
	public class ColorFlash : MonoBehaviour
	{
		private float duration = 1f;

		private float startTime;

		private int numberOfFlashes = 1;

		private float delayBetweenFlashes = 1f;

		private Color colorMinToFlash = Color.black;

		private Color colorMaxToFlash = Color.black;

		private int flashNum;

		private bool flashing;

		private ColorEffect colorEffect;

		private Player player;

		private void Awake()
		{
			player = ((Component)this).gameObject.GetComponent<Player>();
		}

		private void Start()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			ResetTimer();
			Flash(colorMinToFlash, colorMaxToFlash);
		}

		private void Update()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			if (flashing && Time.time >= startTime + duration)
			{
				Unflash();
			}
			else if (!flashing && Time.time >= startTime + delayBetweenFlashes)
			{
				Flash(colorMinToFlash, colorMaxToFlash);
			}
			else if (flashNum >= numberOfFlashes)
			{
				Destroy();
			}
		}

		public void OnDestroy()
		{
			if ((Object)(object)colorEffect != (Object)null)
			{
				Object.Destroy((Object)(object)colorEffect);
			}
		}

		public void Flash(Color colorMin, Color colorMax)
		{
			//IL_002b: 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)
			flashing = true;
			ResetTimer();
			colorEffect = ((Component)player).gameObject.AddComponent<ColorEffect>();
			colorEffect.SetColorMax(colorMax);
			colorEffect.SetColorMin(colorMin);
		}

		public void Unflash()
		{
			flashing = false;
			flashNum++;
			ResetTimer();
			if ((Object)(object)colorEffect != (Object)null)
			{
				Object.Destroy((Object)(object)colorEffect);
			}
		}

		public void ResetTimer()
		{
			startTime = Time.time;
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}

		public void SetNumberOfFlashes(int flashes)
		{
			numberOfFlashes = flashes;
		}

		public void SetDelayBetweenFlashes(float delay)
		{
			delayBetweenFlashes = delay;
		}

		public void SetColor(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			colorMaxToFlash = color;
			colorMinToFlash = color;
		}

		public void SetColorMax(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			colorMaxToFlash = color;
		}

		public void SetColorMin(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			colorMinToFlash = color;
		}

		public void SetDuration(float duration)
		{
			this.duration = duration;
		}

		public Color GetOriginalColorMax()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return colorEffect.colorEffectBase.originalColorMax;
		}

		public Color GetOriginalColorMin()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			return colorEffect.colorEffectBase.originalColorMin;
		}
	}
	public abstract class CounterReversibleEffect : ReversibleEffect
	{
		public enum CounterStatus
		{
			Apply,
			Wait,
			Remove,
			

BestMod/bin/Debug/UnboundLib.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using ExitGames.Client.Photon;
using HarmonyLib;
using Jotunn.Utils;
using On;
using Photon.Pun;
using Photon.Realtime;
using TMPro;
using UnboundLib.Cards;
using UnboundLib.Extensions;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.UI.ProceduralImage;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("3.2.12")]
[assembly: AssemblyInformationalVersion("3.2.12")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.2.12.0")]
[module: UnverifiableCode]
namespace Jotunn.Utils
{
	public static class AssetUtils
	{
		public const char AssetBundlePathSeparator = '$';

		public static Texture2D LoadTexture(string texturePath, bool relativePath = true)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			string text = texturePath;
			if (relativePath)
			{
				text = Path.Combine(Paths.PluginPath, texturePath);
			}
			if (!File.Exists(text))
			{
				return null;
			}
			if (!text.EndsWith(".png") && !text.EndsWith(".jpg"))
			{
				throw new Exception("LoadTexture can only load png or jpg textures");
			}
			byte[] array = File.ReadAllBytes(text);
			Texture2D val = new Texture2D(2, 2);
			val.LoadRawTextureData(array);
			return val;
		}

		public static Sprite LoadSpriteFromFile(string spritePath)
		{
			//IL_002a: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = LoadTexture(spritePath);
			if ((Object)(object)val != (Object)null)
			{
				return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), default(Vector2), 100f);
			}
			return null;
		}

		public static AssetBundle LoadAssetBundle(string bundlePath)
		{
			string text = Path.Combine(Paths.PluginPath, bundlePath);
			if (!File.Exists(text))
			{
				return null;
			}
			return AssetBundle.LoadFromFile(text);
		}

		public static AssetBundle LoadAssetBundleFromResources(string bundleName, Assembly resourceAssembly)
		{
			if (resourceAssembly == null)
			{
				throw new ArgumentNullException("Parameter resourceAssembly can not be null.");
			}
			string text = null;
			try
			{
				text = resourceAssembly.GetManifestResourceNames().Single((string str) => str.EndsWith(bundleName));
			}
			catch (Exception)
			{
			}
			if (text == null)
			{
				Debug.LogError("AssetBundle " + bundleName + " not found in assembly manifest");
				return null;
			}
			using Stream stream = resourceAssembly.GetManifestResourceStream(text);
			return AssetBundle.LoadFromStream(stream);
		}

		public static string LoadText(string path)
		{
			string text = Path.Combine(Paths.PluginPath, path);
			if (!File.Exists(text))
			{
				Debug.LogError("Error, failed to load contents from non-existant path: $" + text);
				return null;
			}
			return File.ReadAllText(text);
		}

		public static Sprite LoadSprite(string assetPath)
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			string text = Path.Combine(Paths.PluginPath, assetPath);
			if (!File.Exists(text))
			{
				return null;
			}
			if (text.Contains('$'.ToString()))
			{
				string[] array = text.Split(new char[1] { '$' });
				string text2 = array[0];
				string text3 = array[1];
				AssetBundle obj = AssetBundle.LoadFromFile(text2);
				Sprite result = obj.LoadAsset<Sprite>(text3);
				obj.Unload(false);
				return result;
			}
			Texture2D val = LoadTexture(text, relativePath: false);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return null;
			}
			return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero);
		}
	}
}
namespace UnboundLib
{
	public class NetworkEventCallbacks : MonoBehaviourPunCallbacks
	{
		public delegate void NetworkEvent();

		public event NetworkEvent OnJoinedRoomEvent;

		public event NetworkEvent OnLeftRoomEvent;

		public override void OnJoinedRoom()
		{
			this.OnJoinedRoomEvent?.Invoke();
		}

		public override void OnLeftRoom()
		{
			this.OnLeftRoomEvent?.Invoke();
		}

		public override void OnPlayerLeftRoom(Player otherPlayer)
		{
			foreach (Player item in PlayerManager.instance.players.Where((Player p) => p.data.view.ControllerActorNr == otherPlayer.ActorNumber).ToList())
			{
				GameModeManager.CurrentHandler.PlayerLeft(item);
			}
		}
	}
	public static class NetworkingManager
	{
		public delegate void PhotonEvent(object[] objects);

		private static RaiseEventOptions raiseEventOptionsAll;

		private static RaiseEventOptions raiseEventOptionsOthers;

		private static SendOptions reliableSendOptions;

		private static SendOptions unreliableSendOptions;

		private static Dictionary<string, PhotonEvent> events;

		private static Dictionary<Tuple<Type, string>, MethodInfo> rpcMethodCache;

		private static byte ModEventCode;

		static NetworkingManager()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_0022: Expected O, but got Unknown
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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)
			raiseEventOptionsAll = new RaiseEventOptions
			{
				Receivers = (ReceiverGroup)1
			};
			raiseEventOptionsOthers = new RaiseEventOptions
			{
				Receivers = (ReceiverGroup)0
			};
			SendOptions val = default(SendOptions);
			((SendOptions)(ref val)).Reliability = true;
			reliableSendOptions = val;
			val = default(SendOptions);
			((SendOptions)(ref val)).Reliability = false;
			unreliableSendOptions = val;
			events = new Dictionary<string, PhotonEvent>();
			rpcMethodCache = new Dictionary<Tuple<Type, string>, MethodInfo>();
			ModEventCode = 69;
			PhotonNetwork.NetworkingClient.EventReceived += OnEvent;
		}

		public static void RegisterEvent(string eventName, PhotonEvent handler)
		{
			if (events.ContainsKey(eventName))
			{
				throw new Exception("An event handler is already registered with the event name: " + eventName);
			}
			events.Add(eventName, handler);
		}

		public static void RaiseEvent(string eventName, RaiseEventOptions options, params object[] data)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			if (data == null)
			{
				data = Array.Empty<object>();
			}
			List<object> list = new List<object> { eventName };
			list.AddRange(data);
			PhotonNetwork.RaiseEvent(ModEventCode, (object)list.ToArray(), options, reliableSendOptions);
		}

		public static void RaiseEvent(string eventName, params object[] data)
		{
			RaiseEvent(eventName, raiseEventOptionsAll, data);
		}

		public static void RaiseEventOthers(string eventName, params object[] data)
		{
			RaiseEvent(eventName, raiseEventOptionsOthers, data);
		}

		public static void RPC(Type targetType, string methodName, RaiseEventOptions options, SendOptions sendOptions, params object[] data)
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			if (data == null)
			{
				data = Array.Empty<object>();
			}
			if (PhotonNetwork.OfflineMode || PhotonNetwork.CurrentRoom == null)
			{
				MethodInfo rPCMethod = GetRPCMethod(targetType, methodName);
				if (rPCMethod != null)
				{
					rPCMethod.Invoke(null, data.ToArray());
				}
			}
			else
			{
				List<object> list = new List<object> { targetType.AssemblyQualifiedName, methodName };
				list.AddRange(data);
				PhotonNetwork.RaiseEvent(ModEventCode, (object)list.ToArray(), options, sendOptions);
			}
		}

		public static void RPC(Type targetType, string methodName, RaiseEventOptions options, params object[] data)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			RPC(targetType, methodName, options, reliableSendOptions, data);
		}

		public static void RPC(Type targetType, string methodName, params object[] data)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			RPC(targetType, methodName, raiseEventOptionsAll, reliableSendOptions, data);
		}

		public static void RPC_Others(Type targetType, string methodName, params object[] data)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			RPC(targetType, methodName, raiseEventOptionsOthers, reliableSendOptions, data);
		}

		public static void RPC_Unreliable(Type targetType, string methodName, params object[] data)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			RPC(targetType, methodName, raiseEventOptionsAll, unreliableSendOptions, data);
		}

		public static void RPC_Others_Unreliable(Type targetType, string methodName, params object[] data)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			RPC(targetType, methodName, raiseEventOptionsOthers, unreliableSendOptions, data);
		}

		public static void OnEvent(EventData photonEvent)
		{
			if (photonEvent.Code != ModEventCode)
			{
				return;
			}
			object[] array = null;
			try
			{
				array = (object[])photonEvent.CustomData;
			}
			catch (Exception ex)
			{
				Debug.LogError(ex.ToString());
			}
			try
			{
				if (array == null)
				{
					return;
				}
				Type type = Type.GetType((string)array[0]);
				PhotonEvent value;
				if (type != null)
				{
					MethodInfo rPCMethod = GetRPCMethod(type, (string)array[1]);
					if (rPCMethod != null)
					{
						rPCMethod.Invoke(null, array.Skip(2).ToArray());
					}
				}
				else if (events.TryGetValue((string)array[0], out value))
				{
					value?.Invoke(array.Skip(1).ToArray());
				}
			}
			catch (Exception ex2)
			{
				Debug.LogError("Network Error: \n" + ex2.ToString());
			}
		}

		private static MethodInfo GetRPCMethod(Type type, string methodName)
		{
			Tuple<Type, string> key = new Tuple<Type, string>(type, methodName);
			if (rpcMethodCache.ContainsKey(key))
			{
				return rpcMethodCache[key];
			}
			MethodInfo methodInfo = (from m in type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)
				let attr = m.GetCustomAttribute<UnboundRPC>()
				where attr != null
				let name = attr.EventID ?? m.Name
				where methodName == name
				select m).FirstOrDefault();
			if (methodInfo == null)
			{
				throw new Exception("There is no method '" + type.FullName + "#" + methodName + "' found");
			}
			if (!methodInfo.IsStatic)
			{
				throw new Exception("UnboundRPC methods must be static! Correct this for method '" + type.FullName + "#" + methodInfo.Name + "'");
			}
			rpcMethodCache.Add(key, methodInfo);
			return rpcMethodCache[key];
		}
	}
	[DisallowMultipleComponent]
	public class PingMonitor : MonoBehaviourPunCallbacks
	{
		public struct PingColor
		{
			public string HTMLCode;

			public PingColor(string code)
			{
				HTMLCode = code;
			}
		}

		public Dictionary<int, bool> ConnectedPlayers = new Dictionary<int, bool>();

		public Dictionary<int, int> PlayerPings = new Dictionary<int, int>();

		public Action<int, int> PingUpdateAction;

		public static PingMonitor instance;

		private int pingUpdate;

		private void Start()
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.CurrentRoom == null)
			{
				return;
			}
			foreach (Player value in PhotonNetwork.CurrentRoom.Players.Values)
			{
				ConnectedPlayers.Add(value.ActorNumber, value: true);
			}
		}

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			else if ((Object)(object)instance != (Object)(object)this)
			{
				Object.DestroyImmediate((Object)(object)this);
			}
		}

		private void FixedUpdate()
		{
			if (!PhotonNetwork.OfflineMode)
			{
				pingUpdate++;
				if (pingUpdate > 25)
				{
					pingUpdate = 0;
					RPCA_UpdatePings();
				}
			}
		}

		public override void OnJoinedRoom()
		{
			pingUpdate = 0;
			ConnectedPlayers = new Dictionary<int, bool>();
			PlayerPings = new Dictionary<int, int>();
			foreach (Player value in PhotonNetwork.CurrentRoom.Players.Values)
			{
				ConnectedPlayers.Add(value.ActorNumber, value: true);
				PlayerPings.Add(value.ActorNumber, 0);
			}
			((MonoBehaviour)(object)this).ExecuteAfterFrames(15, delegate
			{
				NetworkingManager.RPC_Others(typeof(PingMonitor), "RPCA_UpdatePings");
				RPCA_UpdatePings();
			});
		}

		public override void OnLeftRoom()
		{
			ConnectedPlayers.Clear();
			ConnectedPlayers = new Dictionary<int, bool>();
			PlayerPings.Clear();
			PlayerPings = new Dictionary<int, int>();
		}

		public override void OnPlayerLeftRoom(Player otherPlayer)
		{
			ConnectedPlayers[otherPlayer.ActorNumber] = false;
			PlayerPings[otherPlayer.ActorNumber] = 0;
		}

		public override void OnPlayerEnteredRoom(Player newPlayer)
		{
			ConnectedPlayers[newPlayer.ActorNumber] = true;
			PlayerPings[newPlayer.ActorNumber] = 0;
		}

		public override void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps)
		{
			if (!((Dictionary<object, object>)(object)changedProps).TryGetValue((object)"Ping", out object value))
			{
				return;
			}
			PlayerPings[targetPlayer.ActorNumber] = (int)value;
			if (PingUpdateAction == null)
			{
				return;
			}
			try
			{
				PingUpdateAction(targetPlayer.ActorNumber, (int)value);
			}
			catch (Exception ex)
			{
				Debug.LogException(ex);
			}
		}

		public Player[] GetPlayersByOwnerActorNumber(int actorNumber)
		{
			Player[] array = PlayerManager.instance.players.Where((Player player) => player.data.view.OwnerActorNr == actorNumber).ToArray();
			if (array.Length == 0)
			{
				return null;
			}
			return array;
		}

		public PingColor GetPingColors(int ping)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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)
			Color colorGradient = GetColorGradient(Normalize(ping, 40f, 220f, 0f, 1f));
			return new PingColor("#" + ColorUtility.ToHtmlStringRGB(colorGradient));
		}

		private static float Normalize(float val, float valmin, float valmax, float min, float max)
		{
			return (val - valmin) / (valmax - valmin) * (max - min) + min;
		}

		private static Color GetColorGradient(float percentage)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			Gradient val = new Gradient();
			GradientColorKey[] array = (GradientColorKey[])(object)new GradientColorKey[3];
			array[0].color = Color.green;
			array[0].time = 0f;
			array[1].color = Color.yellow;
			array[1].time = 0.5f;
			array[2].color = Color.red;
			array[2].time = 1f;
			val.SetKeys(array, (GradientAlphaKey[])(object)new GradientAlphaKey[3]);
			return val.Evaluate(percentage);
		}

		[UnboundRPC]
		private static void RPCA_UpdatePings()
		{
			Hashtable customProperties = PhotonNetwork.LocalPlayer.CustomProperties;
			customProperties[(object)"Ping"] = PhotonNetwork.GetPing();
			PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
		}
	}
	[BepInPlugin("com.willis.rounds.unbound", "Rounds Unbound", "3.2.12")]
	[BepInProcess("Rounds.exe")]
	public class Unbound : BaseUnityPlugin
	{
		[StructLayout(LayoutKind.Sequential, Size = 1)]
		private struct NetworkEventType
		{
			public const string StartHandshake = "ModLoader_HandshakeStart";

			public const string FinishHandshake = "ModLoader_HandshakeFinish";
		}

		public delegate void OnJoinedDelegate();

		public delegate void OnLeftDelegate();

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action <>9__37_8;

			public static hook_Start <>9__37_3;

			public static hook_Start <>9__37_5;

			public static Func<IGameModeHandler, IEnumerator> <>9__37_6;

			public static hook_Start <>9__37_7;

			public static NetworkingManager.PhotonEvent <>9__41_0;

			public static NetworkingManager.PhotonEvent <>9__41_1;

			public static Func<bool, bool> <>9__42_0;

			public static Func<string, ModOptions.GUIListener> <>9__43_0;

			public static Func<ModOptions.GUIListener, bool> <>9__43_1;

			internal void <.ctor>b__37_8()
			{
				MapManager.instance.levels = LevelManager.activeLevels.ToArray();
				CardManager.RestoreCardToggles();
				ToggleCardsMenuHandler.RestoreCardToggleVisuals();
			}

			internal void <.ctor>b__37_3(orig_Start orig, GM_ArmsRace self)
			{
				((MonoBehaviour)self).StartCoroutine(<.ctor>g__ArmsRaceStartCoroutine|37_2(orig, self));
			}

			internal void <.ctor>b__37_5(orig_Start orig, GM_Test self)
			{
				((MonoBehaviour)self).StartCoroutine(<.ctor>g__SandboxStartCoroutine|37_4(orig, self));
			}

			internal IEnumerator <.ctor>b__37_6(IGameModeHandler handler)
			{
				return SyncModClients.DisableSyncModUi(SyncModClients.uiParent);
			}

			internal void <.ctor>b__37_7(orig_Start orig, CardChoice self)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				for (int i = 0; i < self.cards.Length; i++)
				{
					if (!((DefaultPool)PhotonNetwork.PrefabPool).ResourceCache.ContainsKey(((Object)((Component)self.cards[i]).gameObject).name))
					{
						PhotonNetwork.PrefabPool.RegisterPrefab(((Object)((Component)self.cards[i]).gameObject).name, ((Component)self.cards[i]).gameObject);
					}
				}
				Transform[] array = (Transform[])(object)new Transform[((Component)self).transform.childCount];
				for (int j = 0; j < array.Length; j++)
				{
					array[j] = ((Component)self).transform.GetChild(j);
				}
				self.SetFieldValue("children", array);
				self.cards = CardManager.activeCards.ToArray();
			}

			internal void <Start>b__41_0(object[] data)
			{
				if (PhotonNetwork.IsMasterClient)
				{
					NetworkingManager.RaiseEvent("ModLoader_HandshakeFinish", new object[2]
					{
						GameModeManager.CurrentHandlerID,
						GameModeManager.CurrentHandler?.Settings
					});
				}
				else
				{
					NetworkingManager.RaiseEvent("ModLoader_HandshakeFinish");
				}
			}

			internal void <Start>b__41_1(object[] data)
			{
				MapManager.instance.levels = LevelManager.activeLevels.ToArray();
				if (data.Length != 0)
				{
					GameModeManager.SetGameMode((string)data[0], setActive: false);
					GameModeManager.CurrentHandler.SetSettings((GameSettings)data[1]);
				}
			}

			internal bool <Update>b__42_0(bool b)
			{
				return b;
			}

			internal ModOptions.GUIListener <OnGUI>b__43_0(string md)
			{
				return ModOptions.GUIListeners[md];
			}

			internal bool <OnGUI>b__43_1(ModOptions.GUIListener data)
			{
				return data.guiEnabled;
			}
		}

		private const string ModId = "com.willis.rounds.unbound";

		private const string ModName = "Rounds Unbound";

		public const string Version = "3.2.12";

		public static readonly ConfigFile config = new ConfigFile(Path.Combine(Paths.ConfigPath, "UnboundLib.cfg"), true);

		private Canvas _canvas;

		internal static CardInfo templateCard;

		internal static List<string> loadedGUIDs = new List<string>();

		internal static List<string> loadedMods = new List<string>();

		internal static List<string> loadedVersions = new List<string>();

		internal static List<Action> handShakeActions = new List<Action>();

		public static readonly Dictionary<string, bool> lockInputBools = new Dictionary<string, bool>();

		internal static AssetBundle UIAssets;

		public static AssetBundle toggleUI;

		internal static AssetBundle linkAssets;

		private static GameObject modalPrefab;

		private TextMeshProUGUI text;

		internal static readonly ModCredits modCredits = new ModCredits("UNBOUND", new string[7] { "Willis (Creation, design, networking, custom cards, custom maps, and more)", "Tilastokeskus (Custom game modes, networking, structure)", "Pykess (Custom cards, stability, menus, syncing, extra player colors, disconnect handling, game mode framework)", "Ascyst (Quickplay)", "Boss Sloth Inc. (Menus, UI, custom maps, modded lobby syncing)", "willuwontu (Custom cards, ping UI)", "otDan (UI)" }, "Github", "https://github.com/Rounds-Modding/UnboundLib");

		public static Unbound Instance { get; private set; }

		public Canvas canvas
		{
			get
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_canvas != (Object)null)
				{
					return _canvas;
				}
				_canvas = new GameObject("UnboundLib Canvas").AddComponent<Canvas>();
				((Component)_canvas).gameObject.AddComponent<GraphicRaycaster>();
				_canvas.renderMode = (RenderMode)0;
				_canvas.pixelPerfect = false;
				Object.DontDestroyOnLoad((Object)(object)_canvas);
				return _canvas;
			}
		}

		[Obsolete("This should not be used anymore instead use CardManager.defaultCards")]
		internal static CardInfo[] defaultCards => CardManager.defaultCards;

		[Obsolete("This should not be used anymore instead use CardManager.activeCards")]
		internal static List<CardInfo> activeCards => CardManager.activeCards.ToList();

		[Obsolete("This should not be used anymore instead use CardManager.inactiveCards")]
		internal static List<CardInfo> inactiveCards => CardManager.inactiveCards;

		public static event OnJoinedDelegate OnJoinedRoom;

		public static event OnLeftDelegate OnLeftRoom;

		public Unbound()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_00d5: 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)
			//IL_00e0: Expected O, but got Unknown
			bool firstTime = true;
			MainMenuHandler.Awake += (hook_Awake)delegate(orig_Awake orig, MainMenuHandler self)
			{
				((MonoBehaviour)(object)this).ExecuteAfterFrames(5, delegate
				{
					MapManager.instance.levels = LevelManager.activeLevels.ToArray();
					CardManager.RestoreCardToggles();
					ToggleCardsMenuHandler.RestoreCardToggleVisuals();
				});
				((MonoBehaviour)this).StartCoroutine(AddTextWhenReady(firstTime ? 2f : 0.1f));
				ModOptions.instance.CreateModOptions(firstTime);
				Credits.Instance.CreateCreditsMenu(firstTime);
				MainMenuLinks.AddLinks(firstTime);
				bool time = firstTime;
				((MonoBehaviour)(object)this).ExecuteAfterSeconds(firstTime ? 0.4f : 0f, delegate
				{
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_007c: Expected O, but got Unknown
					//IL_0088: Unknown result type (might be due to invalid IL or missing references)
					//IL_0092: Expected O, but got Unknown
					//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d7: Expected O, but got Unknown
					//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f2: Expected O, but got Unknown
					GameObject gameObject = ((Component)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Group/Resume")).gameObject;
					GameObject optionsMenu = Object.Instantiate<GameObject>(((Component)((Component)MainMenuHandler.instance).transform.Find("Canvas/ListSelector/Options")).gameObject, ((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main"));
					Button component = ((Component)optionsMenu.transform.Find("Group/Back")).GetComponent<Button>();
					component.onClick = new ButtonClickedEvent();
					((UnityEvent)component.onClick).AddListener((UnityAction)delegate
					{
						((Component)optionsMenu.transform.Find("Group")).gameObject.SetActive(false);
						((Component)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Group")).gameObject.SetActive(true);
					});
					GameObject obj4 = Object.Instantiate<GameObject>(gameObject, ((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Group"));
					obj4.transform.SetSiblingIndex(2);
					((TMP_Text)obj4.GetComponentInChildren<TextMeshProUGUI>()).text = "OPTIONS";
					obj4.GetComponent<Button>().onClick = new ButtonClickedEvent();
					((UnityEvent)obj4.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
					{
						((Component)optionsMenu.transform.Find("Group")).gameObject.SetActive(true);
						((Component)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Group")).gameObject.SetActive(false);
					});
					if (time)
					{
						CardManager.FirstTimeStart();
					}
				});
				firstTime = false;
				orig.Invoke(self);
			};
			MainMenuHandler.Close += (hook_Close)delegate(orig_Close orig, MainMenuHandler self)
			{
				if ((Object)(object)text != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)text).gameObject);
				}
				orig.Invoke(self);
			};
			object obj = <>c.<>9__37_3;
			if (obj == null)
			{
				hook_Start val = delegate(orig_Start orig, GM_ArmsRace self)
				{
					((MonoBehaviour)self).StartCoroutine(ArmsRaceStartCoroutine(orig, self));
					static IEnumerator ArmsRaceStartCoroutine(orig_Start orig, GM_ArmsRace self)
					{
						yield return GameModeManager.TriggerHook("InitStart");
						orig.Invoke(self);
						yield return GameModeManager.TriggerHook("InitEnd");
					}
				};
				<>c.<>9__37_3 = val;
				obj = (object)val;
			}
			GM_ArmsRace.Start += (hook_Start)obj;
			object obj2 = <>c.<>9__37_5;
			if (obj2 == null)
			{
				hook_Start val2 = delegate(orig_Start orig, GM_Test self)
				{
					((MonoBehaviour)self).StartCoroutine(SandboxStartCoroutine(orig, self));
					static IEnumerator SandboxStartCoroutine(orig_Start orig, GM_Test self)
					{
						yield return GameModeManager.TriggerHook("InitStart");
						yield return GameModeManager.TriggerHook("InitEnd");
						yield return GameModeManager.TriggerHook("GameStart");
						orig.Invoke(self);
						yield return GameModeManager.TriggerHook("RoundStart");
						yield return GameModeManager.TriggerHook("BattleStart");
					}
				};
				<>c.<>9__37_5 = val2;
				obj2 = (object)val2;
			}
			GM_Test.Start += (hook_Start)obj2;
			GameModeManager.AddHook("GameStart", (IGameModeHandler handler) => SyncModClients.DisableSyncModUi(SyncModClients.uiParent));
			GameModeManager.AddHook("GameStart", CloseLobby);
			object obj3 = <>c.<>9__37_7;
			if (obj3 == null)
			{
				hook_Start val3 = delegate(orig_Start orig, CardChoice self)
				{
					//IL_0009: Unknown result type (might be due to invalid IL or missing references)
					for (int i = 0; i < self.cards.Length; i++)
					{
						if (!((DefaultPool)PhotonNetwork.PrefabPool).ResourceCache.ContainsKey(((Object)((Component)self.cards[i]).gameObject).name))
						{
							PhotonNetwork.PrefabPool.RegisterPrefab(((Object)((Component)self.cards[i]).gameObject).name, ((Component)self.cards[i]).gameObject);
						}
					}
					Transform[] array = (Transform[])(object)new Transform[((Component)self).transform.childCount];
					for (int j = 0; j < array.Length; j++)
					{
						array[j] = ((Component)self).transform.GetChild(j);
					}
					self.SetFieldValue("children", array);
					self.cards = CardManager.activeCards.ToArray();
				};
				<>c.<>9__37_7 = val3;
				obj3 = (object)val3;
			}
			CardChoice.Start += (hook_Start)obj3;
		}

		private static IEnumerator CloseLobby(IGameModeHandler gm)
		{
			if (PhotonNetwork.IsMasterClient && !PhotonNetwork.OfflineMode)
			{
				PhotonNetwork.CurrentRoom.IsVisible = false;
				PhotonNetwork.CurrentRoom.IsOpen = false;
			}
			yield break;
		}

		private IEnumerator AddTextWhenReady(float delay = 0f, float maxTimeToWait = 10f)
		{
			if (delay > 0f)
			{
				yield return (object)new WaitForSecondsRealtime(delay);
			}
			float time = maxTimeToWait;
			while (time > 0f)
			{
				MainMenuHandler instance = MainMenuHandler.instance;
				object obj;
				if (instance == null)
				{
					obj = null;
				}
				else
				{
					Transform transform = ((Component)instance).transform;
					obj = ((transform != null) ? transform.Find("Canvas/ListSelector/Main/Group") : null);
				}
				if (!((Object)obj == (Object)null))
				{
					break;
				}
				time -= Time.deltaTime;
				yield return null;
			}
			MainMenuHandler instance2 = MainMenuHandler.instance;
			object obj2;
			if (instance2 == null)
			{
				obj2 = null;
			}
			else
			{
				Transform transform2 = ((Component)instance2).transform;
				obj2 = ((transform2 != null) ? transform2.Find("Canvas/ListSelector/Main/Group") : null);
			}
			if (!((Object)obj2 == (Object)null))
			{
				text = MenuHandler.CreateTextAt("UNBOUND", Vector2.zero);
				((Component)text).gameObject.AddComponent<LayoutElement>().ignoreLayout = true;
				((TMP_Text)text).fontSize = 30f;
				((Graphic)text).color = (Color.yellow + Color.red) / 2f;
				((TMP_Text)text).transform.SetParent(((Component)MainMenuHandler.instance).transform.Find("Canvas/ListSelector/Main/Group"), true);
				((TMP_Text)text).transform.SetAsFirstSibling();
				((Transform)((TMP_Text)text).rectTransform).localScale = Vector3.one;
				((Transform)((TMP_Text)text).rectTransform).localPosition = new Vector3(0f, 350f, ((Transform)((TMP_Text)text).rectTransform).localPosition.z);
			}
		}

		private void Awake()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			else if ((Object)(object)Instance != (Object)(object)this)
			{
				Object.DestroyImmediate((Object)(object)((Component)this).gameObject);
				return;
			}
			new Harmony("com.willis.rounds.unbound").PatchAll();
			((Component)this).gameObject.AddComponent<LevelManager>();
			((Component)this).gameObject.AddComponent<CardManager>();
			((Component)this).gameObject.AddComponent<ToggleLevelMenuHandler>();
			((Component)this).gameObject.AddComponent<ToggleCardsMenuHandler>();
			LoadAssets();
			GameModeManager.Init();
			templateCard = Resources.Load<GameObject>("0 Cards/0. PlainCard").GetComponent<CardInfo>();
			templateCard.allowMultiple = true;
		}

		private void Start()
		{
			NetworkingManager.RegisterEvent("ModLoader_HandshakeStart", delegate
			{
				if (PhotonNetwork.IsMasterClient)
				{
					NetworkingManager.RaiseEvent("ModLoader_HandshakeFinish", new object[2]
					{
						GameModeManager.CurrentHandlerID,
						GameModeManager.CurrentHandler?.Settings
					});
				}
				else
				{
					NetworkingManager.RaiseEvent("ModLoader_HandshakeFinish");
				}
			});
			NetworkingManager.RegisterEvent("ModLoader_HandshakeFinish", delegate(object[] data)
			{
				MapManager.instance.levels = LevelManager.activeLevels.ToArray();
				if (data.Length != 0)
				{
					GameModeManager.SetGameMode((string)data[0], setActive: false);
					GameModeManager.CurrentHandler.SetSettings((GameSettings)data[1]);
				}
			});
			CardManager.defaultCards = CardChoice.instance.cards;
			CardInfo[] array = CardManager.defaultCards;
			foreach (CardInfo val in array)
			{
				CardManager.cards.Add(((Object)val).name, new Card("Vanilla", config.Bind<bool>("Cards: Vanilla", ((Object)val).name, true, (ConfigDescription)null), val));
			}
			NetworkEventCallbacks networkEventCallbacks = ((Component)this).gameObject.AddComponent<NetworkEventCallbacks>();
			networkEventCallbacks.OnJoinedRoomEvent += OnJoinedRoomAction;
			networkEventCallbacks.OnJoinedRoomEvent += LevelManager.OnJoinedRoomAction;
			networkEventCallbacks.OnJoinedRoomEvent += CardManager.OnJoinedRoomAction;
			networkEventCallbacks.OnLeftRoomEvent += OnLeftRoomAction;
			networkEventCallbacks.OnLeftRoomEvent += CardManager.OnLeftRoomAction;
			networkEventCallbacks.OnLeftRoomEvent += LevelManager.OnLeftRoomAction;
			((Component)this).gameObject.AddComponent<PingMonitor>();
			networkEventCallbacks.OnJoinedRoomEvent += SyncModClients.RequestSync;
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)282) && !ModOptions.noDeprecatedMods)
			{
				ModOptions.showModUi = !ModOptions.showModUi;
			}
			GameManager.lockInput = ModOptions.showModUi || DevConsole.isTyping || ToggleLevelMenuHandler.instance.mapMenuCanvas.activeInHierarchy || (Object.op_Implicit((Object)(object)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Options(Clone)/Group")) && ((Component)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Options(Clone)/Group")).gameObject.activeInHierarchy) || (Object.op_Implicit((Object)(object)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Group")) && ((Component)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/Main/Group")).gameObject.activeInHierarchy) || (Object.op_Implicit((Object)(object)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/MOD OPTIONS/Group")) && ((Component)((Component)UIHandler.instance).transform.Find("Canvas/EscapeMenu/MOD OPTIONS/Group")).gameObject.activeInHierarchy) || ToggleCardsMenuHandler.menuOpenFromOutside || lockInputBools.Values.Any((bool b) => b);
		}

		private void OnGUI()
		{
			if (!ModOptions.showModUi)
			{
				return;
			}
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			bool flag = false;
			using (IEnumerator<ModOptions.GUIListener> enumerator = (from md in ModOptions.GUIListeners.Keys
				select ModOptions.GUIListeners[md] into data
				where data.guiEnabled
				select data).GetEnumerator())
			{
				if (enumerator.MoveNext())
				{
					ModOptions.GUIListener current = enumerator.Current;
					if (GUILayout.Button("<- Back", Array.Empty<GUILayoutOption>()))
					{
						current.guiEnabled = false;
					}
					GUILayout.Label(current.modName + " Options", Array.Empty<GUILayoutOption>());
					flag = true;
					current.guiAction?.Invoke();
				}
			}
			if (flag)
			{
				return;
			}
			GUILayout.Label("UnboundLib Options\nThis menu is deprecated", Array.Empty<GUILayoutOption>());
			GUILayout.Label("Mod Options:", Array.Empty<GUILayoutOption>());
			foreach (ModOptions.GUIListener value in ModOptions.GUIListeners.Values)
			{
				if (GUILayout.Button(value.modName, Array.Empty<GUILayoutOption>()))
				{
					value.guiEnabled = true;
				}
			}
			GUILayout.EndVertical();
		}

		private static void LoadAssets()
		{
			toggleUI = AssetUtils.LoadAssetBundleFromResources("togglemenuui", typeof(ToggleLevelMenuHandler).Assembly);
			linkAssets = AssetUtils.LoadAssetBundleFromResources("unboundlinks", typeof(Unbound).Assembly);
			UIAssets = AssetUtils.LoadAssetBundleFromResources("unboundui", typeof(Unbound).Assembly);
			if ((Object)(object)UIAssets != (Object)null)
			{
				modalPrefab = UIAssets.LoadAsset<GameObject>("Modal");
			}
		}

		private static void OnJoinedRoomAction()
		{
			NetworkingManager.RaiseEventOthers("ModLoader_HandshakeStart");
			Unbound.OnJoinedRoom?.Invoke();
			foreach (Action handShakeAction in handShakeActions)
			{
				handShakeAction?.Invoke();
			}
		}

		private static void OnLeftRoomAction()
		{
			Unbound.OnLeftRoom?.Invoke();
		}

		[UnboundRPC]
		public static void BuildInfoPopup(string message)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			InfoPopup infoPopup = new GameObject("Info Popup").AddComponent<InfoPopup>();
			((Transform)((Graphic)infoPopup).rectTransform).SetParent(((Component)Instance.canvas).transform);
			infoPopup.Build(message);
		}

		[UnboundRPC]
		public static void BuildModal(string title, string message)
		{
			BuildModal().Title(title).Message(message).Show();
		}

		public static ModalHandler BuildModal()
		{
			return Object.Instantiate<GameObject>(modalPrefab, ((Component)Instance.canvas).transform).AddComponent<ModalHandler>();
		}

		public static void RegisterCredits(string modName, string[] credits = null, string[] linkTexts = null, string[] linkURLs = null)
		{
			Credits.Instance.RegisterModCredits(new ModCredits(modName, credits, linkTexts, linkURLs));
		}

		public static void RegisterMenu(string name, UnityAction buttonAction, Action<GameObject> guiAction, GameObject parent = null)
		{
			ModOptions.instance.RegisterMenu(name, buttonAction, guiAction, parent);
		}

		public static void RegisterMenu(string name, UnityAction buttonAction, Action<GameObject> guiAction, GameObject parent = null, bool showInPauseMenu = false)
		{
			ModOptions.instance.RegisterMenu(name, buttonAction, guiAction, parent, showInPauseMenu);
		}

		public static void RegisterGUI(string modName, Action guiAction)
		{
			ModOptions.RegisterGUI(modName, guiAction);
		}

		public static void RegisterCredits(string modName, string[] credits = null, string linkText = "", string linkURL = "")
		{
			Credits.Instance.RegisterModCredits(new ModCredits(modName, credits, linkText, linkURL));
		}

		public static void RegisterClientSideMod(string GUID)
		{
			SyncModClients.RegisterClientSideMod(GUID);
		}

		public static void AddAllCardsCallback(Action<CardInfo[]> callback)
		{
			CardManager.AddAllCardsCallback(callback);
		}

		public static void RegisterHandshake(string modId, Action callback)
		{
			NetworkingManager.RegisterEvent("ModLoader_" + modId + "_StartHandshake", delegate
			{
				NetworkingManager.RaiseEvent("ModLoader_" + modId + "_FinishHandshake");
			});
			NetworkingManager.RegisterEvent("ModLoader_" + modId + "_FinishHandshake", delegate
			{
				callback?.Invoke();
			});
			handShakeActions.Add(delegate
			{
				NetworkingManager.RaiseEventOthers("ModLoader_" + modId + "_StartHandshake");
			});
		}

		[Obsolete("This method is obsolete. Use LevelManager.RegisterMaps() instead.", false)]
		public static void RegisterMaps(AssetBundle assetBundle)
		{
			LevelManager.RegisterMaps(assetBundle);
		}

		[Obsolete("This method is obsolete. Use LevelManager.RegisterMaps() instead.", false)]
		public static void RegisterMaps(IEnumerable<string> paths)
		{
			RegisterMaps(paths, "Modded");
		}

		[Obsolete("This method is obsolete. Use LevelManager.RegisterMaps() instead.", false)]
		public static void RegisterMaps(IEnumerable<string> paths, string categoryName)
		{
			LevelManager.RegisterMaps(paths);
		}

		public static bool IsNotPlayingOrConnected()
		{
			if (Object.op_Implicit((Object)(object)GameManager.instance) && !GameManager.instance.battleOngoing)
			{
				if (!PhotonNetwork.OfflineMode)
				{
					return !PhotonNetwork.IsConnected;
				}
				return true;
			}
			return false;
		}

		internal static ConfigEntry<T> BindConfig<T>(string section, string key, T defaultValue, ConfigDescription configDescription = null)
		{
			return config.Bind<T>(EscapeConfigKey(section), EscapeConfigKey(key), defaultValue, configDescription);
		}

		private static string EscapeConfigKey(string key)
		{
			return key.Replace("=", "&eq;").Replace("\n", "&nl;").Replace("\t", "&tab;")
				.Replace("\\", "&esc;")
				.Replace("\"", "&dquot;")
				.Replace("'", "&squot;")
				.Replace("[", "&lsq;")
				.Replace("]", "&rsq;");
		}

		[CompilerGenerated]
		internal static IEnumerator <.ctor>g__ArmsRaceStartCoroutine|37_2(orig_Start orig, GM_ArmsRace self)
		{
			yield return GameModeManager.TriggerHook("InitStart");
			orig.Invoke(self);
			yield return GameModeManager.TriggerHook("InitEnd");
		}

		[CompilerGenerated]
		internal static IEnumerator <.ctor>g__SandboxStartCoroutine|37_4(orig_Start orig, GM_Test self)
		{
			yield return GameModeManager.TriggerHook("InitStart");
			yield return GameModeManager.TriggerHook("InitEnd");
			yield return GameModeManager.TriggerHook("GameStart");
			orig.Invoke(self);
			yield return GameModeManager.TriggerHook("RoundStart");
			yield return GameModeManager.TriggerHook("BattleStart");
		}
	}
	public static class ExtensionMethods
	{
		public static string Sanitize(this string str, string[] invalidSubstrs = null)
		{
			invalidSubstrs = invalidSubstrs ?? new string[7] { "\n", "\t", "\\", "\"", "'", "[", "]" };
			string[] array = invalidSubstrs;
			foreach (string oldValue in array)
			{
				str.Replace(oldValue, string.Empty);
			}
			return str;
		}

		public static T GetOrAddComponent<T>(this GameObject go, bool searchChildren = false) where T : Component
		{
			T val = (searchChildren ? go.GetComponentInChildren<T>() : go.GetComponent<T>());
			if ((Object)(object)val == (Object)null)
			{
				val = go.AddComponent<T>();
			}
			return val;
		}

		public static void ExecuteAfterFrames(this MonoBehaviour mb, int delay, Action action)
		{
			mb.StartCoroutine(ExecuteAfterFramesCoroutine(delay, action));
		}

		public static void ExecuteAfterSeconds(this MonoBehaviour mb, float delay, Action action)
		{
			mb.StartCoroutine(ExecuteAfterSecondsCoroutine(delay, action));
		}

		private static IEnumerator ExecuteAfterFramesCoroutine(int delay, Action action)
		{
			for (int i = 0; i < delay; i++)
			{
				yield return null;
			}
			action();
		}

		private static IEnumerator ExecuteAfterSecondsCoroutine(float delay, Action action)
		{
			yield return (object)new WaitForSeconds(delay);
			action();
		}

		public static void SetAlpha(this Image image, float alpha)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Color color = ((Graphic)image).color;
			color.a = alpha;
			((Graphic)image).color = color;
		}

		public static int AsMultiplier(this bool value)
		{
			if (!value)
			{
				return -1;
			}
			return 1;
		}

		public static T GetRandom<T>(this IList array)
		{
			return (T)array[Random.Range(0, array.Count)];
		}

		public static void Shuffle<T>(this IList<T> list)
		{
			int num = list.Count;
			while (num > 1)
			{
				num--;
				int index = Random.Range(0, num + 1);
				T value = list[index];
				list[index] = list[num];
				list[num] = value;
			}
		}

		public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dictionary, K key)
		{
			dictionary.TryGetValue(key, out var value);
			return value;
		}

		public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dictionary, K key, V defaultValue)
		{
			if (!dictionary.TryGetValue(key, out var value))
			{
				return defaultValue;
			}
			return value;
		}

		public static Transform FindDeepChild(this Transform aParent, string aName)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			Queue<Transform> queue = new Queue<Transform>();
			queue.Enqueue(aParent);
			while (queue.Count > 0)
			{
				Transform val = queue.Dequeue();
				if (((Object)val).name == aName)
				{
					return val;
				}
				foreach (Transform item2 in val)
				{
					Transform item = item2;
					queue.Enqueue(item);
				}
			}
			return null;
		}

		public static void AddXPosition(this Transform transform, float x)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = transform.position;
			position.x += x;
			transform.position = position;
		}

		public static void AddYPosition(this Transform transform, float y)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = transform.position;
			position.y += y;
			transform.position = position;
		}

		public static void AddZPosition(this Transform transform, float z)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = transform.position;
			position.z += z;
			transform.position = position;
		}

		public static void SetXPosition(this Transform transform, float x)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = transform.position;
			position.x = x;
			transform.position = position;
		}

		public static void SetYPosition(this Transform transform, float y)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = transform.position;
			position.y = y;
			transform.position = position;
		}

		public static void SetZPosition(this Transform transform, float z)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = transform.position;
			position.z = z;
			transform.position = position;
		}

		public static bool IsLayerInMask(this LayerMask layerMask, int layer)
		{
			return ((LayerMask)(ref layerMask)).value == (((LayerMask)(ref layerMask)).value | (1 << layer));
		}

		public static void InsertYieldReturn(this ILGenerator gen, List<CodeInstruction> instructions, int index)
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Expected O, but got Unknown
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Expected O, but got Unknown
			Type? declaringType = ((FieldInfo)instructions[1].operand).DeclaringType;
			FieldInfo fieldInfo = GetFieldInfo(declaringType, "<>1__state");
			FieldInfo fieldInfo2 = GetFieldInfo(declaringType, "<>2__current");
			CodeInstruction? obj = instructions.Find((CodeInstruction ins) => ins.opcode == OpCodes.Switch);
			List<Label> list = ((Label[])obj.operand).ToList();
			int count = list.Count;
			Label label = gen.DefineLabel();
			list.Add(label);
			obj.operand = list.ToArray();
			List<CodeInstruction> list2 = new List<CodeInstruction>();
			list2.Add(new CodeInstruction(OpCodes.Stfld, (object)fieldInfo2));
			list2.Add(new CodeInstruction(OpCodes.Ldarg_0, (object)null));
			list2.Add(new CodeInstruction(OpCodes.Ldc_I4, (object)count));
			list2.Add(new CodeInstruction(OpCodes.Stfld, (object)fieldInfo));
			list2.Add(new CodeInstruction(OpCodes.Ldc_I4_1, (object)null));
			list2.Add(new CodeInstruction(OpCodes.Ret, (object)null));
			list2.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldarg_0, (object)null), new Label[1] { label }));
			list2.Add(new CodeInstruction(OpCodes.Ldc_I4_M1, (object)null));
			list2.Add(new CodeInstruction(OpCodes.Stfld, (object)fieldInfo));
			List<CodeInstruction> collection = list2;
			instructions.InsertRange(index, collection);
		}

		public static void AddYieldReturn(this ILGenerator gen, List<CodeInstruction> instructions)
		{
			gen.InsertYieldReturn(instructions, instructions.Count);
		}

		public static MethodInfo GetMethodInfo(Type type, string methodName)
		{
			MethodInfo methodInfo = null;
			do
			{
				methodInfo = type.GetMethod(methodName, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
				type = type.BaseType;
			}
			while (methodInfo == null && type != null);
			return methodInfo;
		}

		public static object InvokeMethod(this object obj, string methodName, params object[] arguments)
		{
			if (obj == null)
			{
				throw new ArgumentNullException("obj");
			}
			Type type = obj.GetType();
			MethodInfo methodInfo = GetMethodInfo(type, methodName);
			if (methodInfo == null)
			{
				throw new ArgumentOutOfRangeException("propertyName", $"Couldn't find property {methodName} in type {type.FullName}");
			}
			return methodInfo.Invoke(obj, arguments);
		}

		public static MethodInfo GetMethodInfo(Type type, string methodName, Type[] parameters)
		{
			MethodInfo methodInfo = null;
			do
			{
				methodInfo = type.GetMethod(methodName, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, parameters, null);
				type = type.BaseType;
			}
			while (methodInfo == null && type != null);
			return methodInfo;
		}

		public static object InvokeMethod(this object obj, string methodName, Type[] argumentOrder, params object[] arguments)
		{
			if (obj == null)
			{
				throw new ArgumentNullException("obj");
			}
			Type type = obj.GetType();
			MethodInfo methodInfo = GetMethodInfo(type, methodName, argumentOrder);
			if (methodInfo == null)
			{
				throw new ArgumentOutOfRangeException("propertyName", $"Couldn't find property {methodName} in type {type.FullName}");
			}
			return methodInfo.Invoke(obj, arguments);
		}

		public static FieldInfo GetFieldInfo(Type type, string fieldName)
		{
			FieldInfo fieldInfo = null;
			do
			{
				fieldInfo = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				type = type.BaseType;
			}
			while (fieldInfo == null && type != null);
			return fieldInfo;
		}

		public static object GetFieldValue(this object obj, string fieldName)
		{
			if (obj == null)
			{
				throw new ArgumentNullException("obj");
			}
			Type type = obj.GetType();
			FieldInfo fieldInfo = GetFieldInfo(type, fieldName);
			if (fieldInfo == null)
			{
				throw new ArgumentOutOfRangeException("propertyName", $"Couldn't find property {fieldName} in type {type.FullName}");
			}
			return fieldInfo.GetValue(obj);
		}

		public static void SetFieldValue(this object obj, string fieldName, object val)
		{
			if (obj == null)
			{
				throw new ArgumentNullException("obj");
			}
			Type type = obj.GetType();
			FieldInfo fieldInfo = GetFieldInfo(type, fieldName);
			if (fieldInfo == null)
			{
				throw new ArgumentOutOfRangeException("propertyName", $"Couldn't find property {fieldName} in type {type.FullName}");
			}
			fieldInfo.SetValue(obj, val);
		}

		public static PropertyInfo GetPropertyInfo(Type type, string propertyName)
		{
			PropertyInfo propertyInfo = null;
			do
			{
				propertyInfo = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				type = type.BaseType;
			}
			while (propertyInfo == null && type != null);
			return propertyInfo;
		}

		public static object GetPropertyValue(this object obj, string propertyName)
		{
			if (obj == null)
			{
				throw new ArgumentNullException("obj");
			}
			Type type = obj.GetType();
			PropertyInfo propertyInfo = GetPropertyInfo(type, propertyName);
			if (propertyInfo == null)
			{
				throw new ArgumentOutOfRangeException("propertyName", $"Couldn't find property {propertyName} in type {type.FullName}");
			}
			return propertyInfo.GetValue(obj, null);
		}

		public static void SetPropertyValue(this object obj, string propertyName, object val)
		{
			if (obj == null)
			{
				throw new ArgumentNullException("obj");
			}
			Type type = obj.GetType();
			PropertyInfo propertyInfo = GetPropertyInfo(type, propertyName);
			if (propertyInfo == null)
			{
				throw new ArgumentOutOfRangeException("propertyName", $"Couldn't find property {propertyName} in type {type.FullName}");
			}
			propertyInfo.SetValue(obj, val, null);
		}

		public static object Cast(this Type Type, object data)
		{
			ParameterExpression parameterExpression = Expression.Parameter(typeof(object), "data");
			return Expression.Lambda(Expression.Block(Expression.Convert(Expression.Convert(parameterExpression, data.GetType()), Type)), parameterExpression).Compile().DynamicInvoke(data);
		}
	}
	public static class MonoBehaviourExtensions
	{
		private static readonly ConditionalWeakTable<MonoBehaviour, HashSet<Tuple<int, string>>> pendingRequests = new ConditionalWeakTable<MonoBehaviour, HashSet<Tuple<int, string>>>();

		public static Coroutine SyncMethod(this MonoBehaviour instance, string methodName, int[] actors, params object[] data)
		{
			return instance.StartCoroutine(instance.SyncMethodCoroutine(methodName, actors, data));
		}

		public static Coroutine SyncMethod(this MonoBehaviour instance, string methodName, int actor, params object[] data)
		{
			return instance.SyncMethod(methodName, new int[1] { actor }, data);
		}

		private static IEnumerator SyncMethodCoroutine(this MonoBehaviour instance, string methodName, int[] actors, params object[] data)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.CurrentRoom == null)
			{
				NetworkingManager.RPC(((object)instance).GetType(), methodName, data);
				yield break;
			}
			if (actors == null)
			{
				actors = (from p in PhotonNetwork.CurrentRoom.Players.Values.ToList()
					select p.ActorNumber).ToArray();
			}
			int[] array = actors;
			foreach (int item in array)
			{
				instance.GetPendingRequests().Add(new Tuple<int, string>(item, methodName));
			}
			NetworkingManager.RPC(((object)instance).GetType(), methodName, data);
			while ((from r in instance.GetPendingRequests()
				where r.Item2 == methodName
				select r).Any((Tuple<int, string> r) => actors.Contains(r.Item1)))
			{
				yield return null;
			}
		}

		public static HashSet<Tuple<int, string>> GetPendingRequests(this MonoBehaviour instance)
		{
			return pendingRequests.GetOrCreateValue(instance);
		}

		public static void ClearPendingRequests(this MonoBehaviour instance, int actor)
		{
			HashSet<Tuple<int, string>> orCreateValue = pendingRequests.GetOrCreateValue(instance);
			foreach (Tuple<int, string> item in from t in orCreateValue.ToList()
				where t.Item1 == actor
				select t)
			{
				orCreateValue.Remove(new Tuple<int, string>(actor, item.Item2));
			}
		}

		public static void RemovePendingRequest(this MonoBehaviour instance, int actor, string methodName)
		{
			pendingRequests.GetOrCreateValue(instance).Remove(new Tuple<int, string>(actor, methodName));
		}
	}
	[RequireComponent(typeof(VerticalLayoutGroup), typeof(ContentSizeFitter), typeof(CanvasGroup))]
	public class InfoPopup : Image
	{
		private Text text;

		private CanvasGroup group;

		protected override void Awake()
		{
			//IL_001b: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			((UIBehaviour)this).Start();
			((Graphic)this).color = new Color(0f, 0f, 0f, 25f / 51f);
			text = new GameObject().AddComponent<Text>();
			((Transform)((Graphic)text).rectTransform).SetParent((Transform)(object)((Graphic)this).rectTransform);
			text.alignment = (TextAnchor)4;
			text.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
			text.fontSize = 14;
			text.horizontalOverflow = (HorizontalWrapMode)1;
			text.verticalOverflow = (VerticalWrapMode)1;
			text.supportRichText = true;
			VerticalLayoutGroup component = ((Component)this).GetComponent<VerticalLayoutGroup>();
			bool flag2 = (((HorizontalOrVerticalLayoutGroup)component).childForceExpandWidth = true);
			bool flag4 = (((HorizontalOrVerticalLayoutGroup)component).childForceExpandHeight = flag2);
			bool childControlHeight = (((HorizontalOrVerticalLayoutGroup)component).childControlWidth = flag4);
			((HorizontalOrVerticalLayoutGroup)component).childControlHeight = childControlHeight;
			((LayoutGroup)component).padding = new RectOffset(10, 10, 5, 5);
			ContentSizeFitter component2 = ((Component)this).GetComponent<ContentSizeFitter>();
			component2.horizontalFit = (FitMode)2;
			component2.verticalFit = (FitMode)2;
			group = ((Component)this).GetComponent<CanvasGroup>();
		}

		public void Build(string message)
		{
			text.text = message;
			((MonoBehaviour)this).StartCoroutine(DisplayPopup());
		}

		private IEnumerator DisplayPopup()
		{
			float time = 0f;
			float damp = 0f;
			float val = 0f;
			((Transform)((Graphic)this).rectTransform).position = Vector2.op_Implicit(new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2)));
			while (time < 3f)
			{
				RectTransform rectTransform = ((Graphic)this).rectTransform;
				rectTransform.anchoredPosition += Vector2.up;
				val = Mathf.SmoothDamp(val, 1.25f, ref damp, 2f);
				group.alpha = 1f - val;
				time += Time.deltaTime;
				yield return null;
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class ModalHandler : MonoBehaviour
	{
		private Text title => ((Component)((Component)this).transform.Find("Foreground/Title Bar/Title")).GetComponent<Text>();

		private TextMeshProUGUI content => ((Component)((Component)this).transform.Find("Foreground/Content/Text")).GetComponent<TextMeshProUGUI>();

		private GameObject confirmButton => ((Component)((Component)this).transform.Find("Foreground/Buttons/Got It")).gameObject;

		private GameObject cancelButton => ((Component)((Component)this).transform.Find("Foreground/Buttons/Whatever")).gameObject;

		private void Start()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			((UnityEvent)confirmButton.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
			{
				Object.Destroy((Object)(object)((Component)this).gameObject, 1f);
			});
			((UnityEvent)cancelButton.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
			{
				Object.Destroy((Object)(object)((Component)this).gameObject, 1f);
			});
		}

		public ModalHandler Title(string text)
		{
			title.text = text;
			return this;
		}

		public ModalHandler Message(string text)
		{
			((TMP_Text)content).text = text;
			return this;
		}

		public ModalHandler ConfirmButton(string text, UnityAction action)
		{
			SetupButton(confirmButton, text, action);
			return this;
		}

		public ModalHandler CancelButton(string text, UnityAction action)
		{
			SetupButton(cancelButton, text, action);
			return this;
		}

		private static void SetupButton(GameObject root, string text, UnityAction action)
		{
			((UnityEvent)root.GetComponent<Button>().onClick).AddListener(action);
			TextMeshProUGUI[] componentsInChildren = root.GetComponentsInChildren<TextMeshProUGUI>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				((TMP_Text)componentsInChildren[i]).text = text;
			}
		}

		public void Show()
		{
			((Component)this).GetComponent<Animator>().Play("Fade-in");
		}
	}
}
namespace UnboundLib.Utils
{
	public class CardManager : MonoBehaviour
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Comparison<CardInfo> <>9__2_0;

			public static Func<string, string> <>9__11_0;

			public static Func<string, string> <>9__11_1;

			public static Func<string, Card> <>9__11_2;

			public static Func<KeyValuePair<string, Card>, bool> <>9__11_3;

			public static Func<CardInfo, string> <>9__18_0;

			public static Comparison<CardInfo> <>9__20_0;

			public static Func<KeyValuePair<string, Card>, string> <>9__25_1;

			public static Action <>9__27_0;

			public static UnityAction <>9__28_1;

			public static Func<CardInfo, string> <>9__28_2;

			public static Func<Card, CardInfo> <>9__29_0;

			internal int <get_allCards>b__2_0(CardInfo x, CardInfo y)
			{
				return string.CompareOrdinal(((Object)((Component)x).gameObject).name, ((Object)((Component)y).gameObject).name);
			}

			internal string <FirstTimeStart>b__11_0(string k)
			{
				return k;
			}

			internal string <FirstTimeStart>b__11_1(string k)
			{
				return k;
			}

			internal Card <FirstTimeStart>b__11_2(string k)
			{
				return cards[k];
			}

			internal bool <FirstTimeStart>b__11_3(KeyValuePair<string, Card> card)
			{
				return !categories.Contains(card.Value.category);
			}

			internal string <EnableCard>b__18_0(CardInfo i)
			{
				return ((Object)((Component)i).gameObject).name;
			}

			internal int <DisableCard>b__20_0(CardInfo x, CardInfo y)
			{
				return string.CompareOrdinal(((Object)((Component)x).gameObject).name, ((Object)((Component)y).gameObject).name);
			}

			internal string <GetCardsInCategory>b__25_1(KeyValuePair<string, Card> card)
			{
				KeyValuePair<string, Card> keyValuePair = card;
				return keyValuePair.Key;
			}

			internal void <OnJoinedRoomAction>b__27_0()
			{
				if (!PhotonNetwork.IsMasterClient)
				{
					NetworkingManager.RPC_Others(typeof(CardManager), "RPC_CardHandshake", new object[1] { cards.Keys.ToArray() });
				}
			}

			internal void <RPC_CardHandshake>b__28_1()
			{
			}

			internal string <RPC_CardHandshake>b__28_2(CardInfo c)
			{
				return ((Object)((Component)c).gameObject).name;
			}

			internal CardInfo <RPC_HostCardHandshakeResponse>b__29_0(Card card)
			{
				return card.cardInfo;
			}
		}

		public CardManager instance;

		internal static CardInfo[] defaultCards;

		internal static ObservableCollection<CardInfo> activeCards;

		internal static List<CardInfo> inactiveCards = new List<CardInfo>();

		public static readonly List<string> categories = new List<string>();

		internal static readonly Dictionary<string, ConfigEntry<bool>> categoryBools = new Dictionary<string, ConfigEntry<bool>>();

		public static Dictionary<string, Card> cards = new Dictionary<string, Card>();

		private static readonly List<Action<CardInfo[]>> FirstStartCallbacks = new List<Action<CardInfo[]>>();

		internal static CardInfo[] allCards
		{
			get
			{
				List<CardInfo> list = new List<CardInfo>();
				list.AddRange(activeCards);
				list.AddRange(inactiveCards);
				list.Sort((CardInfo x, CardInfo y) => string.CompareOrdinal(((Object)((Component)x).gameObject).name, ((Object)((Component)y).gameObject).name));
				return list.ToArray();
			}
		}

		public void Start()
		{
			instance = this;
			defaultCards = (CardInfo[])CardChoice.instance.cards.Clone();
			activeCards = new ObservableCollection<CardInfo>(defaultCards);
			activeCards.CollectionChanged += CardsChanged;
		}

		public static void FirstTimeStart()
		{
			cards = cards.Keys.OrderBy((string k) => k).ToDictionary((string k) => k, (string k) => cards[k]);
			foreach (KeyValuePair<string, Card> item in cards.Where((KeyValuePair<string, Card> card) => !categories.Contains(card.Value.category)))
			{
				categories.Add(item.Value.category);
			}
			foreach (string category in categories)
			{
				categoryBools.Add(category, Unbound.BindConfig("Card categories", category, defaultValue: true));
			}
			foreach (Action<CardInfo[]> firstStartCallback in FirstStartCallbacks)
			{
				firstStartCallback(allCards);
			}
		}

		public static void RestoreCardToggles()
		{
			foreach (Card value in cards.Values)
			{
				if (value.config.Value)
				{
					EnableCard(value.cardInfo);
				}
				else
				{
					DisableCard(value.cardInfo);
				}
			}
		}

		public static void AddAllCardsCallback(Action<CardInfo[]> callback)
		{
			FirstStartCallbacks.Add(callback);
		}

		internal static void CardsChanged(object sender, NotifyCollectionChangedEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)CardChoice.instance))
			{
				CardChoice.instance.cards = activeCards.ToArray();
			}
		}

		public static CardInfo[] GetCardsInfoWithNames(string[] cardNames)
		{
			return cardNames.Select(GetCardInfoWithName).ToArray();
		}

		public static CardInfo GetCardInfoWithName(string cardName)
		{
			if (!cards.ContainsKey(cardName))
			{
				return null;
			}
			return cards[cardName].cardInfo;
		}

		public static void EnableCards(CardInfo[] cardInfos, bool saved = true)
		{
			for (int i = 0; i < cardInfos.Length; i++)
			{
				EnableCard(cardInfos[i], saved);
			}
		}

		public static void EnableCard(CardInfo cardInfo, bool saved = true)
		{
			if (!activeCards.Contains(cardInfo))
			{
				activeCards.Add(cardInfo);
				activeCards = new ObservableCollection<CardInfo>(activeCards.OrderBy((CardInfo i) => ((Object)((Component)i).gameObject).name));
				activeCards.CollectionChanged += CardsChanged;
			}
			if (inactiveCards.Contains(cardInfo))
			{
				inactiveCards.Remove(cardInfo);
			}
			string name = ((Object)((Component)cardInfo).gameObject).name;
			if (cards.ContainsKey(name))
			{
				cards[name].enabled = true;
				if (saved)
				{
					cards[name].config.Value = true;
				}
			}
		}

		public static void DisableCards(CardInfo[] cardInfos, bool saved = true)
		{
			for (int i = 0; i < cardInfos.Length; i++)
			{
				DisableCard(cardInfos[i], saved);
			}
		}

		public static void DisableCard(CardInfo cardInfo, bool saved = true)
		{
			if (activeCards.Contains(cardInfo))
			{
				activeCards.Remove(cardInfo);
			}
			if (!inactiveCards.Contains(cardInfo))
			{
				inactiveCards.Add(cardInfo);
				inactiveCards.Sort((CardInfo x, CardInfo y) => string.CompareOrdinal(((Object)((Component)x).gameObject).name, ((Object)((Component)y).gameObject).name));
			}
			string name = ((Object)((Component)cardInfo).gameObject).name;
			if (cards.ContainsKey(name))
			{
				cards[name].enabled = false;
				if (saved)
				{
					cards[name].config.Value = false;
				}
			}
		}

		public static void EnableCategory(string categoryName)
		{
			if (categoryBools.ContainsKey(categoryName))
			{
				categoryBools[categoryName].Value = true;
			}
			string[] cardsInCategory = GetCardsInCategory(categoryName);
			foreach (string key in cardsInCategory)
			{
				EnableCard(cards[key].cardInfo);
			}
		}

		public static void DisableCategory(string categoryName)
		{
			if (categoryBools.ContainsKey(categoryName))
			{
				categoryBools[categoryName].Value = false;
			}
			string[] cardsInCategory = GetCardsInCategory(categoryName);
			foreach (string key in cardsInCategory)
			{
				DisableCard(cards[key].cardInfo);
			}
		}

		public static bool IsCardActive(CardInfo card)
		{
			return activeCards.Contains(card);
		}

		public static bool IsCategoryActive(string categoryName)
		{
			if (categoryBools.ContainsKey(categoryName))
			{
				return categoryBools[categoryName].Value;
			}
			return false;
		}

		public static string[] GetCardsInCategory(string category)
		{
			return cards.Where(delegate(KeyValuePair<string, Card> card)
			{
				KeyValuePair<string, Card> keyValuePair2 = card;
				return keyValuePair2.Value.category.Contains(category);
			}).Select(delegate(KeyValuePair<string, Card> card)
			{
				KeyValuePair<string, Card> keyValuePair = card;
				return keyValuePair.Key;
			}).ToArray();
		}

		public static void OnLeftRoomAction()
		{
			RestoreCardToggles();
			ToggleCardsMenuHandler.RestoreCardToggleVisuals();
		}

		public static void OnJoinedRoomAction()
		{
			CardChoice.instance.cards = activeCards.ToArray();
			((MonoBehaviour)(object)Unbound.Instance).ExecuteAfterFrames(45, delegate
			{
				if (!PhotonNetwork.IsMasterClient)
				{
					NetworkingManager.RPC_Others(typeof(CardManager), "RPC_CardHandshake", new object[1] { cards.Keys.ToArray() });
				}
			});
		}

		[UnboundRPC]
		private static void RPC_CardHandshake(string[] cardsArray)
		{
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			if (!PhotonNetwork.IsMasterClient)
			{
				return;
			}
			List<string> disabledCards = new List<string>();
			foreach (string cardName2 in cards.Keys.Where((string cardName) => !cardsArray.Contains(cardName)))
			{
				DisableCard(cards[cardName2].cardInfo, saved: false);
				disabledCards.Add(cardName2);
				foreach (KeyValuePair<GameObject, Action> item in ToggleCardsMenuHandler.cardObjs.Where((KeyValuePair<GameObject, Action> c) => ((Object)c.Key).name == cardName2))
				{
					ToggleCardsMenuHandler.UpdateVisualsCardObj(item.Key);
				}
			}
			if (disabledCards.Count != 0)
			{
				ModalHandler modalHandler = Unbound.BuildModal().Title("These cards have been disabled because someone didn't have them").Message(string.Join(", ", disabledCards.ToArray()))
					.CancelButton("Copy", (UnityAction)delegate
					{
						Unbound.BuildInfoPopup("Copied Message!");
						GUIUtility.systemCopyBuffer = string.Join(", ", disabledCards.ToArray());
					});
				object obj = <>c.<>9__28_1;
				if (obj == null)
				{
					UnityAction val = delegate
					{
					};
					<>c.<>9__28_1 = val;
					obj = (object)val;
				}
				modalHandler.CancelButton("Cancel", (UnityAction)obj).Show();
			}
			NetworkingManager.RPC_Others(typeof(CardManager), "RPC_HostCardHandshakeResponse", new object[1] { activeCards.Select((CardInfo c) => ((Object)((Component)c).gameObject).name).ToArray() });
		}

		[UnboundRPC]
		private static void RPC_HostCardHandshakeResponse(string[] cardsArray)
		{
			foreach (CardInfo item in cards.Values.Select((Card card) => card.cardInfo))
			{
				string cardObjectName = ((Object)((Component)item).gameObject).name;
				if (cardsArray.Contains(cardObjectName))
				{
					EnableCard(item, saved: false);
					foreach (KeyValuePair<GameObject, Action> item2 in ToggleCardsMenuHandler.cardObjs.Where((KeyValuePair<GameObject, Action> c) => ((Object)c.Key).name == cardObjectName))
					{
						ToggleCardsMenuHandler.UpdateVisualsCardObj(item2.Key);
					}
					continue;
				}
				DisableCard(item, saved: false);
				foreach (KeyValuePair<GameObject, Action> item3 in ToggleCardsMenuHandler.cardObjs.Where((KeyValuePair<GameObject, Action> c) => ((Object)c.Key).name == cardObjectName))
				{
					ToggleCardsMenuHandler.UpdateVisualsCardObj(item3.Key);
				}
			}
		}
	}
	public class Card
	{
		public bool enabled;

		public string category;

		public CardInfo cardInfo;

		public ConfigEntry<bool> config;

		public Card(string category, ConfigEntry<bool> config, CardInfo cardInfo)
		{
			this.category = category;
			enabled = config.Value;
			this.cardInfo = cardInfo;
			this.config = config;
		}
	}
	public static class ExtraPlayerSkins
	{
		public const int NumSkins = 32;

		public static PlayerSkin[] skins;

		private static readonly PlayerSkin[] extraSkinBases;

		public static int numberOfSkins => skins.Length;

		public static string GetTeamColorName(int teamID)
		{
			return teamID switch
			{
				0 => "Orange", 
				1 => "Blue", 
				2 => "Red", 
				3 => "Green", 
				4 => "Yellow", 
				5 => "Purple", 
				6 => "Magenta", 
				7 => "Cyan", 
				8 => "Tangerine", 
				9 => "Light Blue", 
				10 => "Peach", 
				11 => "Lime", 
				12 => "Light Yellow", 
				13 => "Orchid", 
				14 => "Pink", 
				15 => "Aquamarine", 
				16 => "Dark Orange", 
				17 => "Dark Blue", 
				18 => "Dark Red", 
				19 => "Dark Green", 
				20 => "Dark Yellow", 
				21 => "Indigo", 
				22 => "Cerise", 
				23 => "Teal", 
				24 => "Burnt Orange", 
				25 => "Midnight Blue", 
				26 => "Maroon", 
				27 => "Evergreen", 
				28 => "Gold", 
				29 => "Violet", 
				30 => "Ruby", 
				31 => "Dark Cyan", 
				_ => (teamID + 1).ToString(), 
			};
		}

		public static PlayerSkin GetPlayerSkinColors(int colorID)
		{
			//IL_0048: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			colorID = Math.mod(colorID, numberOfSkins);
			if ((Object)(object)skins[colorID] != (Object)null)
			{
				return skins[colorID];
			}
			PlayerSkinBank val = (PlayerSkinBank)(typeof(PlayerSkinBank).GetProperty("Instance", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null, null));
			PlayerSkin component = ((Component)Object.Instantiate<PlayerSkin>(((int)val != 0) ? val.skins[colorID % 4].currentPlayerSkin : null)).gameObject.GetComponent<PlayerSkin>();
			Object.DontDestroyOnLoad((Object)(object)component);
			PlayerSkin val2 = extraSkinBases[colorID];
			component.color = val2.color;
			component.backgroundColor = val2.backgroundColor;
			component.winText = val2.winText;
			component.particleEffect = val2.particleEffect;
			PlayerSkinParticle componentInChildren = ((Component)component).GetComponentInChildren<PlayerSkinParticle>();
			MainModule main = ((Component)componentInChildren).GetComponent<ParticleSystem>().main;
			MinMaxGradient startColor = ((MainModule)(ref main)).startColor;
			((MinMaxGradient)(ref startColor)).colorMin = val2.backgroundColor;
			((MinMaxGradient)(ref startColor)).colorMax = val2.color;
			((MainModule)(ref main)).startColor = startColor;
			componentInChildren.SetFieldValue("startColor1", val2.backgroundColor);
			componentInChildren.SetFieldValue("startColor2", val2.color);
			skins[colorID] = component;
			return skins[colorID];
		}

		static ExtraPlayerSkins()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: 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_0115: Expected O, but got Unknown
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Expected O, but got Unknown
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: 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)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Expected O, but got Unknown
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: 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_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Expected O, but got Unknown
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: 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_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Expected O, but got Unknown
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Expected O, but got Unknown
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_0408: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Expected O, but got Unknown
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Expected O, but got Unknown
			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_050b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0510: Unknown result type (might be due to invalid IL or missing references)
			//IL_0515: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0535: Expected O, but got Unknown
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0552: Unknown result type (might be due to invalid IL or missing references)
			//IL_0557: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0571: Unknown result type (might be due to invalid IL or missing references)
			//IL_0576: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Unknown result type (might be due to invalid IL or missing references)
			//IL_059a: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ba: Expected O, but got Unknown
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0600: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_061a: Unknown result type (might be due to invalid IL or missing references)
			//IL_061f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0634: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_063f: Expected O, but got Unknown
			//IL_0642: Unknown result type (might be due to invalid IL or missing references)
			//IL_0647: Unknown result type (might be due to invalid IL or missing references)
			//IL_065c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0661: Unknown result type (might be due to invalid IL or missing references)
			//IL_0666: Unknown result type (might be due to invalid IL or missing references)
			//IL_067b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0680: Unknown result type (might be due to invalid IL or missing references)
			//IL_0685: Unknown result type (might be due to invalid IL or missing references)
			//IL_069a: Unknown result type (might be due to invalid IL or missing references)
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06be: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Expected O, but got Unknown
			//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0700: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_0729: Unknown result type (might be due to invalid IL or missing references)
			//IL_073e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0743: Unknown result type (might be due to invalid IL or missing references)
			//IL_0749: Expected O, but got Unknown
			//IL_074c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0751: Unknown result type (might be due to invalid IL or missing references)
			//IL_0766: Unknown result type (might be due to invalid IL or missing references)
			//IL_076b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0770: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_078f: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ce: Expected O, but got Unknown
			//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_080a: Unknown result type (might be due to invalid IL or missing references)
			//IL_080f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0814: Unknown result type (might be due to invalid IL or missing references)
			//IL_0829: Unknown result type (might be due to invalid IL or missing references)
			//IL_082e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_0848: Unknown result type (might be due to invalid IL or missing references)
			//IL_084d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0853: Expected O, but got Unknown
			//IL_0856: Unknown result type (might be due to invalid IL or missing references)
			//IL_085b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0870: Unknown result type (might be due to invalid IL or missing references)
			//IL_0875: Unknown result type (might be due to invalid IL or missing references)
			//IL_087a: Unknown result type (might be due to invalid IL or missing references)
			//IL_088f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0894: Unknown result type (might be due to invalid IL or missing references)
			//IL_0899: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d8: Expected O, but got Unknown
			//IL_08db: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0914: Unknown result type (might be due to invalid IL or missing references)
			//IL_0919: Unknown result type (might be due to invalid IL or missing references)
			//IL_091e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0933: Unknown result type (might be due to invalid IL or missing references)
			//IL_0938: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0952: Unknown result type (might be due to invalid IL or missing references)
			//IL_0957: Unknown result type (might be due to invalid IL or missing references)
			//IL_095d: Expected O, but got Unknown
			//IL_0960: Unknown result type (might be due to invalid IL or missing references)
			//IL_0965: Unknown result type (might be due to invalid IL or missing references)
			//IL_097a: Unknown result type (might be due to invalid IL or missing references)
			//IL_097f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0984: Unknown result type (might be due to invalid IL or missing references)
			//IL_0999: Unknown result type (might be due to invalid IL or missing references)
			//IL_099e: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e2: Expected O, but got Unknown
			//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a67: Expected O, but got Unknown
			//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aec: Expected O, but got Unknown
			//IL_0aef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b09: Unknown result type (might be due to in

BestMod/bin/Debug/UnityEngine.CoreModule.dll

Decompiled 6 months ago
#define UNITY_ASSERTIONS
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using Unity.Jobs.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Assertions.Comparers;
using UnityEngine.Bindings;
using UnityEngine.Diagnostics;
using UnityEngine.Events;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Internal;
using UnityEngine.Networking.PlayerConnection;
using UnityEngine.Playables;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.Scripting;
using UnityEngine.Scripting.APIUpdating;
using UnityEngine.Serialization;
using UnityEngineInternal;

[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.GoogleAudioSpatializer")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: UnityEngineModuleAssembly]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.BaselibModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.StyleSheetsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.FileSystemHttpModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.TimelineModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreModule")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine
{
	public class AndroidJavaObject : IDisposable
	{
		protected static AndroidJavaClass JavaLangClass => null;

		internal AndroidJavaObject()
		{
		}

		public AndroidJavaObject(string className, params object[] args)
		{
		}

		public void Dispose()
		{
		}

		public void Call(string methodName, params object[] args)
		{
		}

		public void CallStatic(string methodName, params object[] args)
		{
		}

		public FieldType Get<FieldType>(string fieldName)
		{
			return default(FieldType);
		}

		public void Set<FieldType>(string fieldName, FieldType val)
		{
		}

		public FieldType GetStatic<FieldType>(string fieldName)
		{
			return default(FieldType);
		}

		public void SetStatic<FieldType>(string fieldName, FieldType val)
		{
		}

		public IntPtr GetRawObject()
		{
			return IntPtr.Zero;
		}

		public IntPtr GetRawClass()
		{
			return IntPtr.Zero;
		}

		public ReturnType Call<ReturnType>(string methodName, params object[] args)
		{
			return default(ReturnType);
		}

		public ReturnType CallStatic<ReturnType>(string methodName, params object[] args)
		{
			return default(ReturnType);
		}

		protected void DebugPrint(string msg)
		{
		}

		protected void DebugPrint(string call, string methodName, string signature, object[] args)
		{
		}

		~AndroidJavaObject()
		{
		}

		protected virtual void Dispose(bool disposing)
		{
		}

		protected void _Dispose()
		{
		}

		protected void _Call(string methodName, params object[] args)
		{
		}

		protected ReturnType _Call<ReturnType>(string methodName, params object[] args)
		{
			return default(ReturnType);
		}

		protected FieldType _Get<FieldType>(string fieldName)
		{
			return default(FieldType);
		}

		protected void _Set<FieldType>(string fieldName, FieldType val)
		{
		}

		protected void _CallStatic(string methodName, params object[] args)
		{
		}

		protected ReturnType _CallStatic<ReturnType>(string methodName, params object[] args)
		{
			return default(ReturnType);
		}

		protected FieldType _GetStatic<FieldType>(string fieldName)
		{
			return default(FieldType);
		}

		protected void _SetStatic<FieldType>(string fieldName, FieldType val)
		{
		}

		protected IntPtr _GetRawObject()
		{
			return IntPtr.Zero;
		}

		protected IntPtr _GetRawClass()
		{
			return IntPtr.Zero;
		}

		protected static AndroidJavaObject FindClass(string name)
		{
			return null;
		}
	}
	public class AndroidJavaClass : AndroidJavaObject
	{
		public AndroidJavaClass(string className)
		{
		}
	}
	public delegate void AndroidJavaRunnable();
	public sealed class AndroidJavaException : Exception
	{
		private string mJavaStackTrace;

		public override string StackTrace => mJavaStackTrace + base.StackTrace;

		internal AndroidJavaException(string message, string javaStackTrace)
			: base(message)
		{
			mJavaStackTrace = javaStackTrace;
		}
	}
	public class AndroidJavaProxy
	{
		public readonly AndroidJavaClass javaInterface;

		public AndroidJavaProxy(string javaInterface)
		{
		}

		public AndroidJavaProxy(AndroidJavaClass javaInterface)
		{
		}

		public virtual AndroidJavaObject Invoke(string methodName, object[] args)
		{
			return null;
		}

		public virtual AndroidJavaObject Invoke(string methodName, AndroidJavaObject[] javaArgs)
		{
			return null;
		}

		public virtual bool equals(AndroidJavaObject obj)
		{
			return false;
		}

		public virtual int hashCode()
		{
			return 0;
		}

		public virtual string toString()
		{
			return "<c# proxy java object>";
		}
	}
	[StructLayout(LayoutKind.Explicit)]
	public struct jvalue
	{
		[FieldOffset(0)]
		public bool z;

		[FieldOffset(0)]
		public byte b;

		[FieldOffset(0)]
		public char c;

		[FieldOffset(0)]
		public short s;

		[FieldOffset(0)]
		public int i;

		[FieldOffset(0)]
		public long j;

		[FieldOffset(0)]
		public float f;

		[FieldOffset(0)]
		public double d;

		[FieldOffset(0)]
		public IntPtr l;
	}
	public class AndroidJNIHelper
	{
		public static bool debug
		{
			get
			{
				return false;
			}
			set
			{
			}
		}

		private AndroidJNIHelper()
		{
		}

		public static IntPtr GetConstructorID(IntPtr javaClass)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetConstructorID(IntPtr javaClass, [UnityEngine.Internal.DefaultValue("")] string signature)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetMethodID(IntPtr javaClass, string methodName)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetMethodID(IntPtr javaClass, string methodName, [UnityEngine.Internal.DefaultValue("")] string signature)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetMethodID(IntPtr javaClass, string methodName, [UnityEngine.Internal.DefaultValue("")] string signature, [UnityEngine.Internal.DefaultValue("false")] bool isStatic)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetFieldID(IntPtr javaClass, string fieldName)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetFieldID(IntPtr javaClass, string fieldName, [UnityEngine.Internal.DefaultValue("")] string signature)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetFieldID(IntPtr javaClass, string fieldName, [UnityEngine.Internal.DefaultValue("")] string signature, [UnityEngine.Internal.DefaultValue("false")] bool isStatic)
		{
			return IntPtr.Zero;
		}

		public static IntPtr CreateJavaRunnable(AndroidJavaRunnable jrunnable)
		{
			return IntPtr.Zero;
		}

		public static IntPtr CreateJavaProxy(AndroidJavaProxy proxy)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ConvertToJNIArray(Array array)
		{
			return IntPtr.Zero;
		}

		public static jvalue[] CreateJNIArgArray(object[] args)
		{
			return null;
		}

		public static void DeleteJNIArgArray(object[] args, jvalue[] jniArgs)
		{
		}

		public static IntPtr GetConstructorID(IntPtr jclass, object[] args)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetMethodID(IntPtr jclass, string methodName, object[] args, bool isStatic)
		{
			return IntPtr.Zero;
		}

		public static string GetSignature(object obj)
		{
			return "";
		}

		public static string GetSignature(object[] args)
		{
			return "";
		}

		public static ArrayType ConvertFromJNIArray<ArrayType>(IntPtr array)
		{
			return default(ArrayType);
		}

		public static IntPtr GetMethodID<ReturnType>(IntPtr jclass, string methodName, object[] args, bool isStatic)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetFieldID<FieldType>(IntPtr jclass, string fieldName, bool isStatic)
		{
			return IntPtr.Zero;
		}

		public static string GetSignature<ReturnType>(object[] args)
		{
			return "";
		}
	}
	public class AndroidJNI
	{
		private AndroidJNI()
		{
		}

		public static int AttachCurrentThread()
		{
			return 0;
		}

		public static int DetachCurrentThread()
		{
			return 0;
		}

		public static int GetVersion()
		{
			return 0;
		}

		public static IntPtr FindClass(string name)
		{
			return IntPtr.Zero;
		}

		public static IntPtr FromReflectedMethod(IntPtr refMethod)
		{
			return IntPtr.Zero;
		}

		public static IntPtr FromReflectedField(IntPtr refField)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToReflectedMethod(IntPtr clazz, IntPtr methodID, bool isStatic)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToReflectedField(IntPtr clazz, IntPtr fieldID, bool isStatic)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetSuperclass(IntPtr clazz)
		{
			return IntPtr.Zero;
		}

		public static bool IsAssignableFrom(IntPtr clazz1, IntPtr clazz2)
		{
			return false;
		}

		public static int Throw(IntPtr obj)
		{
			return 0;
		}

		public static int ThrowNew(IntPtr clazz, string message)
		{
			return 0;
		}

		public static IntPtr ExceptionOccurred()
		{
			return IntPtr.Zero;
		}

		public static void ExceptionDescribe()
		{
		}

		public static void ExceptionClear()
		{
		}

		public static void FatalError(string message)
		{
		}

		public static int PushLocalFrame(int capacity)
		{
			return 0;
		}

		public static IntPtr PopLocalFrame(IntPtr ptr)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewGlobalRef(IntPtr obj)
		{
			return IntPtr.Zero;
		}

		public static void DeleteGlobalRef(IntPtr obj)
		{
		}

		public static IntPtr NewLocalRef(IntPtr obj)
		{
			return IntPtr.Zero;
		}

		public static void DeleteLocalRef(IntPtr obj)
		{
		}

		public static bool IsSameObject(IntPtr obj1, IntPtr obj2)
		{
			return false;
		}

		public static int EnsureLocalCapacity(int capacity)
		{
			return 0;
		}

		public static IntPtr AllocObject(IntPtr clazz)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewObject(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetObjectClass(IntPtr obj)
		{
			return IntPtr.Zero;
		}

		public static bool IsInstanceOf(IntPtr obj, IntPtr clazz)
		{
			return false;
		}

		public static IntPtr GetMethodID(IntPtr clazz, string name, string sig)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetFieldID(IntPtr clazz, string name, string sig)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetStaticMethodID(IntPtr clazz, string name, string sig)
		{
			return IntPtr.Zero;
		}

		public static IntPtr GetStaticFieldID(IntPtr clazz, string name, string sig)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewStringUTF(string bytes)
		{
			return IntPtr.Zero;
		}

		public static int GetStringUTFLength(IntPtr str)
		{
			return 0;
		}

		public static string GetStringUTFChars(IntPtr str)
		{
			return "";
		}

		public static string CallStringMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return "";
		}

		public static IntPtr CallObjectMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return IntPtr.Zero;
		}

		public static int CallIntMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return 0;
		}

		public static bool CallBooleanMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return false;
		}

		public static short CallShortMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return 0;
		}

		public static byte CallByteMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return 0;
		}

		public static char CallCharMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return '0';
		}

		public static float CallFloatMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return 0f;
		}

		public static double CallDoubleMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return 0.0;
		}

		public static long CallLongMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
			return 0L;
		}

		public static void CallVoidMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
		{
		}

		public static string GetStringField(IntPtr obj, IntPtr fieldID)
		{
			return "";
		}

		public static IntPtr GetObjectField(IntPtr obj, IntPtr fieldID)
		{
			return IntPtr.Zero;
		}

		public static bool GetBooleanField(IntPtr obj, IntPtr fieldID)
		{
			return false;
		}

		public static byte GetByteField(IntPtr obj, IntPtr fieldID)
		{
			return 0;
		}

		public static char GetCharField(IntPtr obj, IntPtr fieldID)
		{
			return '0';
		}

		public static short GetShortField(IntPtr obj, IntPtr fieldID)
		{
			return 0;
		}

		public static int GetIntField(IntPtr obj, IntPtr fieldID)
		{
			return 0;
		}

		public static long GetLongField(IntPtr obj, IntPtr fieldID)
		{
			return 0L;
		}

		public static float GetFloatField(IntPtr obj, IntPtr fieldID)
		{
			return 0f;
		}

		public static double GetDoubleField(IntPtr obj, IntPtr fieldID)
		{
			return 0.0;
		}

		public static void SetStringField(IntPtr obj, IntPtr fieldID, string val)
		{
		}

		public static void SetObjectField(IntPtr obj, IntPtr fieldID, IntPtr val)
		{
		}

		public static void SetBooleanField(IntPtr obj, IntPtr fieldID, bool val)
		{
		}

		public static void SetByteField(IntPtr obj, IntPtr fieldID, byte val)
		{
		}

		public static void SetCharField(IntPtr obj, IntPtr fieldID, char val)
		{
		}

		public static void SetShortField(IntPtr obj, IntPtr fieldID, short val)
		{
		}

		public static void SetIntField(IntPtr obj, IntPtr fieldID, int val)
		{
		}

		public static void SetLongField(IntPtr obj, IntPtr fieldID, long val)
		{
		}

		public static void SetFloatField(IntPtr obj, IntPtr fieldID, float val)
		{
		}

		public static void SetDoubleField(IntPtr obj, IntPtr fieldID, double val)
		{
		}

		public static string CallStaticStringMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return "";
		}

		public static IntPtr CallStaticObjectMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return IntPtr.Zero;
		}

		public static int CallStaticIntMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return 0;
		}

		public static bool CallStaticBooleanMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return false;
		}

		public static short CallStaticShortMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return 0;
		}

		public static byte CallStaticByteMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return 0;
		}

		public static char CallStaticCharMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return '0';
		}

		public static float CallStaticFloatMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return 0f;
		}

		public static double CallStaticDoubleMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return 0.0;
		}

		public static long CallStaticLongMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
			return 0L;
		}

		public static void CallStaticVoidMethod(IntPtr clazz, IntPtr methodID, jvalue[] args)
		{
		}

		public static string GetStaticStringField(IntPtr clazz, IntPtr fieldID)
		{
			return "";
		}

		public static IntPtr GetStaticObjectField(IntPtr clazz, IntPtr fieldID)
		{
			return IntPtr.Zero;
		}

		public static bool GetStaticBooleanField(IntPtr clazz, IntPtr fieldID)
		{
			return false;
		}

		public static byte GetStaticByteField(IntPtr clazz, IntPtr fieldID)
		{
			return 0;
		}

		public static char GetStaticCharField(IntPtr clazz, IntPtr fieldID)
		{
			return '0';
		}

		public static short GetStaticShortField(IntPtr clazz, IntPtr fieldID)
		{
			return 0;
		}

		public static int GetStaticIntField(IntPtr clazz, IntPtr fieldID)
		{
			return 0;
		}

		public static long GetStaticLongField(IntPtr clazz, IntPtr fieldID)
		{
			return 0L;
		}

		public static float GetStaticFloatField(IntPtr clazz, IntPtr fieldID)
		{
			return 0f;
		}

		public static double GetStaticDoubleField(IntPtr clazz, IntPtr fieldID)
		{
			return 0.0;
		}

		public static void SetStaticStringField(IntPtr clazz, IntPtr fieldID, string val)
		{
		}

		public static void SetStaticObjectField(IntPtr clazz, IntPtr fieldID, IntPtr val)
		{
		}

		public static void SetStaticBooleanField(IntPtr clazz, IntPtr fieldID, bool val)
		{
		}

		public static void SetStaticByteField(IntPtr clazz, IntPtr fieldID, byte val)
		{
		}

		public static void SetStaticCharField(IntPtr clazz, IntPtr fieldID, char val)
		{
		}

		public static void SetStaticShortField(IntPtr clazz, IntPtr fieldID, short val)
		{
		}

		public static void SetStaticIntField(IntPtr clazz, IntPtr fieldID, int val)
		{
		}

		public static void SetStaticLongField(IntPtr clazz, IntPtr fieldID, long val)
		{
		}

		public static void SetStaticFloatField(IntPtr clazz, IntPtr fieldID, float val)
		{
		}

		public static void SetStaticDoubleField(IntPtr clazz, IntPtr fieldID, double val)
		{
		}

		public static IntPtr ToBooleanArray(bool[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToByteArray(byte[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToCharArray(char[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToShortArray(short[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToIntArray(int[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToLongArray(long[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToFloatArray(float[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToDoubleArray(double[] array)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToObjectArray(IntPtr[] array, IntPtr arrayClass)
		{
			return IntPtr.Zero;
		}

		public static IntPtr ToObjectArray(IntPtr[] array)
		{
			return IntPtr.Zero;
		}

		public static bool[] FromBooleanArray(IntPtr array)
		{
			return null;
		}

		public static byte[] FromByteArray(IntPtr array)
		{
			return null;
		}

		public static char[] FromCharArray(IntPtr array)
		{
			return null;
		}

		public static short[] FromShortArray(IntPtr array)
		{
			return null;
		}

		public static int[] FromIntArray(IntPtr array)
		{
			return null;
		}

		public static long[] FromLongArray(IntPtr array)
		{
			return null;
		}

		public static float[] FromFloatArray(IntPtr array)
		{
			return null;
		}

		public static double[] FromDoubleArray(IntPtr array)
		{
			return null;
		}

		public static IntPtr[] FromObjectArray(IntPtr array)
		{
			return null;
		}

		public static int GetArrayLength(IntPtr array)
		{
			return 0;
		}

		public static IntPtr NewBooleanArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewByteArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewCharArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewShortArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewIntArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewLongArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewFloatArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewDoubleArray(int size)
		{
			return IntPtr.Zero;
		}

		public static IntPtr NewObjectArray(int size, IntPtr clazz, IntPtr obj)
		{
			return IntPtr.Zero;
		}

		public static bool GetBooleanArrayElement(IntPtr array, int index)
		{
			return false;
		}

		public static byte GetByteArrayElement(IntPtr array, int index)
		{
			return 0;
		}

		public static char GetCharArrayElement(IntPtr array, int index)
		{
			return '0';
		}

		public static short GetShortArrayElement(IntPtr array, int index)
		{
			return 0;
		}

		public static int GetIntArrayElement(IntPtr array, int index)
		{
			return 0;
		}

		public static long GetLongArrayElement(IntPtr array, int index)
		{
			return 0L;
		}

		public static float GetFloatArrayElement(IntPtr array, int index)
		{
			return 0f;
		}

		public static double GetDoubleArrayElement(IntPtr array, int index)
		{
			return 0.0;
		}

		public static IntPtr GetObjectArrayElement(IntPtr array, int index)
		{
			return IntPtr.Zero;
		}

		public static void SetBooleanArrayElement(IntPtr array, int index, byte val)
		{
		}

		public static void SetByteArrayElement(IntPtr array, int index, sbyte val)
		{
		}

		public static void SetCharArrayElement(IntPtr array, int index, char val)
		{
		}

		public static void SetShortArrayElement(IntPtr array, int index, short val)
		{
		}

		public static void SetIntArrayElement(IntPtr array, int index, int val)
		{
		}

		public static void SetLongArrayElement(IntPtr array, int index, long val)
		{
		}

		public static void SetFloatArrayElement(IntPtr array, int index, float val)
		{
		}

		public static void SetDoubleArrayElement(IntPtr array, int index, double val)
		{
		}

		public static void SetObjectArrayElement(IntPtr array, int index, IntPtr obj)
		{
		}
	}
}
namespace UnityEngine.Android
{
	[NativeHeader("Runtime/Export/AndroidPermissions.bindings.h")]
	[UsedByNativeCode]
	public struct Permission
	{
		public const string Camera = "android.permission.CAMERA";

		public const string Microphone = "android.permission.RECORD_AUDIO";

		public const string FineLocation = "android.permission.ACCESS_FINE_LOCATION";

		public const string CoarseLocation = "android.permission.ACCESS_COARSE_LOCATION";

		public const string ExternalStorageRead = "android.permission.READ_EXTERNAL_STORAGE";

		public const string ExternalStorageWrite = "android.permission.WRITE_EXTERNAL_STORAGE";

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern bool HasUserAuthorizedPermission(string permission);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		public static extern void RequestUserPermission(string permission);
	}
}
namespace UnityEngine
{
	public enum WeightedMode
	{
		None,
		In,
		Out,
		Both
	}
	[RequiredByNativeCode]
	public struct Keyframe
	{
		private float m_Time;

		private float m_Value;

		private float m_InTangent;

		private float m_OutTangent;

		private int m_WeightedMode;

		private float m_InWeight;

		private float m_OutWeight;

		public float time
		{
			get
			{
				return m_Time;
			}
			set
			{
				m_Time = value;
			}
		}

		public float value
		{
			get
			{
				return m_Value;
			}
			set
			{
				m_Value = value;
			}
		}

		public float inTangent
		{
			get
			{
				return m_InTangent;
			}
			set
			{
				m_InTangent = value;
			}
		}

		public float outTangent
		{
			get
			{
				return m_OutTangent;
			}
			set
			{
				m_OutTangent = value;
			}
		}

		public float inWeight
		{
			get
			{
				return m_InWeight;
			}
			set
			{
				m_InWeight = value;
			}
		}

		public float outWeight
		{
			get
			{
				return m_OutWeight;
			}
			set
			{
				m_OutWeight = value;
			}
		}

		public WeightedMode weightedMode
		{
			get
			{
				return (WeightedMode)m_WeightedMode;
			}
			set
			{
				m_WeightedMode = (int)value;
			}
		}

		[Obsolete("Use AnimationUtility.SetKeyLeftTangentMode, AnimationUtility.SetKeyRightTangentMode, AnimationUtility.GetKeyLeftTangentMode or AnimationUtility.GetKeyRightTangentMode instead.")]
		public int tangentMode
		{
			get
			{
				return tangentModeInternal;
			}
			set
			{
				tangentModeInternal = value;
			}
		}

		internal int tangentModeInternal
		{
			get
			{
				return 0;
			}
			set
			{
			}
		}

		public Keyframe(float time, float value)
		{
			m_Time = time;
			m_Value = value;
			m_InTangent = 0f;
			m_OutTangent = 0f;
			m_WeightedMode = 0;
			m_InWeight = 0f;
			m_OutWeight = 0f;
		}

		public Keyframe(float time, float value, float inTangent, float outTangent)
		{
			m_Time = time;
			m_Value = value;
			m_InTangent = inTangent;
			m_OutTangent = outTangent;
			m_WeightedMode = 0;
			m_InWeight = 0f;
			m_OutWeight = 0f;
		}

		public Keyframe(float time, float value, float inTangent, float outTangent, float inWeight, float outWeight)
		{
			m_Time = time;
			m_Value = value;
			m_InTangent = inTangent;
			m_OutTangent = outTangent;
			m_WeightedMode = 3;
			m_InWeight = inWeight;
			m_OutWeight = outWeight;
		}
	}
	public enum WrapMode
	{
		Once = 1,
		Loop = 2,
		PingPong = 4,
		Default = 0,
		ClampForever = 8,
		Clamp = 1
	}
	[StructLayout(LayoutKind.Sequential)]
	[RequiredByNativeCode]
	[NativeHeader("Runtime/Math/AnimationCurve.bindings.h")]
	[ThreadAndSerializationSafe]
	public class AnimationCurve : IEquatable<AnimationCurve>
	{
		internal IntPtr m_Ptr;

		public Keyframe[] keys
		{
			get
			{
				return GetKeys();
			}
			set
			{
				SetKeys(value);
			}
		}

		public Keyframe this[int index] => GetKey(index);

		public extern int length
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetKeyCount", IsThreadSafe = true)]
			get;
		}

		public extern WrapMode preWrapMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPreInfinity", IsThreadSafe = true)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetPreInfinity", IsThreadSafe = true)]
			set;
		}

		public extern WrapMode postWrapMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPostInfinity", IsThreadSafe = true)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetPostInfinity", IsThreadSafe = true)]
			set;
		}

		public AnimationCurve(params Keyframe[] keys)
		{
			m_Ptr = Internal_Create(keys);
		}

		[RequiredByNativeCode]
		public AnimationCurve()
		{
			m_Ptr = Internal_Create(null);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationCurveBindings::Internal_Destroy", IsThreadSafe = true)]
		private static extern void Internal_Destroy(IntPtr ptr);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationCurveBindings::Internal_Create", IsThreadSafe = true)]
		private static extern IntPtr Internal_Create(Keyframe[] keys);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationCurveBindings::Internal_Equals", HasExplicitThis = true)]
		private extern bool Internal_Equals(IntPtr other);

		~AnimationCurve()
		{
			Internal_Destroy(m_Ptr);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[ThreadSafe]
		public extern float Evaluate(float time);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationCurveBindings::AddKeySmoothTangents", HasExplicitThis = true, IsThreadSafe = true)]
		public extern int AddKey(float time, float value);

		public int AddKey(Keyframe key)
		{
			return AddKey_Internal(key);
		}

		[NativeMethod("AddKey", IsThreadSafe = true)]
		private int AddKey_Internal(Keyframe key)
		{
			return AddKey_Internal_Injected(ref key);
		}

		[FreeFunction("AnimationCurveBindings::MoveKey", HasExplicitThis = true, IsThreadSafe = true)]
		[NativeThrows]
		public int MoveKey(int index, Keyframe key)
		{
			return MoveKey_Injected(index, ref key);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeThrows]
		[FreeFunction("AnimationCurveBindings::RemoveKey", HasExplicitThis = true, IsThreadSafe = true)]
		public extern void RemoveKey(int index);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationCurveBindings::SetKeys", HasExplicitThis = true, IsThreadSafe = true)]
		private extern void SetKeys(Keyframe[] keys);

		[FreeFunction("AnimationCurveBindings::GetKey", HasExplicitThis = true, IsThreadSafe = true)]
		[NativeThrows]
		private Keyframe GetKey(int index)
		{
			GetKey_Injected(index, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationCurveBindings::GetKeys", HasExplicitThis = true, IsThreadSafe = true)]
		private extern Keyframe[] GetKeys();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("AnimationCurveBindings::SmoothTangents", HasExplicitThis = true, IsThreadSafe = true)]
		[NativeThrows]
		public extern void SmoothTangents(int index, float weight);

		public static AnimationCurve Constant(float timeStart, float timeEnd, float value)
		{
			return Linear(timeStart, value, timeEnd, value);
		}

		public static AnimationCurve Linear(float timeStart, float valueStart, float timeEnd, float valueEnd)
		{
			if (timeStart == timeEnd)
			{
				Keyframe keyframe = new Keyframe(timeStart, valueStart);
				return new AnimationCurve(keyframe);
			}
			float num = (valueEnd - valueStart) / (timeEnd - timeStart);
			Keyframe[] array = new Keyframe[2]
			{
				new Keyframe(timeStart, valueStart, 0f, num),
				new Keyframe(timeEnd, valueEnd, num, 0f)
			};
			return new AnimationCurve(array);
		}

		public static AnimationCurve EaseInOut(float timeStart, float valueStart, float timeEnd, float valueEnd)
		{
			if (timeStart == timeEnd)
			{
				Keyframe keyframe = new Keyframe(timeStart, valueStart);
				return new AnimationCurve(keyframe);
			}
			Keyframe[] array = new Keyframe[2]
			{
				new Keyframe(timeStart, valueStart, 0f, 0f),
				new Keyframe(timeEnd, valueEnd, 0f, 0f)
			};
			return new AnimationCurve(array);
		}

		public override bool Equals(object o)
		{
			if (object.ReferenceEquals(null, o))
			{
				return false;
			}
			if (object.ReferenceEquals(this, o))
			{
				return true;
			}
			if ((object)o.GetType() != GetType())
			{
				return false;
			}
			return Equals((AnimationCurve)o);
		}

		public bool Equals(AnimationCurve other)
		{
			if (object.ReferenceEquals(null, other))
			{
				return false;
			}
			if (object.ReferenceEquals(this, other))
			{
				return true;
			}
			if (m_Ptr.Equals((object?)(nint)other.m_Ptr))
			{
				return true;
			}
			return Internal_Equals(other.m_Ptr);
		}

		public override int GetHashCode()
		{
			return m_Ptr.GetHashCode();
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern int AddKey_Internal_Injected(ref Keyframe key);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern int MoveKey_Injected(int index, ref Keyframe key);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GetKey_Injected(int index, out Keyframe ret);
	}
	[NativeHeader("Runtime/Misc/Player.h")]
	[NativeHeader("Runtime/Misc/BuildSettings.h")]
	[NativeHeader("Runtime/Input/InputManager.h")]
	[NativeHeader("Runtime/Input/GetInput.h")]
	[NativeHeader("Runtime/BaseClasses/IsPlaying.h")]
	[NativeHeader("Runtime/Misc/SystemInfo.h")]
	[NativeHeader("Runtime/Application/ApplicationInfo.h")]
	[NativeHeader("Runtime/Application/AdsIdHandler.h")]
	[NativeHeader("Runtime/Export/Application.bindings.h")]
	[NativeHeader("Runtime/File/ApplicationSpecificPersistentDataPath.h")]
	[NativeHeader("Runtime/Network/NetworkUtility.h")]
	[NativeHeader("Runtime/Misc/PlayerSettings.h")]
	[NativeHeader("Runtime/PreloadManager/PreloadManager.h")]
	[NativeHeader("Runtime/Utilities/Argv.h")]
	[NativeHeader("Runtime/Utilities/URLUtility.h")]
	[NativeHeader("Runtime/Logging/LogSystem.h")]
	[NativeHeader("Runtime/PreloadManager/LoadSceneOperation.h")]
	public class Application
	{
		public delegate void AdvertisingIdentifierCallback(string advertisingId, bool trackingEnabled, string errorMsg);

		public delegate void LowMemoryCallback();

		public delegate void LogCallback(string condition, string stackTrace, LogType type);

		private static LogCallback s_LogCallbackHandler;

		private static LogCallback s_LogCallbackHandlerThreaded;

		internal static AdvertisingIdentifierCallback OnAdvertisingIdentifierCallback;

		private static volatile LogCallback s_RegisterLogCallbackDeprecated;

		[Obsolete("This property is deprecated, please use LoadLevelAsync to detect if a specific scene is currently loading.")]
		public static extern bool isLoadingLevel
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPreloadManager().IsLoadingOrQueued")]
			get;
		}

		[Obsolete("Streaming was a Unity Web Player feature, and is removed. This property is deprecated and always returns 0.")]
		public static int streamedBytes => 0;

		[EditorBrowsable(EditorBrowsableState.Never)]
		[Obsolete("Application.webSecurityEnabled is no longer supported, since the Unity Web Player is no longer supported by Unity", true)]
		public static bool webSecurityEnabled => false;

		public static extern bool isPlaying
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("IsWorldPlaying")]
			get;
		}

		public static extern bool isFocused
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("IsPlayerFocused")]
			get;
		}

		public static extern RuntimePlatform platform
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("systeminfo::GetRuntimePlatform", IsThreadSafe = true)]
			get;
		}

		public static extern string buildGUID
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("Application_Bindings::GetBuildGUID")]
			get;
		}

		public static bool isMobilePlatform
		{
			get
			{
				switch (platform)
				{
				case RuntimePlatform.IPhonePlayer:
				case RuntimePlatform.Android:
					return true;
				case RuntimePlatform.MetroPlayerX86:
				case RuntimePlatform.MetroPlayerX64:
				case RuntimePlatform.MetroPlayerARM:
					return SystemInfo.deviceType == DeviceType.Handheld;
				default:
					return false;
				}
			}
		}

		public static bool isConsolePlatform
		{
			get
			{
				RuntimePlatform runtimePlatform = platform;
				return runtimePlatform == RuntimePlatform.PS4 || runtimePlatform == RuntimePlatform.XboxOne;
			}
		}

		public static extern bool runInBackground
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPlayerSettingsRunInBackground")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("SetPlayerSettingsRunInBackground")]
			set;
		}

		public static extern bool isBatchMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("::IsBatchmode")]
			get;
		}

		internal static extern bool isTestRun
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("::IsTestRun")]
			get;
		}

		internal static extern bool isHumanControllingUs
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("::IsHumanControllingUs")]
			get;
		}

		public static extern string dataPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetAppDataPath")]
			get;
		}

		public static extern string streamingAssetsPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetStreamingAssetsPath", IsThreadSafe = true)]
			get;
		}

		[SecurityCritical]
		public static extern string persistentDataPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPersistentDataPathApplicationSpecific")]
			get;
		}

		public static extern string temporaryCachePath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetTemporaryCachePathApplicationSpecific")]
			get;
		}

		public static extern string absoluteURL
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPlayerSettings().GetAbsoluteURL")]
			get;
		}

		public static extern string unityVersion
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("Application_Bindings::GetUnityVersion")]
			get;
		}

		public static extern string version
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetApplicationInfo().GetVersion")]
			get;
		}

		public static extern string installerName
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetApplicationInfo().GetInstallerName")]
			get;
		}

		public static extern string identifier
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetApplicationInfo().GetApplicationIdentifier")]
			get;
		}

		public static extern ApplicationInstallMode installMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetApplicationInfo().GetInstallMode")]
			get;
		}

		public static extern ApplicationSandboxType sandboxType
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetApplicationInfo().GetSandboxType")]
			get;
		}

		public static extern string productName
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPlayerSettings().GetProductName")]
			get;
		}

		public static extern string companyName
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPlayerSettings().GetCompanyName")]
			get;
		}

		public static extern string cloudProjectId
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPlayerSettings().GetCloudProjectId")]
			get;
		}

		public static extern int targetFrameRate
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetTargetFrameRate")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("SetTargetFrameRate")]
			set;
		}

		public static extern SystemLanguage systemLanguage
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("(SystemLanguage)systeminfo::GetSystemLanguage")]
			get;
		}

		[Obsolete("Use SetStackTraceLogType/GetStackTraceLogType instead")]
		public static extern StackTraceLogType stackTraceLogType
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("Application_Bindings::GetStackTraceLogType")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("Application_Bindings::SetStackTraceLogType")]
			set;
		}

		public static extern string consoleLogPath
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetConsoleLogPath")]
			get;
		}

		public static extern ThreadPriority backgroundLoadingPriority
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPreloadManager().GetThreadPriority")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPreloadManager().SetThreadPriority")]
			set;
		}

		public static extern NetworkReachability internetReachability
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetInternetReachability")]
			get;
		}

		public static extern bool genuine
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("IsApplicationGenuine")]
			get;
		}

		public static extern bool genuineCheckAvailable
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("IsApplicationGenuineAvailable")]
			get;
		}

		internal static extern bool submitAnalytics
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("GetPlayerSettings().GetSubmitAnalytics")]
			get;
		}

		[Obsolete("This property is deprecated, please use SplashScreen.isFinished instead")]
		public static bool isShowingSplashScreen => !SplashScreen.isFinished;

		[Obsolete("use Application.isEditor instead")]
		public static bool isPlayer => !isEditor;

		public static bool isEditor => false;

		[Obsolete("Use SceneManager.sceneCountInBuildSettings")]
		public static int levelCount => SceneManager.sceneCountInBuildSettings;

		[Obsolete("Use SceneManager to determine what scenes have been loaded")]
		public static int loadedLevel => SceneManager.GetActiveScene().buildIndex;

		[Obsolete("Use SceneManager to determine what scenes have been loaded")]
		public static string loadedLevelName => SceneManager.GetActiveScene().name;

		public static event LowMemoryCallback lowMemory;

		public static event LogCallback logMessageReceived
		{
			add
			{
				s_LogCallbackHandler = (LogCallback)Delegate.Combine(s_LogCallbackHandler, value);
				SetLogCallbackDefined(defined: true);
			}
			remove
			{
				s_LogCallbackHandler = (LogCallback)Delegate.Remove(s_LogCallbackHandler, value);
			}
		}

		public static event LogCallback logMessageReceivedThreaded
		{
			add
			{
				s_LogCallbackHandlerThreaded = (LogCallback)Delegate.Combine(s_LogCallbackHandlerThreaded, value);
				SetLogCallbackDefined(defined: true);
			}
			remove
			{
				s_LogCallbackHandlerThreaded = (LogCallback)Delegate.Remove(s_LogCallbackHandlerThreaded, value);
			}
		}

		public static event UnityAction onBeforeRender
		{
			add
			{
				BeforeRenderHelper.RegisterCallback(value);
			}
			remove
			{
				BeforeRenderHelper.UnregisterCallback(value);
			}
		}

		public static event Action<bool> focusChanged;

		public static event Func<bool> wantsToQuit;

		public static event Action quitting;

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetInputManager().QuitApplication")]
		public static extern void Quit(int exitCode);

		public static void Quit()
		{
			Quit(0);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("CancelQuit is deprecated. Use the wantsToQuit event instead.")]
		[FreeFunction("GetInputManager().CancelQuitApplication")]
		public static extern void CancelQuit();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("Application_Bindings::Unload")]
		public static extern void Unload();

		[Obsolete("Streaming was a Unity Web Player feature, and is removed. This function is deprecated and always returns 1.0 for valid level indices.")]
		public static float GetStreamProgressForLevel(int levelIndex)
		{
			if (levelIndex >= 0 && levelIndex < SceneManager.sceneCountInBuildSettings)
			{
				return 1f;
			}
			return 0f;
		}

		[Obsolete("Streaming was a Unity Web Player feature, and is removed. This function is deprecated and always returns 1.0.")]
		public static float GetStreamProgressForLevel(string levelName)
		{
			return 1f;
		}

		public static bool CanStreamedLevelBeLoaded(int levelIndex)
		{
			return levelIndex >= 0 && levelIndex < SceneManager.sceneCountInBuildSettings;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("Application_Bindings::CanStreamedLevelBeLoaded")]
		public static extern bool CanStreamedLevelBeLoaded(string levelName);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction]
		public static extern bool IsPlaying(Object obj);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetBuildSettings().GetBuildTags")]
		public static extern string[] GetBuildTags();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetBuildSettings().SetBuildTags")]
		public static extern void SetBuildTags(string[] buildTags);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetBuildSettings().GetHasPROVersion")]
		public static extern bool HasProLicense();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("HasARGV")]
		internal static extern bool HasARGV(string name);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetFirstValueForARGV")]
		internal static extern string GetValueForARGV(string name);

		[Obsolete("Application.ExternalEval is deprecated. See https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html for alternatives.")]
		public static void ExternalEval(string script)
		{
			if (script.Length > 0 && script[script.Length - 1] != ';')
			{
				script += ';';
			}
			Internal_ExternalCall(script);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("Application_Bindings::ExternalCall")]
		private static extern void Internal_ExternalCall(string script);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetAdsIdHandler().RequestAdsIdAsync")]
		public static extern bool RequestAdvertisingIdentifierAsync(AdvertisingIdentifierCallback delegateMethod);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("OpenURL")]
		public static extern void OpenURL(string url);

		[Obsolete("Use UnityEngine.Diagnostics.Utils.ForceCrash")]
		public static void ForceCrash(int mode)
		{
			Utils.ForceCrash((ForcedCrashCategory)mode);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("Application_Bindings::SetLogCallbackDefined")]
		private static extern void SetLogCallbackDefined(bool defined);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("GetStackTraceLogType")]
		public static extern StackTraceLogType GetStackTraceLogType(LogType logType);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("SetStackTraceLogType")]
		public static extern void SetStackTraceLogType(LogType logType, StackTraceLogType stackTraceType);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("Application_Bindings::RequestUserAuthorization")]
		public static extern AsyncOperation RequestUserAuthorization(UserAuthorization mode);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction("Application_Bindings::HasUserAuthorization")]
		public static extern bool HasUserAuthorization(UserAuthorization mode);

		[RequiredByNativeCode]
		private static void CallLowMemory()
		{
			Application.lowMemory?.Invoke();
		}

		[RequiredByNativeCode]
		private static void CallLogCallback(string logString, string stackTrace, LogType type, bool invokedOnMainThread)
		{
			if (invokedOnMainThread)
			{
				s_LogCallbackHandler?.Invoke(logString, stackTrace, type);
			}
			s_LogCallbackHandlerThreaded?.Invoke(logString, stackTrace, type);
		}

		internal static void InvokeOnAdvertisingIdentifierCallback(string advertisingId, bool trackingEnabled)
		{
			if (OnAdvertisingIdentifierCallback != null)
			{
				OnAdvertisingIdentifierCallback(advertisingId, trackingEnabled, string.Empty);
			}
		}

		private static string ObjectToJSString(object o)
		{
			if (o == null)
			{
				return "null";
			}
			if (o is string)
			{
				string text = o.ToString().Replace("\\", "\\\\");
				text = text.Replace("\"", "\\\"");
				text = text.Replace("\n", "\\n");
				text = text.Replace("\r", "\\r");
				text = text.Replace("\0", "");
				text = text.Replace("\u2028", "");
				text = text.Replace("\u2029", "");
				return '"' + text + '"';
			}
			if (o is int || o is short || o is uint || o is ushort || o is byte)
			{
				return o.ToString();
			}
			if (o is float)
			{
				NumberFormatInfo numberFormat = CultureInfo.InvariantCulture.NumberFormat;
				return ((float)o).ToString(numberFormat);
			}
			if (o is double)
			{
				NumberFormatInfo numberFormat2 = CultureInfo.InvariantCulture.NumberFormat;
				return ((double)o).ToString(numberFormat2);
			}
			if (o is char)
			{
				if ((char)o == '"')
				{
					return "\"\\\"\"";
				}
				return '"' + o.ToString() + '"';
			}
			if (o is IList)
			{
				IList list = (IList)o;
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append("new Array(");
				int count = list.Count;
				for (int i = 0; i < count; i++)
				{
					if (i != 0)
					{
						stringBuilder.Append(", ");
					}
					stringBuilder.Append(ObjectToJSString(list[i]));
				}
				stringBuilder.Append(")");
				return stringBuilder.ToString();
			}
			return ObjectToJSString(o.ToString());
		}

		[Obsolete("Application.ExternalCall is deprecated. See https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html for alternatives.")]
		public static void ExternalCall(string functionName, params object[] args)
		{
			Internal_ExternalCall(BuildInvocationForArguments(functionName, args));
		}

		private static string BuildInvocationForArguments(string functionName, params object[] args)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(functionName);
			stringBuilder.Append('(');
			int num = args.Length;
			for (int i = 0; i < num; i++)
			{
				if (i != 0)
				{
					stringBuilder.Append(", ");
				}
				stringBuilder.Append(ObjectToJSString(args[i]));
			}
			stringBuilder.Append(')');
			stringBuilder.Append(';');
			return stringBuilder.ToString();
		}

		[Obsolete("Use Object.DontDestroyOnLoad instead")]
		public static void DontDestroyOnLoad(Object o)
		{
			if (o != null)
			{
				Object.DontDestroyOnLoad(o);
			}
		}

		[Obsolete("Application.CaptureScreenshot is obsolete. Use ScreenCapture.CaptureScreenshot instead (UnityUpgradable) -> [UnityEngine] UnityEngine.ScreenCapture.CaptureScreenshot(*)", true)]
		public static void CaptureScreenshot(string filename, int superSize)
		{
			throw new NotSupportedException("Application.CaptureScreenshot is obsolete. Use ScreenCapture.CaptureScreenshot instead.");
		}

		[Obsolete("Application.CaptureScreenshot is obsolete. Use ScreenCapture.CaptureScreenshot instead (UnityUpgradable) -> [UnityEngine] UnityEngine.ScreenCapture.CaptureScreenshot(*)", true)]
		public static void CaptureScreenshot(string filename)
		{
			throw new NotSupportedException("Application.CaptureScreenshot is obsolete. Use ScreenCapture.CaptureScreenshot instead.");
		}

		[RequiredByNativeCode]
		private static bool Internal_ApplicationWantsToQuit()
		{
			if (Application.wantsToQuit != null)
			{
				Delegate[] invocationList = Application.wantsToQuit.GetInvocationList();
				for (int i = 0; i < invocationList.Length; i++)
				{
					Func<bool> func = (Func<bool>)invocationList[i];
					try
					{
						if (!func())
						{
							return false;
						}
					}
					catch (Exception exception)
					{
						Debug.LogException(exception);
					}
				}
			}
			return true;
		}

		[RequiredByNativeCode]
		private static void Internal_ApplicationQuit()
		{
			if (Application.quitting != null)
			{
				Application.quitting();
			}
		}

		[RequiredByNativeCode]
		internal static void InvokeOnBeforeRender()
		{
			BeforeRenderHelper.Invoke();
		}

		[RequiredByNativeCode]
		internal static void InvokeFocusChanged(bool focus)
		{
			if (Application.focusChanged != null)
			{
				Application.focusChanged(focus);
			}
		}

		[Obsolete("Application.RegisterLogCallback is deprecated. Use Application.logMessageReceived instead.")]
		public static void RegisterLogCallback(LogCallback handler)
		{
			RegisterLogCallback(handler, threaded: false);
		}

		[Obsolete("Application.RegisterLogCallbackThreaded is deprecated. Use Application.logMessageReceivedThreaded instead.")]
		public static void RegisterLogCallbackThreaded(LogCallback handler)
		{
			RegisterLogCallback(handler, threaded: true);
		}

		private static void RegisterLogCallback(LogCallback handler, bool threaded)
		{
			if (s_RegisterLogCallbackDeprecated != null)
			{
				logMessageReceived -= s_RegisterLogCallbackDeprecated;
				logMessageReceivedThreaded -= s_RegisterLogCallbackDeprecated;
			}
			s_RegisterLogCallbackDeprecated = handler;
			if (handler != null)
			{
				if (threaded)
				{
					logMessageReceivedThreaded += handler;
				}
				else
				{
					logMessageReceived += handler;
				}
			}
		}

		[Obsolete("Use SceneManager.LoadScene")]
		public static void LoadLevel(int index)
		{
			SceneManager.LoadScene(index, LoadSceneMode.Single);
		}

		[Obsolete("Use SceneManager.LoadScene")]
		public static void LoadLevel(string name)
		{
			SceneManager.LoadScene(name, LoadSceneMode.Single);
		}

		[Obsolete("Use SceneManager.LoadScene")]
		public static void LoadLevelAdditive(int index)
		{
			SceneManager.LoadScene(index, LoadSceneMode.Additive);
		}

		[Obsolete("Use SceneManager.LoadScene")]
		public static void LoadLevelAdditive(string name)
		{
			SceneManager.LoadScene(name, LoadSceneMode.Additive);
		}

		[Obsolete("Use SceneManager.LoadSceneAsync")]
		public static AsyncOperation LoadLevelAsync(int index)
		{
			return SceneManager.LoadSceneAsync(index, LoadSceneMode.Single);
		}

		[Obsolete("Use SceneManager.LoadSceneAsync")]
		public static AsyncOperation LoadLevelAsync(string levelName)
		{
			return SceneManager.LoadSceneAsync(levelName, LoadSceneMode.Single);
		}

		[Obsolete("Use SceneManager.LoadSceneAsync")]
		public static AsyncOperation LoadLevelAdditiveAsync(int index)
		{
			return SceneManager.LoadSceneAsync(index, LoadSceneMode.Additive);
		}

		[Obsolete("Use SceneManager.LoadSceneAsync")]
		public static AsyncOperation LoadLevelAdditiveAsync(string levelName)
		{
			return SceneManager.LoadSceneAsync(levelName, LoadSceneMode.Additive);
		}

		[Obsolete("Use SceneManager.UnloadScene")]
		public static bool UnloadLevel(int index)
		{
			return SceneManager.UnloadScene(index);
		}

		[Obsolete("Use SceneManager.UnloadScene")]
		public static bool UnloadLevel(string scenePath)
		{
			return SceneManager.UnloadScene(scenePath);
		}
	}
	public enum StackTraceLogType
	{
		None,
		ScriptOnly,
		Full
	}
	public enum NetworkReachability
	{
		NotReachable,
		ReachableViaCarrierDataNetwork,
		ReachableViaLocalAreaNetwork
	}
	public enum UserAuthorization
	{
		WebCam = 1,
		Microphone
	}
	public enum ApplicationInstallMode
	{
		Unknown,
		Store,
		DeveloperBuild,
		Adhoc,
		Enterprise,
		Editor
	}
	public enum ApplicationSandboxType
	{
		Unknown,
		NotSandboxed,
		Sandboxed,
		SandboxBroken
	}
	internal static class ArrayUtils
	{
	}
}
namespace UnityEngine.Rendering
{
	[NativeHeader("Runtime/Graphics/Texture.h")]
	[NativeHeader("Runtime/Graphics/AsyncGPUReadbackManaged.h")]
	[NativeHeader("Runtime/Shaders/ComputeShader.h")]
	[UsedByNativeCode]
	public struct AsyncGPUReadbackRequest
	{
		internal IntPtr m_Ptr;

		internal int m_Version;

		public bool done => IsDone();

		public bool hasError => HasError();

		public int layerCount => GetLayerCount();

		public int layerDataSize => GetLayerDataSize();

		public int width => GetWidth();

		public int height => GetHeight();

		public int depth => GetDepth();

		public void Update()
		{
			Update_Injected(ref this);
		}

		public void WaitForCompletion()
		{
			WaitForCompletion_Injected(ref this);
		}

		public unsafe NativeArray<T> GetData<T>(int layer = 0) where T : struct
		{
			if (!done || hasError)
			{
				throw new InvalidOperationException("Cannot access the data as it is not available");
			}
			if (layer < 0 || layer >= layerCount)
			{
				throw new ArgumentException($"Layer index is out of range {layer} / {layerCount}");
			}
			int num = UnsafeUtility.SizeOf<T>();
			return NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<T>((void*)GetDataRaw(layer), layerDataSize / num, Allocator.None);
		}

		private bool IsDone()
		{
			return IsDone_Injected(ref this);
		}

		private bool HasError()
		{
			return HasError_Injected(ref this);
		}

		private int GetLayerCount()
		{
			return GetLayerCount_Injected(ref this);
		}

		private int GetLayerDataSize()
		{
			return GetLayerDataSize_Injected(ref this);
		}

		private int GetWidth()
		{
			return GetWidth_Injected(ref this);
		}

		private int GetHeight()
		{
			return GetHeight_Injected(ref this);
		}

		private int GetDepth()
		{
			return GetDepth_Injected(ref this);
		}

		internal void SetScriptingCallback(Action<AsyncGPUReadbackRequest> callback)
		{
			SetScriptingCallback_Injected(ref this, callback);
		}

		private IntPtr GetDataRaw(int layer)
		{
			return GetDataRaw_Injected(ref this, layer);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Update_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void WaitForCompletion_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool IsDone_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool HasError_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern int GetLayerCount_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern int GetLayerDataSize_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern int GetWidth_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern int GetHeight_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern int GetDepth_Injected(ref AsyncGPUReadbackRequest _unity_self);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void SetScriptingCallback_Injected(ref AsyncGPUReadbackRequest _unity_self, Action<AsyncGPUReadbackRequest> callback);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern IntPtr GetDataRaw_Injected(ref AsyncGPUReadbackRequest _unity_self, int layer);
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public static class AsyncGPUReadback
	{
		private static void SetUpScriptingRequest(AsyncGPUReadbackRequest request, Action<AsyncGPUReadbackRequest> callback)
		{
			request.SetScriptingCallback(callback);
		}

		public static AsyncGPUReadbackRequest Request(ComputeBuffer src, Action<AsyncGPUReadbackRequest> callback = null)
		{
			AsyncGPUReadbackRequest asyncGPUReadbackRequest = Request_Internal_ComputeBuffer_1(src);
			SetUpScriptingRequest(asyncGPUReadbackRequest, callback);
			return asyncGPUReadbackRequest;
		}

		public static AsyncGPUReadbackRequest Request(ComputeBuffer src, int size, int offset, Action<AsyncGPUReadbackRequest> callback = null)
		{
			AsyncGPUReadbackRequest asyncGPUReadbackRequest = Request_Internal_ComputeBuffer_2(src, size, offset);
			SetUpScriptingRequest(asyncGPUReadbackRequest, callback);
			return asyncGPUReadbackRequest;
		}

		public static AsyncGPUReadbackRequest Request(Texture src, int mipIndex = 0, Action<AsyncGPUReadbackRequest> callback = null)
		{
			AsyncGPUReadbackRequest asyncGPUReadbackRequest = Request_Internal_Texture_1(src, mipIndex);
			SetUpScriptingRequest(asyncGPUReadbackRequest, callback);
			return asyncGPUReadbackRequest;
		}

		public static AsyncGPUReadbackRequest Request(Texture src, int mipIndex, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback = null)
		{
			AsyncGPUReadbackRequest asyncGPUReadbackRequest = Request_Internal_Texture_2(src, mipIndex, dstFormat);
			SetUpScriptingRequest(asyncGPUReadbackRequest, callback);
			return asyncGPUReadbackRequest;
		}

		public static AsyncGPUReadbackRequest Request(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, Action<AsyncGPUReadbackRequest> callback = null)
		{
			AsyncGPUReadbackRequest asyncGPUReadbackRequest = Request_Internal_Texture_3(src, mipIndex, x, width, y, height, z, depth);
			SetUpScriptingRequest(asyncGPUReadbackRequest, callback);
			return asyncGPUReadbackRequest;
		}

		public static AsyncGPUReadbackRequest Request(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat, Action<AsyncGPUReadbackRequest> callback = null)
		{
			AsyncGPUReadbackRequest asyncGPUReadbackRequest = Request_Internal_Texture_4(src, mipIndex, x, width, y, height, z, depth, dstFormat);
			SetUpScriptingRequest(asyncGPUReadbackRequest, callback);
			return asyncGPUReadbackRequest;
		}

		[NativeMethod("Request")]
		private static AsyncGPUReadbackRequest Request_Internal_ComputeBuffer_1([NotNull] ComputeBuffer buffer)
		{
			Request_Internal_ComputeBuffer_1_Injected(buffer, out var ret);
			return ret;
		}

		[NativeMethod("Request")]
		private static AsyncGPUReadbackRequest Request_Internal_ComputeBuffer_2([NotNull] ComputeBuffer src, int size, int offset)
		{
			Request_Internal_ComputeBuffer_2_Injected(src, size, offset, out var ret);
			return ret;
		}

		[NativeMethod("Request")]
		private static AsyncGPUReadbackRequest Request_Internal_Texture_1([NotNull] Texture src, int mipIndex)
		{
			Request_Internal_Texture_1_Injected(src, mipIndex, out var ret);
			return ret;
		}

		[NativeMethod("Request")]
		private static AsyncGPUReadbackRequest Request_Internal_Texture_2([NotNull] Texture src, int mipIndex, TextureFormat dstFormat)
		{
			Request_Internal_Texture_2_Injected(src, mipIndex, dstFormat, out var ret);
			return ret;
		}

		[NativeMethod("Request")]
		private static AsyncGPUReadbackRequest Request_Internal_Texture_3([NotNull] Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth)
		{
			Request_Internal_Texture_3_Injected(src, mipIndex, x, width, y, height, z, depth, out var ret);
			return ret;
		}

		[NativeMethod("Request")]
		private static AsyncGPUReadbackRequest Request_Internal_Texture_4([NotNull] Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat)
		{
			Request_Internal_Texture_4_Injected(src, mipIndex, x, width, y, height, z, depth, dstFormat, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Request_Internal_ComputeBuffer_1_Injected(ComputeBuffer buffer, out AsyncGPUReadbackRequest ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Request_Internal_ComputeBuffer_2_Injected(ComputeBuffer src, int size, int offset, out AsyncGPUReadbackRequest ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Request_Internal_Texture_1_Injected(Texture src, int mipIndex, out AsyncGPUReadbackRequest ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Request_Internal_Texture_2_Injected(Texture src, int mipIndex, TextureFormat dstFormat, out AsyncGPUReadbackRequest ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Request_Internal_Texture_3_Injected(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, out AsyncGPUReadbackRequest ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void Request_Internal_Texture_4_Injected(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat, out AsyncGPUReadbackRequest ret);
	}
}
namespace UnityEngine
{
	[StructLayout(LayoutKind.Sequential)]
	[NativeHeader("Runtime/Export/AsyncOperation.bindings.h")]
	[RequiredByNativeCode]
	[NativeHeader("Runtime/Misc/AsyncOperation.h")]
	[ThreadAndSerializationSafe]
	public class AsyncOperation : YieldInstruction
	{
		internal IntPtr m_Ptr;

		private Action<AsyncOperation> m_completeCallback;

		public extern bool isDone
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsDone")]
			get;
		}

		public extern float progress
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetProgress")]
			get;
		}

		public extern int priority
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetPriority")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetPriority")]
			set;
		}

		public extern bool allowSceneActivation
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetAllowSceneActivation")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("SetAllowSceneActivation")]
			set;
		}

		public event Action<AsyncOperation> completed
		{
			add
			{
				if (isDone)
				{
					value(this);
				}
				else
				{
					m_completeCallback = (Action<AsyncOperation>)Delegate.Combine(m_completeCallback, value);
				}
			}
			remove
			{
				m_completeCallback = (Action<AsyncOperation>)Delegate.Remove(m_completeCallback, value);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[NativeMethod(IsThreadSafe = true)]
		private static extern void InternalDestroy(IntPtr ptr);

		~AsyncOperation()
		{
			InternalDestroy(m_Ptr);
		}

		[RequiredByNativeCode]
		internal void InvokeCompletionEvent()
		{
			if (m_completeCallback != null)
			{
				m_completeCallback(this);
				m_completeCallback = null;
			}
		}
	}
}
namespace Unity.IO.LowLevel.Unsafe
{
	public struct ReadCommand
	{
		public unsafe void* Buffer;

		public long Offset;

		public long Size;
	}
	public enum ReadStatus
	{
		Complete,
		InProgress,
		Failed
	}
	public struct ReadHandle : IDisposable
	{
		[NativeDisableUnsafePtrRestriction]
		internal IntPtr ptr;

		internal int version;

		public JobHandle JobHandle
		{
			get
			{
				if (!IsReadHandleValid(this))
				{
					throw new InvalidOperationException("ReadHandle.JobHandle cannot be called after the ReadHandle has been disposed");
				}
				return GetJobHandle(this);
			}
		}

		public ReadStatus Status
		{
			get
			{
				if (!IsReadHandleValid(this))
				{
					throw new InvalidOperationException("ReadHandle.Status cannot be called after the ReadHandle has been disposed");
				}
				return GetReadStatus(this);
			}
		}

		public bool IsValid()
		{
			return IsReadHandleValid(this);
		}

		public void Dispose()
		{
			if (!IsReadHandleValid(this))
			{
				throw new InvalidOperationException("ReadHandle.Dispose cannot be called twice on the same ReadHandle");
			}
			if (Status == ReadStatus.InProgress)
			{
				throw new InvalidOperationException("ReadHandle.Dispose cannot be called until the read operation completes");
			}
			ReleaseReadHandle(this);
		}

		[ThreadAndSerializationSafe]
		[FreeFunction("AsyncReadManagerManaged::GetReadStatus", IsThreadSafe = true)]
		private static ReadStatus GetReadStatus(ReadHandle handle)
		{
			return GetReadStatus_Injected(ref handle);
		}

		[ThreadAndSerializationSafe]
		[FreeFunction("AsyncReadManagerManaged::ReleaseReadHandle", IsThreadSafe = true)]
		private static void ReleaseReadHandle(ReadHandle handle)
		{
			ReleaseReadHandle_Injected(ref handle);
		}

		[ThreadAndSerializationSafe]
		[FreeFunction("AsyncReadManagerManaged::IsReadHandleValid", IsThreadSafe = true)]
		private static bool IsReadHandleValid(ReadHandle handle)
		{
			return IsReadHandleValid_Injected(ref handle);
		}

		[ThreadAndSerializationSafe]
		[FreeFunction("AsyncReadManagerManaged::GetJobHandle", IsThreadSafe = true)]
		private static JobHandle GetJobHandle(ReadHandle handle)
		{
			GetJobHandle_Injected(ref handle, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern ReadStatus GetReadStatus_Injected(ref ReadHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void ReleaseReadHandle_Injected(ref ReadHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool IsReadHandleValid_Injected(ref ReadHandle handle);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetJobHandle_Injected(ref ReadHandle handle, out JobHandle ret);
	}
	[NativeHeader("Runtime/File/AsyncReadManagerManagedApi.h")]
	public static class AsyncReadManager
	{
		[ThreadAndSerializationSafe]
		[FreeFunction("AsyncReadManagerManaged::Read", IsThreadSafe = true)]
		private unsafe static ReadHandle ReadInternal(string filename, void* cmds, uint cmdCount)
		{
			ReadInternal_Injected(filename, cmds, cmdCount, out var ret);
			return ret;
		}

		public unsafe static ReadHandle Read(string filename, ReadCommand* readCmds, uint readCmdCount)
		{
			return ReadInternal(filename, readCmds, readCmdCount);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private unsafe static extern void ReadInternal_Injected(string filename, void* cmds, uint cmdCount, out ReadHandle ret);
	}
}
namespace AOT
{
	[AttributeUsage(AttributeTargets.Method)]
	public class MonoPInvokeCallbackAttribute : Attribute
	{
		public MonoPInvokeCallbackAttribute(Type type)
		{
		}
	}
}
namespace UnityEngine
{
	internal class AttributeHelperEngine
	{
		[RequiredByNativeCode]
		private static Type GetParentTypeDisallowingMultipleInclusion(Type type)
		{
			Type result = null;
			while ((object)type != null && (object)type != typeof(MonoBehaviour))
			{
				if (Attribute.IsDefined(type, typeof(DisallowMultipleComponent)))
				{
					result = type;
				}
				type = type.BaseType;
			}
			return result;
		}

		[RequiredByNativeCode]
		private static Type[] GetRequiredComponents(Type klass)
		{
			List<Type> list = null;
			while ((object)klass != null && (object)klass != typeof(MonoBehaviour))
			{
				RequireComponent[] array = (RequireComponent[])klass.GetCustomAttributes(typeof(RequireComponent), inherit: false);
				Type baseType = klass.BaseType;
				RequireComponent[] array2 = array;
				foreach (RequireComponent requireComponent in array2)
				{
					if (list == null && array.Length == 1 && (object)baseType == typeof(MonoBehaviour))
					{
						return new Type[3] { requireComponent.m_Type0, requireComponent.m_Type1, requireComponent.m_Type2 };
					}
					if (list == null)
					{
						list = new List<Type>();
					}
					if ((object)requireComponent.m_Type0 != null)
					{
						list.Add(requireComponent.m_Type0);
					}
					if ((object)requireComponent.m_Type1 != null)
					{
						list.Add(requireComponent.m_Type1);
					}
					if ((object)requireComponent.m_Type2 != null)
					{
						list.Add(requireComponent.m_Type2);
					}
				}
				klass = baseType;
			}
			return list?.ToArray();
		}

		private static int GetExecuteMode(Type klass)
		{
			object[] customAttributes = klass.GetCustomAttributes(typeof(ExecuteAlways), inherit: false);
			if (customAttributes.Length != 0)
			{
				return 2;
			}
			object[] customAttributes2 = klass.GetCustomAttributes(typeof(ExecuteInEditMode), inherit: false);
			if (customAttributes2.Length != 0)
			{
				return 1;
			}
			return 0;
		}

		[RequiredByNativeCode]
		private static int CheckIsEditorScript(Type klass)
		{
			while ((object)klass != null && (object)klass != typeof(MonoBehaviour))
			{
				int executeMode = GetExecuteMode(klass);
				if (executeMode > 0)
				{
					return executeMode;
				}
				klass = klass.BaseType;
			}
			return 0;
		}

		[RequiredByNativeCode]
		private static int GetDefaultExecutionOrderFor(Type klass)
		{
			return GetCustomAttributeOfType<DefaultExecutionOrder>(klass)?.order ?? 0;
		}

		private static T GetCustomAttributeOfType<T>(Type klass) where T : Attribute
		{
			Type typeFromHandle = typeof(T);
			object[] customAttributes = klass.GetCustomAttributes(typeFromHandle, inherit: true);
			if (customAttributes != null && customAttributes.Length != 0)
			{
				return (T)customAttributes[0];
			}
			return (T)null;
		}
	}
	[AttributeUsage(AttributeTargets.Class, Inherited = false)]
	public sealed class DisallowMultipleComponent : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
	public sealed class RequireComponent : Attribute
	{
		public Type m_Type0;

		public Type m_Type1;

		public Type m_Type2;

		public RequireComponent(Type requiredComponent)
		{
			m_Type0 = requiredComponent;
		}

		public RequireComponent(Type requiredComponent, Type requiredComponent2)
		{
			m_Type0 = requiredComponent;
			m_Type1 = requiredComponent2;
		}

		public RequireComponent(Type requiredComponent, Type requiredComponent2, Type requiredComponent3)
		{
			m_Type0 = requiredComponent;
			m_Type1 = requiredComponent2;
			m_Type2 = requiredComponent3;
		}
	}
	public sealed class AddComponentMenu : Attribute
	{
		private string m_AddComponentMenu;

		private int m_Ordering;

		public string componentMenu => m_AddComponentMenu;

		public int componentOrder => m_Ordering;

		public AddComponentMenu(string menuName)
		{
			m_AddComponentMenu = menuName;
			m_Ordering = 0;
		}

		public AddComponentMenu(string menuName, int order)
		{
			m_AddComponentMenu = menuName;
			m_Ordering = order;
		}
	}
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
	public sealed class CreateAssetMenuAttribute : Attribute
	{
		public string menuName { get; set; }

		public string fileName { get; set; }

		public int order { get; set; }
	}
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
	[RequiredByNativeCode]
	public sealed class ContextMenu : Attribute
	{
		public readonly string menuItem;

		public readonly bool validate;

		public readonly int priority;

		public ContextMenu(string itemName)
			: this(itemName, isValidateFunction: false)
		{
		}

		public ContextMenu(string itemName, bool isValidateFunction)
			: this(itemName, isValidateFunction, 1000000)
		{
		}

		public ContextMenu(string itemName, bool isValidateFunction, int priority)
		{
			menuItem = itemName;
			validate = isValidateFunction;
			this.priority = priority;
		}
	}
	[UsedByNativeCode]
	public sealed class ExecuteInEditMode : Attribute
	{
	}
	[UsedByNativeCode]
	public sealed class ExecuteAlways : Attribute
	{
	}
	[UsedByNativeCode]
	public sealed class HideInInspector : Attribute
	{
	}
	[UsedByNativeCode]
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
	public sealed class HelpURLAttribute : Attribute
	{
		internal readonly string m_Url;

		public string URL => m_Url;

		public HelpURLAttribute(string url)
		{
			m_Url = url;
		}
	}
	[UsedByNativeCode]
	[AttributeUsage(AttributeTargets.Class)]
	public class DefaultExecutionOrder : Attribute
	{
		public int order { get; private set; }

		public DefaultExecutionOrder(int order)
		{
			this.order = order;
		}
	}
	[RequiredByNativeCode]
	[AttributeUsage(AttributeTargets.Assembly)]
	public class AssemblyIsEditorAssembly : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class, Inherited = false)]
	[UsedByNativeCode]
	public class ExcludeFromPresetAttribute : Attribute
	{
	}
	public enum AudioType
	{
		UNKNOWN = 0,
		ACC = 1,
		AIFF = 2,
		IT = 10,
		MOD = 12,
		MPEG = 13,
		OGGVORBIS = 14,
		S3M = 17,
		WAV = 20,
		XM = 21,
		XMA = 22,
		VAG = 23,
		AUDIOQUEUE = 24
	}
	public enum SendMessageOptions
	{
		RequireReceiver,
		DontRequireReceiver
	}
	public enum PrimitiveType
	{
		Sphere,
		Capsule,
		Cylinder,
		Cube,
		Plane,
		Quad
	}
	public enum Space
	{
		World,
		Self
	}
	public enum RuntimePlatform
	{
		OSXEditor = 0,
		OSXPlayer = 1,
		WindowsPlayer = 2,
		[Obsolete("WebPlayer export is no longer supported in Unity 5.4+.", true)]
		OSXWebPlayer = 3,
		[Obsolete("Dashboard widget on Mac OS X export is no longer supported in Unity 5.4+.", true)]
		OSXDashboardPlayer = 4,
		[Obsolete("WebPlayer export is no longer supported in Unity 5.4+.", true)]
		WindowsWebPlayer = 5,
		WindowsEditor = 7,
		IPhonePlayer = 8,
		[Obsolete("Xbox360 export is no longer supported in Unity 5.5+.")]
		XBOX360 = 10,
		[Obsolete("PS3 export is no longer supported in Unity >=5.5.")]
		PS3 = 9,
		Android = 11,
		[Obsolete("NaCl export is no longer supported in Unity 5.0+.")]
		NaCl = 12,
		[Obsolete("FlashPlayer export is no longer supported in Unity 5.0+.")]
		FlashPlayer = 15,
		LinuxPlayer = 13,
		LinuxEditor = 16,
		WebGLPlayer = 17,
		[Obsolete("Use WSAPlayerX86 instead")]
		MetroPlayerX86 = 18,
		WSAPlayerX86 = 18,
		[Obsolete("Use WSAPlayerX64 instead")]
		MetroPlayerX64 = 19,
		WSAPlayerX64 = 19,
		[Obsolete("Use WSAPlayerARM instead")]
		MetroPlayerARM = 20,
		WSAPlayerARM = 20,
		[Obsolete("Windows Phone 8 was removed in 5.3")]
		WP8Player = 21,
		[Obsolete("BlackBerryPlayer export is no longer supported in Unity 5.4+.")]
		BlackBerryPlayer = 22,
		[Obsolete("TizenPlayer export is no longer supported in Unity 2017.3+.")]
		TizenPlayer = 23,
		[Obsolete("PSP2 is no longer supported as of Unity 2018.3")]
		PSP2 = 24,
		PS4 = 25,
		[Obsolete("PSM export is no longer supported in Unity >= 5.3")]
		PSM = 26,
		XboxOne = 27,
		[Obsolete("SamsungTVPlayer export is no longer supported in Unity 2017.3+.")]
		SamsungTVPlayer = 28,
		[Obsolete("Wii U is no longer supported in Unity 2018.1+.")]
		WiiU = 30,
		tvOS = 31,
		Switch = 32,
		Lumin = 33
	}
	public enum SystemLanguage
	{
		Afrikaans = 0,
		Arabic = 1,
		Basque = 2,
		Belarusian = 3,
		Bulgarian = 4,
		Catalan = 5,
		Chinese = 6,
		Czech = 7,
		Danish = 8,
		Dutch = 9,
		English = 10,
		Estonian = 11,
		Faroese = 12,
		Finnish = 13,
		French = 14,
		German = 15,
		Greek = 16,
		Hebrew = 17,
		Icelandic = 19,
		Indonesian = 20,
		Italian = 21,
		Japanese = 22,
		Korean = 23,
		Latvian = 24,
		Lithuanian = 25,
		Norwegian = 26,
		Polish = 27,
		Portuguese = 28,
		Romanian = 29,
		Russian = 30,
		SerboCroatian = 31,
		Slovak = 32,
		Slovenian = 33,
		Spanish = 34,
		Swedish = 35,
		Thai = 36,
		Turkish = 37,
		Ukrainian = 38,
		Vietnamese = 39,
		ChineseSimplified = 40,
		ChineseTraditional = 41,
		Unknown = 42,
		Hungarian = 18
	}
	public enum LogType
	{
		Error,
		Assert,
		Warning,
		Log,
		Exception
	}
	public enum ThreadPriority
	{
		Low = 0,
		BelowNormal = 1,
		Normal = 2,
		High = 4
	}
	[AttributeUsage(AttributeTargets.Method)]
	public class BeforeRenderOrderAttribute : Attribute
	{
		public int order { get; private set; }

		public BeforeRenderOrderAttribute(int order)
		{
			this.order = order;
		}
	}
	internal static class BeforeRenderHelper
	{
		private struct OrderBlock
		{
			internal int order;

			internal UnityAction callback;
		}

		private static List<OrderBlock> s_OrderBlocks = new List<OrderBlock>();

		private static int GetUpdateOrder(UnityAction callback)
		{
			object[] customAttributes = callback.Method.GetCustomAttributes(typeof(BeforeRenderOrderAttribute), inherit: true);
			return ((customAttributes == null || customAttributes.Length <= 0) ? null : (customAttributes[0] as BeforeRenderOrderAttribute))?.order ?? 0;
		}

		public static void RegisterCallback(UnityAction callback)
		{
			int updateOrder = GetUpdateOrder(callback);
			lock (s_OrderBlocks)
			{
				int i;
				for (i = 0; i < s_OrderBlocks.Count && s_OrderBlocks[i].order <= updateOrder; i++)
				{
					if (s_OrderBlocks[i].order == updateOrder)
					{
						OrderBlock value = s_OrderBlocks[i];
						value.callback = (UnityAction)Delegate.Combine(value.callback, callback);
						s_OrderBlocks[i] = value;
						return;
					}
				}
				OrderBlock item = default(OrderBlock);
				item.order = updateOrder;
				item.callback = (UnityAction)Delegate.Combine(item.callback, callback);
				s_OrderBlocks.Insert(i, item);
			}
		}

		public static void UnregisterCallback(UnityAction callback)
		{
			int updateOrder = GetUpdateOrder(callback);
			lock (s_OrderBlocks)
			{
				for (int i = 0; i < s_OrderBlocks.Count && s_OrderBlocks[i].order <= updateOrder; i++)
				{
					if (s_OrderBlocks[i].order == updateOrder)
					{
						OrderBlock value = s_OrderBlocks[i];
						value.callback = (UnityAction)Delegate.Remove(value.callback, callback);
						s_OrderBlocks[i] = value;
						if (value.callback == null)
						{
							s_OrderBlocks.RemoveAt(i);
						}
						break;
					}
				}
			}
		}

		public static void Invoke()
		{
			lock (s_OrderBlocks)
			{
				for (int i = 0; i < s_OrderBlocks.Count; i++)
				{
					s_OrderBlocks[i].callback?.Invoke();
				}
			}
		}
	}
	[UsedByNativeCode]
	[NativeHeader("Runtime/Mono/MonoBehaviour.h")]
	public class Behaviour : Component
	{
		[RequiredByNativeCode]
		[NativeProperty]
		public extern bool enabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		[NativeProperty]
		public extern bool isActiveAndEnabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("IsAddedToManager")]
			get;
		}
	}
	[NativeHeader("Runtime/Export/BillboardRenderer.bindings.h")]
	[NativeHeader("Runtime/Graphics/Billboard/BillboardAsset.h")]
	public sealed class BillboardAsset : Object
	{
		public extern float width
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float height
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float bottom
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern int imageCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetNumImages")]
			get;
		}

		public extern int vertexCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetNumVertices")]
			get;
		}

		public extern int indexCount
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeMethod("GetNumIndices")]
			get;
		}

		public extern Material material
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public BillboardAsset()
		{
			Internal_Create(this);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::Internal_Create")]
		private static extern void Internal_Create([Writable] BillboardAsset obj);

		public void GetImageTexCoords(List<Vector4> imageTexCoords)
		{
			if (imageTexCoords == null)
			{
				throw new ArgumentNullException("imageTexCoords");
			}
			GetImageTexCoordsInternal(imageTexCoords);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetBillboardDataReadonly().GetImageTexCoords")]
		public extern Vector4[] GetImageTexCoords();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::GetImageTexCoordsInternal", HasExplicitThis = true)]
		internal extern void GetImageTexCoordsInternal(object list);

		public void SetImageTexCoords(List<Vector4> imageTexCoords)
		{
			if (imageTexCoords == null)
			{
				throw new ArgumentNullException("imageTexCoords");
			}
			SetImageTexCoordsInternalList(imageTexCoords);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::SetImageTexCoords", HasExplicitThis = true)]
		public extern void SetImageTexCoords([NotNull] Vector4[] imageTexCoords);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::SetImageTexCoordsInternalList", HasExplicitThis = true)]
		internal extern void SetImageTexCoordsInternalList(object list);

		public void GetVertices(List<Vector2> vertices)
		{
			if (vertices == null)
			{
				throw new ArgumentNullException("vertices");
			}
			GetVerticesInternal(vertices);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetBillboardDataReadonly().GetVertices")]
		public extern Vector2[] GetVertices();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::GetVerticesInternal", HasExplicitThis = true)]
		internal extern void GetVerticesInternal(object list);

		public void SetVertices(List<Vector2> vertices)
		{
			if (vertices == null)
			{
				throw new ArgumentNullException("vertices");
			}
			SetVerticesInternalList(vertices);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::SetVertices", HasExplicitThis = true)]
		public extern void SetVertices([NotNull] Vector2[] vertices);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::SetVerticesInternalList", HasExplicitThis = true)]
		internal extern void SetVerticesInternalList(object list);

		public void GetIndices(List<ushort> indices)
		{
			if (indices == null)
			{
				throw new ArgumentNullException("indices");
			}
			GetIndicesInternal(indices);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("GetBillboardDataReadonly().GetIndices")]
		public extern ushort[] GetIndices();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::GetIndicesInternal", HasExplicitThis = true)]
		internal extern void GetIndicesInternal(object list);

		public void SetIndices(List<ushort> indices)
		{
			if (indices == null)
			{
				throw new ArgumentNullException("indices");
			}
			SetIndicesInternalList(indices);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::SetIndices", HasExplicitThis = true)]
		public extern void SetIndices([NotNull] ushort[] indices);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::SetIndicesInternalList", HasExplicitThis = true)]
		internal extern void SetIndicesInternalList(object list);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[FreeFunction(Name = "BillboardRenderer_Bindings::MakeMaterialProperties", HasExplicitThis = true)]
		internal extern void MakeMaterialProperties(MaterialPropertyBlock properties, Camera camera);
	}
	[NativeHeader("Runtime/Graphics/Billboard/BillboardRenderer.h")]
	public sealed class BillboardRenderer : Renderer
	{
		public extern BillboardAsset billboard
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}
	}
	[NativeHeader("Runtime/Export/BootConfig.bindings.h")]
	internal class BootConfigData
	{
		private IntPtr m_Ptr;

		private BootConfigData(IntPtr nativeHandle)
		{
			if (nativeHandle == IntPtr.Zero)
			{
				throw new ArgumentException("native handle can not be null");
			}
			m_Ptr = nativeHandle;
		}

		public void AddKey(string key)
		{
			Append(key, null);
		}

		public string Get(string key)
		{
			return GetValue(key, 0);
		}

		public string Get(string key, int index)
		{
			return GetValue(key, index);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Append(string key, string value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void Set(string key, string value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern string GetValue(string key, int index);

		[RequiredByNativeCode]
		private static BootConfigData WrapBootConfigData(IntPtr nativeHandle)
		{
			return new BootConfigData(nativeHandle);
		}
	}
	[NativeHeader("Runtime/Geometry/AABB.h")]
	[NativeType(Header = "Runtime/Geometry/AABB.h")]
	[NativeHeader("Runtime/Geometry/Ray.h")]
	[ThreadAndSerializationSafe]
	[NativeHeader("Runtime/Geometry/Intersection.h")]
	[NativeHeader("Runtime/Math/MathScripting.h")]
	[NativeClass("AABB")]
	[RequiredByNativeCode(Optional = true, GenerateProxy = true)]
	public struct Bounds : IEquatable<Bounds>
	{
		private Vector3 m_Center;

		[NativeName("m_Extent")]
		private Vector3 m_Extents;

		public Vector3 center
		{
			get
			{
				return m_Center;
			}
			set
			{
				m_Center = value;
			}
		}

		public Vector3 size
		{
			get
			{
				return m_Extents * 2f;
			}
			set
			{
				m_Extents = value * 0.5f;
			}
		}

		public Vector3 extents
		{
			get
			{
				return m_Extents;
			}
			set
			{
				m_Extents = value;
			}
		}

		public Vector3 min
		{
			get
			{
				return center - extents;
			}
			set
			{
				SetMinMax(value, max);
			}
		}

		public Vector3 max
		{
			get
			{
				return center + extents;
			}
			set
			{
				SetMinMax(min, value);
			}
		}

		public Bounds(Vector3 center, Vector3 size)
		{
			m_Center = center;
			m_Extents = size * 0.5f;
		}

		public override int GetHashCode()
		{
			return center.GetHashCode() ^ (extents.GetHashCode() << 2);
		}

		public override bool Equals(object other)
		{
			if (!(other is Bounds))
			{
				return false;
			}
			return Equals((Bounds)other);
		}

		public bool Equals(Bounds other)
		{
			return center.Equals(other.center) && extents.Equals(other.extents);
		}

		public static bool operator ==(Bounds lhs, Bounds rhs)
		{
			return lhs.center == rhs.center && lhs.extents == rhs.extents;
		}

		public static bool operator !=(Bounds lhs, Bounds rhs)
		{
			return !(lhs == rhs);
		}

		public void SetMinMax(Vector3 min, Vector3 max)
		{
			extents = (max - min) * 0.5f;
			center = min + extents;
		}

		public void Encapsulate(Vector3 point)
		{
			SetMinMax(Vector3.Min(min, point), Vector3.Max(max, point));
		}

		public void Encapsulate(Bounds bounds)
		{
			Encapsulate(bounds.center - bounds.extents);
			Encapsulate(bounds.center + bounds.extents);
		}

		public void Expand(float amount)
		{
			amount *= 0.5f;
			extents += new Vector3(amount, amount, amount);
		}

		public void Expand(Vector3 amount)
		{
			extents += amount * 0.5f;
		}

		public bool Intersects(Bounds bounds)
		{
			return min.x <= bounds.max.x && max.x >= bounds.min.x && min.y <= bounds.max.y && max.y >= bounds.min.y && min.z <= bounds.max.z && max.z >= bounds.min.z;
		}

		public bool IntersectRay(Ray ray)
		{
			float dist;
			return IntersectRayAABB(ray, this, out dist);
		}

		public bool IntersectRay(Ray ray, out float distance)
		{
			return IntersectRayAABB(ray, this, out distance);
		}

		public override string ToString()
		{
			return UnityString.Format("Center: {0}, Extents: {1}", new object[2] { m_Center, m_Extents });
		}

		public string ToString(string format)
		{
			return UnityString.Format("Center: {0}, Extents: {1}", new object[2]
			{
				m_Center.ToString(format),
				m_Extents.ToString(format)
			});
		}

		[NativeMethod("IsInside", IsThreadSafe = true)]
		public bool Contains(Vector3 point)
		{
			return Contains_Injected(ref this, ref point);
		}

		[FreeFunction("BoundsScripting::SqrDistance", HasExplicitThis = true, IsThreadSafe = true)]
		public float SqrDistance(Vector3 point)
		{
			return SqrDistance_Injected(ref this, ref point);
		}

		[FreeFunction("IntersectRayAABB", IsThreadSafe = true)]
		private static bool IntersectRayAABB(Ray ray, Bounds bounds, out float dist)
		{
			return IntersectRayAABB_Injected(ref ray, ref bounds, out dist);
		}

		[FreeFunction("BoundsScripting::ClosestPoint", HasExplicitThis = true, IsThreadSafe = true)]
		public Vector3 ClosestPoint(Vector3 point)
		{
			ClosestPoint_Injected(ref this, ref point, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Contains_Injected(ref Bounds _unity_self, ref Vector3 point);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern float SqrDistance_Injected(ref Bounds _unity_self, ref Vector3 point);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool IntersectRayAABB_Injected(ref Ray ray, ref Bounds bounds, out float dist);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void ClosestPoint_Injected(ref Bounds _unity_self, ref Vector3 point, out Vector3 ret);
	}
	[UsedByNativeCode]
	public struct BoundsInt : IEquatable<BoundsInt>
	{
		public struct PositionEnumerator : IEnumerator<Vector3Int>, IEnumerator, IDisposable
		{
			private readonly Vector3Int _min;

			private readonly Vector3Int _max;

			private Vector3Int _current;

			object IEnumerator.Current => Current;

			public Vector3Int Current => _current;

			public PositionEnumerator(Vector3Int min, Vector3Int max)
			{
				_min = (_current = min);
				_max = max;
				Reset();
			}

			public PositionEnumerator GetEnumerator()
			{
				return this;
			}

			public bool MoveNext()
			{
				if (_current.z >= _max.z)
				{
					return false;
				}
				_current.x++;
				if (_current.x >= _max.x)
				{
					_current.x = _min.x;
					_current.y++;
					if (_current.y >= _max.y)
					{
						_current.y = _min.y;
						_current.z++;
						if (_current.z >= _max.z)
						{
							return false;
						}
					}
				}
				return true;
			}

			public void Reset()
			{
				_current = _min;
				_current.x--;
			}

			void IDisposable.Dispose()
			{
			}
		}

		private Vector3Int m_Position;

		private Vector3Int m_Size;

		public int x
		{
			get
			{
				return m_Position.x;
			}
			set
			{
				m_Position.x = value;
			}
		}

		public int y
		{
			get
			{
				return m_Position.y;
			}
			set
			{
				m_Position.y = value;
			}
		}

		public int z
		{
			get
			{
				return m_Position.z;
			}
			set
			{
				m_Position.z = value;
			}
		}

		public Vector3 center => new Vector3((float)x + (float)m_Size.x / 2f, (float)y + (float)m_Size.y / 2f, (float)z + (float)m_Size.z / 2f);

		public Vector3Int min
		{
			get
			{
				return new Vector3Int(xMin, yMin, zMin);
			}
			set
			{
				xMin = value.x;
				yMin = value.y;
				zMin = value.z;
			}
		}

		public Vector3Int max
		{
			get
			{
				return new Vector3Int(xMax, yMax, zMax);
			}
			set
			{
				xMax = value.x;
				yMax = value.y;
				zMax = value.z;
			}
		}

		public int xMin
		{
			get
			{
				return Math.Min(m_Position.x, m_Position.x + m_Size.x);
			}
			set
			{
				int num = xMax;
				m_Position.x = value;
				m_Size.x = num - m_Position.x;
			}
		}

		public int yMin
		{
			get
			{
				return Math.Min(m_Position.y, m_Position.y + m_Size.y);
			}
			set
			{
				int num = yMax;
				m_Position.y = value;
				m_Size.y = num - m_Position.y;
			}
		}

		public int zMin
		{
			get
			{
				return Math.Min(m_Position.z, m_Position.z + m_Size.z);
			}
			set
			{
				int num = zMax;
				m_Position.z = value;
				m_Size.z = num - m_Position.z;
			}
		}

		public int xMax
		{
			get
			{
				return Math.Max(m_Position.x, m_Position.x + m_Size.x);
			}
			set
			{
				m_Size.x = value - m_Position.x;
			}
		}

		public int yMax
		{
			get
			{
				return Math.Max(m_Position.y, m_Position.y + m_Size.y);
			}
			set
			{
				m_Size.y = value - m_Position.y;
			}
		}

		public int zMax
		{
			get
			{
				return Math.Max(m_Position.z, m_Position.z + m_Size.z);
			}
			set
			{
				m_Size.z = value - m_Position.z;
			}
		}

		public Vector3Int position
		{
			get
			{
				return m_Position;
			}
			set
			{
				m_Position = value;
			}
		}

		public Vector3Int size
		{
			get
			{
				return m_Size;
			}
			set
			{
				m_Size = value;
			}
		}

		public PositionEnumerator allPositionsWithin => new PositionEnumerator(min, max);

		public BoundsInt(int xMin, int yMin, int zMin, int sizeX, int sizeY, int sizeZ)
		{
			m_Position = new Vector3Int(xMin, yMin, zMin);
			m_Size = new Vector3Int(sizeX, sizeY, sizeZ);
		}

		public BoundsInt(Vector3Int position, Vector3Int size)
		{
			m_Position = position;
			m_Size = size;
		}

		public void SetMinMax(Vector3Int minPosition, Vector3Int maxPosition)
		{
			min = minPosition;
			max = maxPosition;
		}

		public void ClampToBounds(BoundsInt bounds)
		{
			position = new Vector3Int(Math.Max(Math.Min(bounds.xMax, position.x), bounds.xMin), Math.Max(Math.Min(bounds.yMax, position.y), bounds.yMin), Math.Max(Math.Min(bounds.zMax, position.z), bounds.zMin));
			size = new Vector3Int(Math.Min(bounds.xMax - position.x, size.x), Math.Min(bounds.yMax - position.y, size.y), Math.Min(bounds.zMax - position.z, size.z));
		}

		public bool Contains(Vector3Int position)
		{
			return position.x >= xMin && position.y >= yMin && position.z >= zMin && position.x < xMax && position.y < yMax && position.z < zMax;
		}

		public override string ToString()
		{
			return UnityString.Format("Position: {0}, Size: {1}", new object[2] { m_Position, m_Size });
		}

		public static bool operator ==(BoundsInt lhs, BoundsInt rhs)
		{
			return lhs.m_Position == rhs.m_Position && lhs.m_Size == rhs.m_Size;
		}

		public static bool operator !=(BoundsInt lhs, BoundsInt rhs)
		{
			return !(lhs == rhs);
		}

		public override bool Equals(object other)
		{
			if (!(other is BoundsInt))
			{
				return false;
			}
			return Equals((BoundsInt)other);
		}

		public bool

BestMod/bin/Debug/UnityEngine.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using AOT;
using JetBrains.Annotations;
using Unity.Burst;
using Unity.Burst.LowLevel;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.IO.LowLevel.Unsafe;
using Unity.Jobs;
using Unity.Jobs.LowLevel.Unsafe;
using Unity.Profiling;
using UnityEditor.Experimental;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Accessibility;
using UnityEngine.Advertisements;
using UnityEngine.Analytics;
using UnityEngine.Android;
using UnityEngine.Animations;
using UnityEngine.Assertions;
using UnityEngine.Assertions.Comparers;
using UnityEngine.Assertions.Must;
using UnityEngine.Audio;
using UnityEngine.Bindings;
using UnityEngine.Connect;
using UnityEngine.CrashReportHandler;
using UnityEngine.Diagnostics;
using UnityEngine.Events;
using UnityEngine.Experimental;
using UnityEngine.Experimental.AI;
using UnityEngine.Experimental.Animations;
using UnityEngine.Experimental.AssetBundlePatching;
using UnityEngine.Experimental.Audio;
using UnityEngine.Experimental.GlobalIllumination;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Experimental.Networking.PlayerConnection;
using UnityEngine.Experimental.Playables;
using UnityEngine.Experimental.PlayerLoop;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.TerrainAPI;
using UnityEngine.Experimental.U2D;
using UnityEngine.Experimental.UIElements;
using UnityEngine.Experimental.UIElements.StyleEnums;
using UnityEngine.Experimental.UIElements.StyleSheets;
using UnityEngine.Experimental.VFX;
using UnityEngine.Experimental.Video;
using UnityEngine.Experimental.XR;
using UnityEngine.Internal;
using UnityEngine.Internal.Experimental.UIElements;
using UnityEngine.Internal.VR;
using UnityEngine.Jobs;
using UnityEngine.Networking;
using UnityEngine.Networking.Match;
using UnityEngine.Networking.PlayerConnection;
using UnityEngine.Networking.Types;
using UnityEngine.Playables;
using UnityEngine.Profiling;
using UnityEngine.Profiling.Memory.Experimental;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.Scripting;
using UnityEngine.Scripting.APIUpdating;
using UnityEngine.Serialization;
using UnityEngine.SocialPlatforms;
using UnityEngine.SocialPlatforms.Impl;
using UnityEngine.Sprites;
using UnityEngine.StyleSheets;
using UnityEngine.TextCore;
using UnityEngine.TextCore.LowLevel;
using UnityEngine.Tilemaps;
using UnityEngine.U2D;
using UnityEngine.UIR;
using UnityEngine.Video;
using UnityEngine.Windows;
using UnityEngine.Windows.Speech;
using UnityEngine.XR;
using UnityEngine.XR.Tango;
using UnityEngine.XR.WSA;
using UnityEngine.Yoga;
using UnityEngineInternal;
using UnityEngineInternal.Input;
using UnityEngineInternal.Video;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: TypeForwardedTo(typeof(UsedByNativeCodeAttribute))]
[assembly: TypeForwardedTo(typeof(RequiredByNativeCodeAttribute))]
[assembly: TypeForwardedTo(typeof(GeneratedByOldBindingsGeneratorAttribute))]
[assembly: TypeForwardedTo(typeof(AssetFileNameExtensionAttribute))]
[assembly: TypeForwardedTo(typeof(ThreadAndSerializationSafeAttribute))]
[assembly: TypeForwardedTo(typeof(IL2CPPStructAlignmentAttribute))]
[assembly: TypeForwardedTo(typeof(WritableAttribute))]
[assembly: TypeForwardedTo(typeof(RejectDragAndDropMaterial))]
[assembly: TypeForwardedTo(typeof(UnityEngineModuleAssembly))]
[assembly: TypeForwardedTo(typeof(NativeClassAttribute))]
[assembly: TypeForwardedTo(typeof(VisibleToOtherModulesAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsNameProviderAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsHeaderProviderAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsIsThreadSafeProviderAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsIsFreeFunctionProviderAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsThrowsProviderAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsGenerateMarshallingTypeAttribute))]
[assembly: TypeForwardedTo(typeof(IBindingsWritableSelfProviderAttribute))]
[assembly: TypeForwardedTo(typeof(NativeConditionalAttribute))]
[assembly: TypeForwardedTo(typeof(NativeHeaderAttribute))]
[assembly: TypeForwardedTo(typeof(NativeNameAttribute))]
[assembly: TypeForwardedTo(typeof(NativeWritableSelfAttribute))]
[assembly: TypeForwardedTo(typeof(NativeMethodAttribute))]
[assembly: TypeForwardedTo(typeof(TargetType))]
[assembly: TypeForwardedTo(typeof(NativePropertyAttribute))]
[assembly: TypeForwardedTo(typeof(CodegenOptions))]
[assembly: TypeForwardedTo(typeof(NativeAsStructAttribute))]
[assembly: TypeForwardedTo(typeof(NativeTypeAttribute))]
[assembly: TypeForwardedTo(typeof(NotNullAttribute))]
[assembly: TypeForwardedTo(typeof(UnmarshalledAttribute))]
[assembly: TypeForwardedTo(typeof(FreeFunctionAttribute))]
[assembly: TypeForwardedTo(typeof(ThreadSafeAttribute))]
[assembly: TypeForwardedTo(typeof(StaticAccessorType))]
[assembly: TypeForwardedTo(typeof(StaticAccessorAttribute))]
[assembly: TypeForwardedTo(typeof(NativeThrowsAttribute))]
[assembly: TypeForwardedTo(typeof(IgnoreAttribute))]
[assembly: TypeForwardedTo(typeof(MarshalUnityObjectAs))]
[assembly: TypeForwardedTo(typeof(UnityString))]
[assembly: TypeForwardedTo(typeof(AndroidJavaObject))]
[assembly: TypeForwardedTo(typeof(AndroidJavaClass))]
[assembly: TypeForwardedTo(typeof(AndroidJavaRunnable))]
[assembly: TypeForwardedTo(typeof(AndroidJavaException))]
[assembly: TypeForwardedTo(typeof(AndroidJavaProxy))]
[assembly: TypeForwardedTo(typeof(jvalue))]
[assembly: TypeForwardedTo(typeof(AndroidJNIHelper))]
[assembly: TypeForwardedTo(typeof(AndroidJNI))]
[assembly: TypeForwardedTo(typeof(Permission))]
[assembly: TypeForwardedTo(typeof(WeightedMode))]
[assembly: TypeForwardedTo(typeof(Keyframe))]
[assembly: TypeForwardedTo(typeof(WrapMode))]
[assembly: TypeForwardedTo(typeof(AnimationCurve))]
[assembly: TypeForwardedTo(typeof(Application))]
[assembly: TypeForwardedTo(typeof(StackTraceLogType))]
[assembly: TypeForwardedTo(typeof(NetworkReachability))]
[assembly: TypeForwardedTo(typeof(UserAuthorization))]
[assembly: TypeForwardedTo(typeof(ApplicationInstallMode))]
[assembly: TypeForwardedTo(typeof(ApplicationSandboxType))]
[assembly: TypeForwardedTo(typeof(ArrayUtils))]
[assembly: TypeForwardedTo(typeof(AsyncGPUReadbackRequest))]
[assembly: TypeForwardedTo(typeof(AsyncGPUReadback))]
[assembly: TypeForwardedTo(typeof(AsyncOperation))]
[assembly: TypeForwardedTo(typeof(ReadCommand))]
[assembly: TypeForwardedTo(typeof(ReadStatus))]
[assembly: TypeForwardedTo(typeof(ReadHandle))]
[assembly: TypeForwardedTo(typeof(AsyncReadManager))]
[assembly: TypeForwardedTo(typeof(MonoPInvokeCallbackAttribute))]
[assembly: TypeForwardedTo(typeof(AttributeHelperEngine))]
[assembly: TypeForwardedTo(typeof(DisallowMultipleComponent))]
[assembly: TypeForwardedTo(typeof(RequireComponent))]
[assembly: TypeForwardedTo(typeof(AddComponentMenu))]
[assembly: TypeForwardedTo(typeof(CreateAssetMenuAttribute))]
[assembly: TypeForwardedTo(typeof(ContextMenu))]
[assembly: TypeForwardedTo(typeof(ExecuteInEditMode))]
[assembly: TypeForwardedTo(typeof(ExecuteAlways))]
[assembly: TypeForwardedTo(typeof(HideInInspector))]
[assembly: TypeForwardedTo(typeof(HelpURLAttribute))]
[assembly: TypeForwardedTo(typeof(DefaultExecutionOrder))]
[assembly: TypeForwardedTo(typeof(AssemblyIsEditorAssembly))]
[assembly: TypeForwardedTo(typeof(ExcludeFromPresetAttribute))]
[assembly: TypeForwardedTo(typeof(AudioType))]
[assembly: TypeForwardedTo(typeof(SendMessageOptions))]
[assembly: TypeForwardedTo(typeof(PrimitiveType))]
[assembly: TypeForwardedTo(typeof(Space))]
[assembly: TypeForwardedTo(typeof(RuntimePlatform))]
[assembly: TypeForwardedTo(typeof(SystemLanguage))]
[assembly: TypeForwardedTo(typeof(LogType))]
[assembly: TypeForwardedTo(typeof(ThreadPriority))]
[assembly: TypeForwardedTo(typeof(BeforeRenderOrderAttribute))]
[assembly: TypeForwardedTo(typeof(BeforeRenderHelper))]
[assembly: TypeForwardedTo(typeof(Behaviour))]
[assembly: TypeForwardedTo(typeof(BillboardAsset))]
[assembly: TypeForwardedTo(typeof(BillboardRenderer))]
[assembly: TypeForwardedTo(typeof(BootConfigData))]
[assembly: TypeForwardedTo(typeof(Bounds))]
[assembly: TypeForwardedTo(typeof(BoundsInt))]
[assembly: TypeForwardedTo(typeof(CachedAssetBundle))]
[assembly: TypeForwardedTo(typeof(Cache))]
[assembly: TypeForwardedTo(typeof(CacheIndex))]
[assembly: TypeForwardedTo(typeof(Caching))]
[assembly: TypeForwardedTo(typeof(Camera))]
[assembly: TypeForwardedTo(typeof(CastHelper<>))]
[assembly: TypeForwardedTo(typeof(ClassLibraryInitializer))]
[assembly: TypeForwardedTo(typeof(LowerResBlitTexture))]
[assembly: TypeForwardedTo(typeof(PreloadData))]
[assembly: TypeForwardedTo(typeof(Color))]
[assembly: TypeForwardedTo(typeof(Color32))]
[assembly: TypeForwardedTo(typeof(ColorUtility))]
[assembly: TypeForwardedTo(typeof(Component))]
[assembly: TypeForwardedTo(typeof(ComputeBuffer))]
[assembly: TypeForwardedTo(typeof(Coroutine))]
[assembly: TypeForwardedTo(typeof(SetupCoroutine))]
[assembly: TypeForwardedTo(typeof(CrashReport))]
[assembly: TypeForwardedTo(typeof(BoundingSphere))]
[assembly: TypeForwardedTo(typeof(CullingQueryOptions))]
[assembly: TypeForwardedTo(typeof(CullingGroupEvent))]
[assembly: TypeForwardedTo(typeof(CullingGroup))]
[assembly: TypeForwardedTo(typeof(CursorMode))]
[assembly: TypeForwardedTo(typeof(CursorLockMode))]
[assembly: TypeForwardedTo(typeof(Cursor))]
[assembly: TypeForwardedTo(typeof(CustomYieldInstruction))]
[assembly: TypeForwardedTo(typeof(DebugLogHandler))]
[assembly: TypeForwardedTo(typeof(Debug))]
[assembly: TypeForwardedTo(typeof(DiagnosticSwitchFlags))]
[assembly: TypeForwardedTo(typeof(DiagnosticSwitch))]
[assembly: TypeForwardedTo(typeof(Display))]
[assembly: TypeForwardedTo(typeof(DrivenPropertyManager))]
[assembly: TypeForwardedTo(typeof(EnumInfo))]
[assembly: TypeForwardedTo(typeof(ExcludeFromObjectFactoryAttribute))]
[assembly: TypeForwardedTo(typeof(ExposedPropertyResolver))]
[assembly: TypeForwardedTo(typeof(ExposedReference<>))]
[assembly: TypeForwardedTo(typeof(FailedToLoadScriptObject))]
[assembly: TypeForwardedTo(typeof(FlareLayer))]
[assembly: TypeForwardedTo(typeof(GameObject))]
[assembly: TypeForwardedTo(typeof(GeometryUtility))]
[assembly: TypeForwardedTo(typeof(Gizmos))]
[assembly: TypeForwardedTo(typeof(SynchronisationStage))]
[assembly: TypeForwardedTo(typeof(GPUFence))]
[assembly: TypeForwardedTo(typeof(GradientColorKey))]
[assembly: TypeForwardedTo(typeof(GradientAlphaKey))]
[assembly: TypeForwardedTo(typeof(GradientMode))]
[assembly: TypeForwardedTo(typeof(Gradient))]
[assembly: TypeForwardedTo(typeof(EnabledOrientation))]
[assembly: TypeForwardedTo(typeof(FullScreenMode))]
[assembly: TypeForwardedTo(typeof(SleepTimeout))]
[assembly: TypeForwardedTo(typeof(Screen))]
[assembly: TypeForwardedTo(typeof(RenderBuffer))]
[assembly: TypeForwardedTo(typeof(MemorylessMode))]
[assembly: TypeForwardedTo(typeof(MemorylessManager))]
[assembly: TypeForwardedTo(typeof(Graphics))]
[assembly: TypeForwardedTo(typeof(GL))]
[assembly: TypeForwardedTo(typeof(ScalableBufferManager))]
[assembly: TypeForwardedTo(typeof(FrameTiming))]
[assembly: TypeForwardedTo(typeof(FrameTimingManager))]
[assembly: TypeForwardedTo(typeof(LightmapData))]
[assembly: TypeForwardedTo(typeof(LightmapSettings))]
[assembly: TypeForwardedTo(typeof(LightProbes))]
[assembly: TypeForwardedTo(typeof(WaitForPresentSyncPoint))]
[assembly: TypeForwardedTo(typeof(GraphicsJobsSyncPoint))]
[assembly: TypeForwardedTo(typeof(GraphicsDeviceSettings))]
[assembly: TypeForwardedTo(typeof(Resolution))]
[assembly: TypeForwardedTo(typeof(RenderTargetSetup))]
[assembly: TypeForwardedTo(typeof(Internal_DrawTextureArguments))]
[assembly: TypeForwardedTo(typeof(QualitySettings))]
[assembly: TypeForwardedTo(typeof(RendererExtensions))]
[assembly: TypeForwardedTo(typeof(ImageEffectTransformsToLDR))]
[assembly: TypeForwardedTo(typeof(ImageEffectAllowedInSceneView))]
[assembly: TypeForwardedTo(typeof(ImageEffectOpaque))]
[assembly: TypeForwardedTo(typeof(ImageEffectAfterScale))]
[assembly: TypeForwardedTo(typeof(LightmapsModeLegacy))]
[assembly: TypeForwardedTo(typeof(TrailRenderer))]
[assembly: TypeForwardedTo(typeof(LineRenderer))]
[assembly: TypeForwardedTo(typeof(MaterialPropertyBlock))]
[assembly: TypeForwardedTo(typeof(Renderer))]
[assembly: TypeForwardedTo(typeof(RenderSettings))]
[assembly: TypeForwardedTo(typeof(Shader))]
[assembly: TypeForwardedTo(typeof(Material))]
[assembly: TypeForwardedTo(typeof(ShaderHardwareTier))]
[assembly: TypeForwardedTo(typeof(OcclusionPortal))]
[assembly: TypeForwardedTo(typeof(OcclusionArea))]
[assembly: TypeForwardedTo(typeof(Flare))]
[assembly: TypeForwardedTo(typeof(LensFlare))]
[assembly: TypeForwardedTo(typeof(Projector))]
[assembly: TypeForwardedTo(typeof(LightBakingOutput))]
[assembly: TypeForwardedTo(typeof(LightShadowCasterMode))]
[assembly: TypeForwardedTo(typeof(Light))]
[assembly: TypeForwardedTo(typeof(Skybox))]
[assembly: TypeForwardedTo(typeof(MeshFilter))]
[assembly: TypeForwardedTo(typeof(Halo))]
[assembly: TypeForwardedTo(typeof(RenderingPath))]
[assembly: TypeForwardedTo(typeof(TransparencySortMode))]
[assembly: TypeForwardedTo(typeof(StereoTargetEyeMask))]
[assembly: TypeForwardedTo(typeof(CameraType))]
[assembly: TypeForwardedTo(typeof(ComputeBufferType))]
[assembly: TypeForwardedTo(typeof(LightType))]
[assembly: TypeForwardedTo(typeof(LightRenderMode))]
[assembly: TypeForwardedTo(typeof(LightShadows))]
[assembly: TypeForwardedTo(typeof(FogMode))]
[assembly: TypeForwardedTo(typeof(LightmapBakeType))]
[assembly: TypeForwardedTo(typeof(MixedLightingMode))]
[assembly: TypeForwardedTo(typeof(QualityLevel))]
[assembly: TypeForwardedTo(typeof(ShadowProjection))]
[assembly: TypeForwardedTo(typeof(ShadowQuality))]
[assembly: TypeForwardedTo(typeof(ShadowResolution))]
[assembly: TypeForwardedTo(typeof(ShadowmaskMode))]
[assembly: TypeForwardedTo(typeof(CameraClearFlags))]
[assembly: TypeForwardedTo(typeof(DepthTextureMode))]
[assembly: TypeForwardedTo(typeof(TexGenMode))]
[assembly: TypeForwardedTo(typeof(AnisotropicFiltering))]
[assembly: TypeForwardedTo(typeof(BlendWeights))]
[assembly: TypeForwardedTo(typeof(MeshTopology))]
[assembly: TypeForwardedTo(typeof(SkinQuality))]
[assembly: TypeForwardedTo(typeof(ColorSpace))]
[assembly: TypeForwardedTo(typeof(ColorGamut))]
[assembly: TypeForwardedTo(typeof(ScreenOrientation))]
[assembly: TypeForwardedTo(typeof(FilterMode))]
[assembly: TypeForwardedTo(typeof(TextureWrapMode))]
[assembly: TypeForwardedTo(typeof(NPOTSupport))]
[assembly: TypeForwardedTo(typeof(TextureFormat))]
[assembly: TypeForwardedTo(typeof(CubemapFace))]
[assembly: TypeForwardedTo(typeof(RenderTextureFormat))]
[assembly: TypeForwardedTo(typeof(VRTextureUsage))]
[assembly: TypeForwardedTo(typeof(RenderTextureCreationFlags))]
[assembly: TypeForwardedTo(typeof(RenderTextureReadWrite))]
[assembly: TypeForwardedTo(typeof(RenderTextureMemoryless))]
[assembly: TypeForwardedTo(typeof(TextureCreationFlags))]
[assembly: TypeForwardedTo(typeof(FormatUsage))]
[assembly: TypeForwardedTo(typeof(GraphicsFormat))]
[assembly: TypeForwardedTo(typeof(LightmapsMode))]
[assembly: TypeForwardedTo(typeof(MaterialGlobalIlluminationFlags))]
[assembly: TypeForwardedTo(typeof(LightProbeProxyVolume))]
[assembly: TypeForwardedTo(typeof(CustomRenderTextureInitializationSource))]
[assembly: TypeForwardedTo(typeof(CustomRenderTextureUpdateMode))]
[assembly: TypeForwardedTo(typeof(CustomRenderTextureUpdateZoneSpace))]
[assembly: TypeForwardedTo(typeof(MotionVectorGenerationMode))]
[assembly: TypeForwardedTo(typeof(LineTextureMode))]
[assembly: TypeForwardedTo(typeof(LineAlignment))]
[assembly: TypeForwardedTo(typeof(IndexFormat))]
[assembly: TypeForwardedTo(typeof(VertexAttribute))]
[assembly: TypeForwardedTo(typeof(OpaqueSortMode))]
[assembly: TypeForwardedTo(typeof(RenderQueue))]
[assembly: TypeForwardedTo(typeof(RenderBufferLoadAction))]
[assembly: TypeForwardedTo(typeof(RenderBufferStoreAction))]
[assembly: TypeForwardedTo(typeof(BlendMode))]
[assembly: TypeForwardedTo(typeof(BlendOp))]
[assembly: TypeForwardedTo(typeof(CompareFunction))]
[assembly: TypeForwardedTo(typeof(CullMode))]
[assembly: TypeForwardedTo(typeof(ColorWriteMask))]
[assembly: TypeForwardedTo(typeof(StencilOp))]
[assembly: TypeForwardedTo(typeof(AmbientMode))]
[assembly: TypeForwardedTo(typeof(DefaultReflectionMode))]
[assembly: TypeForwardedTo(typeof(ReflectionCubemapCompression))]
[assembly: TypeForwardedTo(typeof(CameraEvent))]
[assembly: TypeForwardedTo(typeof(CameraEventUtils))]
[assembly: TypeForwardedTo(typeof(LightEvent))]
[assembly: TypeForwardedTo(typeof(ShadowMapPass))]
[assembly: TypeForwardedTo(typeof(BuiltinRenderTextureType))]
[assembly: TypeForwardedTo(typeof(PassType))]
[assembly: TypeForwardedTo(typeof(ShadowCastingMode))]
[assembly: TypeForwardedTo(typeof(LightShadowResolution))]
[assembly: TypeForwardedTo(typeof(GraphicsDeviceType))]
[assembly: TypeForwardedTo(typeof(GraphicsTier))]
[assembly: TypeForwardedTo(typeof(RenderTargetIdentifier))]
[assembly: TypeForwardedTo(typeof(RenderTargetBinding))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeUsage))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeType))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeClearFlags))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeMode))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeBlendInfo))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeRefreshMode))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeTimeSlicingMode))]
[assembly: TypeForwardedTo(typeof(ShadowSamplingMode))]
[assembly: TypeForwardedTo(typeof(LightProbeUsage))]
[assembly: TypeForwardedTo(typeof(BuiltinShaderType))]
[assembly: TypeForwardedTo(typeof(BuiltinShaderMode))]
[assembly: TypeForwardedTo(typeof(BuiltinShaderDefine))]
[assembly: TypeForwardedTo(typeof(TextureDimension))]
[assembly: TypeForwardedTo(typeof(CopyTextureSupport))]
[assembly: TypeForwardedTo(typeof(CameraHDRMode))]
[assembly: TypeForwardedTo(typeof(RealtimeGICPUUsage))]
[assembly: TypeForwardedTo(typeof(ComputeQueueType))]
[assembly: TypeForwardedTo(typeof(LightmapType))]
[assembly: TypeForwardedTo(typeof(GraphicsFormatUtility))]
[assembly: TypeForwardedTo(typeof(RenderSettings))]
[assembly: TypeForwardedTo(typeof(SkinnedMeshRenderer))]
[assembly: TypeForwardedTo(typeof(MeshRenderer))]
[assembly: TypeForwardedTo(typeof(GraphicsSettings))]
[assembly: TypeForwardedTo(typeof(RectOffset))]
[assembly: TypeForwardedTo(typeof(GUIElement))]
[assembly: TypeForwardedTo(typeof(GUITexture))]
[assembly: TypeForwardedTo(typeof(GUILayer))]
[assembly: TypeForwardedTo(typeof(TouchScreenKeyboard))]
[assembly: TypeForwardedTo(typeof(Hash128))]
[assembly: TypeForwardedTo(typeof(HashUtilities))]
[assembly: TypeForwardedTo(typeof(HashUnsafeUtilities))]
[assembly: TypeForwardedTo(typeof(IExposedPropertyTable))]
[assembly: TypeForwardedTo(typeof(TouchPhase))]
[assembly: TypeForwardedTo(typeof(IMECompositionMode))]
[assembly: TypeForwardedTo(typeof(TouchType))]
[assembly: TypeForwardedTo(typeof(Touch))]
[assembly: TypeForwardedTo(typeof(DeviceOrientation))]
[assembly: TypeForwardedTo(typeof(AccelerationEvent))]
[assembly: TypeForwardedTo(typeof(Gyroscope))]
[assembly: TypeForwardedTo(typeof(LocationInfo))]
[assembly: TypeForwardedTo(typeof(LocationServiceStatus))]
[assembly: TypeForwardedTo(typeof(LocationService))]
[assembly: TypeForwardedTo(typeof(Compass))]
[assembly: TypeForwardedTo(typeof(Input))]
[assembly: TypeForwardedTo(typeof(CanBeNullAttribute))]
[assembly: TypeForwardedTo(typeof(NotNullAttribute))]
[assembly: TypeForwardedTo(typeof(ItemNotNullAttribute))]
[assembly: TypeForwardedTo(typeof(ItemCanBeNullAttribute))]
[assembly: TypeForwardedTo(typeof(StringFormatMethodAttribute))]
[assembly: TypeForwardedTo(typeof(ValueProviderAttribute))]
[assembly: TypeForwardedTo(typeof(InvokerParameterNameAttribute))]
[assembly: TypeForwardedTo(typeof(NotifyPropertyChangedInvocatorAttribute))]
[assembly: TypeForwardedTo(typeof(ContractAnnotationAttribute))]
[assembly: TypeForwardedTo(typeof(LocalizationRequiredAttribute))]
[assembly: TypeForwardedTo(typeof(CannotApplyEqualityOperatorAttribute))]
[assembly: TypeForwardedTo(typeof(BaseTypeRequiredAttribute))]
[assembly: TypeForwardedTo(typeof(UsedImplicitlyAttribute))]
[assembly: TypeForwardedTo(typeof(MeansImplicitUseAttribute))]
[assembly: TypeForwardedTo(typeof(ImplicitUseKindFlags))]
[assembly: TypeForwardedTo(typeof(ImplicitUseTargetFlags))]
[assembly: TypeForwardedTo(typeof(PublicAPIAttribute))]
[assembly: TypeForwardedTo(typeof(InstantHandleAttribute))]
[assembly: TypeForwardedTo(typeof(PureAttribute))]
[assembly: TypeForwardedTo(typeof(MustUseReturnValueAttribute))]
[assembly: TypeForwardedTo(typeof(ProvidesContextAttribute))]
[assembly: TypeForwardedTo(typeof(PathReferenceAttribute))]
[assembly: TypeForwardedTo(typeof(SourceTemplateAttribute))]
[assembly: TypeForwardedTo(typeof(MacroAttribute))]
[assembly: TypeForwardedTo(typeof(CollectionAccessAttribute))]
[assembly: TypeForwardedTo(typeof(CollectionAccessType))]
[assembly: TypeForwardedTo(typeof(AssertionMethodAttribute))]
[assembly: TypeForwardedTo(typeof(AssertionConditionAttribute))]
[assembly: TypeForwardedTo(typeof(AssertionConditionType))]
[assembly: TypeForwardedTo(typeof(TerminatesProgramAttribute))]
[assembly: TypeForwardedTo(typeof(LinqTunnelAttribute))]
[assembly: TypeForwardedTo(typeof(NoEnumerationAttribute))]
[assembly: TypeForwardedTo(typeof(RegexPatternAttribute))]
[assembly: TypeForwardedTo(typeof(NoReorderAttribute))]
[assembly: TypeForwardedTo(typeof(KeyCode))]
[assembly: TypeForwardedTo(typeof(LayerMask))]
[assembly: TypeForwardedTo(typeof(LightProbeGroup))]
[assembly: TypeForwardedTo(typeof(LineUtility))]
[assembly: TypeForwardedTo(typeof(LODFadeMode))]
[assembly: TypeForwardedTo(typeof(LOD))]
[assembly: TypeForwardedTo(typeof(LODGroup))]
[assembly: TypeForwardedTo(typeof(ManagedStreamHelpers))]
[assembly: TypeForwardedTo(typeof(FrustumPlanes))]
[assembly: TypeForwardedTo(typeof(Matrix4x4))]
[assembly: TypeForwardedTo(typeof(Vector3))]
[assembly: TypeForwardedTo(typeof(Quaternion))]
[assembly: TypeForwardedTo(typeof(Mathf))]
[assembly: TypeForwardedTo(typeof(MathfInternal))]
[assembly: TypeForwardedTo(typeof(Mesh))]
[assembly: TypeForwardedTo(typeof(StaticBatchingHelper))]
[assembly: TypeForwardedTo(typeof(BoneWeight))]
[assembly: TypeForwardedTo(typeof(CombineInstance))]
[assembly: TypeForwardedTo(typeof(FastCallExceptionHandler))]
[assembly: TypeForwardedTo(typeof(GetMethodDelegate))]
[assembly: TypeForwardedTo(typeof(ScriptingUtils))]
[assembly: TypeForwardedTo(typeof(MonoBehaviour))]
[assembly: TypeForwardedTo(typeof(SendMouseEvents))]
[assembly: TypeForwardedTo(typeof(NoAllocHelpers))]
[assembly: TypeForwardedTo(typeof(Ping))]
[assembly: TypeForwardedTo(typeof(Plane))]
[assembly: TypeForwardedTo(typeof(PlatformKeywordSet))]
[assembly: TypeForwardedTo(typeof(PlayerConnection))]
[assembly: TypeForwardedTo(typeof(IPlayerEditorConnectionNative))]
[assembly: TypeForwardedTo(typeof(PlayerConnectionInternal))]
[assembly: TypeForwardedTo(typeof(Initialization))]
[assembly: TypeForwardedTo(typeof(EarlyUpdate))]
[assembly: TypeForwardedTo(typeof(FixedUpdate))]
[assembly: TypeForwardedTo(typeof(PreUpdate))]
[assembly: TypeForwardedTo(typeof(Update))]
[assembly: TypeForwardedTo(typeof(PreLateUpdate))]
[assembly: TypeForwardedTo(typeof(PostLateUpdate))]
[assembly: TypeForwardedTo(typeof(PlayerLoopSystemInternal))]
[assembly: TypeForwardedTo(typeof(PlayerLoopSystem))]
[assembly: TypeForwardedTo(typeof(PlayerLoop))]
[assembly: TypeForwardedTo(typeof(PlayerPrefsException))]
[assembly: TypeForwardedTo(typeof(PlayerPrefs))]
[assembly: TypeForwardedTo(typeof(Pose))]
[assembly: TypeForwardedTo(typeof(PropertyAttribute))]
[assembly: TypeForwardedTo(typeof(ContextMenuItemAttribute))]
[assembly: TypeForwardedTo(typeof(InspectorNameAttribute))]
[assembly: TypeForwardedTo(typeof(TooltipAttribute))]
[assembly: TypeForwardedTo(typeof(SpaceAttribute))]
[assembly: TypeForwardedTo(typeof(HeaderAttribute))]
[assembly: TypeForwardedTo(typeof(RangeAttribute))]
[assembly: TypeForwardedTo(typeof(MinAttribute))]
[assembly: TypeForwardedTo(typeof(MultilineAttribute))]
[assembly: TypeForwardedTo(typeof(TextAreaAttribute))]
[assembly: TypeForwardedTo(typeof(ColorUsageAttribute))]
[assembly: TypeForwardedTo(typeof(GradientUsageAttribute))]
[assembly: TypeForwardedTo(typeof(DelayedAttribute))]
[assembly: TypeForwardedTo(typeof(PropertyNameUtils))]
[assembly: TypeForwardedTo(typeof(PropertyName))]
[assembly: TypeForwardedTo(typeof(Random))]
[assembly: TypeForwardedTo(typeof(RangeInt))]
[assembly: TypeForwardedTo(typeof(Ray))]
[assembly: TypeForwardedTo(typeof(Ray2D))]
[assembly: TypeForwardedTo(typeof(Rect))]
[assembly: TypeForwardedTo(typeof(RectInt))]
[assembly: TypeForwardedTo(typeof(ReflectionProbe))]
[assembly: TypeForwardedTo(typeof(CommandBuffer))]
[assembly: TypeForwardedTo(typeof(ResourceRequest))]
[assembly: TypeForwardedTo(typeof(Resources))]
[assembly: TypeForwardedTo(typeof(RuntimeInitializeLoadType))]
[assembly: TypeForwardedTo(typeof(RuntimeInitializeOnLoadMethodAttribute))]
[assembly: TypeForwardedTo(typeof(ScriptableObject))]
[assembly: TypeForwardedTo(typeof(ScriptableRenderContext))]
[assembly: TypeForwardedTo(typeof(ScrollWaitDefinitions))]
[assembly: TypeForwardedTo(typeof(Security))]
[assembly: TypeForwardedTo(typeof(Types))]
[assembly: TypeForwardedTo(typeof(SelectionBaseAttribute))]
[assembly: TypeForwardedTo(typeof(SerializePrivateVariables))]
[assembly: TypeForwardedTo(typeof(SerializeField))]
[assembly: TypeForwardedTo(typeof(PreferBinarySerialization))]
[assembly: TypeForwardedTo(typeof(ISerializationCallbackReceiver))]
[assembly: TypeForwardedTo(typeof(DisableBatchingType))]
[assembly: TypeForwardedTo(typeof(ShaderVariantCollection))]
[assembly: TypeForwardedTo(typeof(ComputeShader))]
[assembly: TypeForwardedTo(typeof(ShaderKeywordType))]
[assembly: TypeForwardedTo(typeof(ShaderKeyword))]
[assembly: TypeForwardedTo(typeof(ShaderKeywordSet))]
[assembly: TypeForwardedTo(typeof(SortingLayer))]
[assembly: TypeForwardedTo(typeof(SphericalHarmonicsL2))]
[assembly: TypeForwardedTo(typeof(SplashScreen))]
[assembly: TypeForwardedTo(typeof(SpookyHash))]
[assembly: TypeForwardedTo(typeof(StackTraceUtility))]
[assembly: TypeForwardedTo(typeof(UnityException))]
[assembly: TypeForwardedTo(typeof(MissingComponentException))]
[assembly: TypeForwardedTo(typeof(UnassignedReferenceException))]
[assembly: TypeForwardedTo(typeof(MissingReferenceException))]
[assembly: TypeForwardedTo(typeof(SystemClock))]
[assembly: TypeForwardedTo(typeof(BatteryStatus))]
[assembly: TypeForwardedTo(typeof(OperatingSystemFamily))]
[assembly: TypeForwardedTo(typeof(DeviceType))]
[assembly: TypeForwardedTo(typeof(SystemInfo))]
[assembly: TypeForwardedTo(typeof(TextAsset))]
[assembly: TypeForwardedTo(typeof(Texture))]
[assembly: TypeForwardedTo(typeof(Texture2D))]
[assembly: TypeForwardedTo(typeof(Cubemap))]
[assembly: TypeForwardedTo(typeof(Texture3D))]
[assembly: TypeForwardedTo(typeof(Texture2DArray))]
[assembly: TypeForwardedTo(typeof(CubemapArray))]
[assembly: TypeForwardedTo(typeof(SparseTexture))]
[assembly: TypeForwardedTo(typeof(RenderTexture))]
[assembly: TypeForwardedTo(typeof(CustomRenderTextureUpdateZone))]
[assembly: TypeForwardedTo(typeof(CustomRenderTexture))]
[assembly: TypeForwardedTo(typeof(RenderTextureDescriptor))]
[assembly: TypeForwardedTo(typeof(Time))]
[assembly: TypeForwardedTo(typeof(TouchScreenKeyboardType))]
[assembly: TypeForwardedTo(typeof(TrackedReference))]
[assembly: TypeForwardedTo(typeof(UnhandledExceptionHandler))]
[assembly: TypeForwardedTo(typeof(UnityAPICompatibilityVersionAttribute))]
[assembly: TypeForwardedTo(typeof(HideFlags))]
[assembly: TypeForwardedTo(typeof(Object))]
[assembly: TypeForwardedTo(typeof(PersistentListenerMode))]
[assembly: TypeForwardedTo(typeof(ArgumentCache))]
[assembly: TypeForwardedTo(typeof(BaseInvokableCall))]
[assembly: TypeForwardedTo(typeof(InvokableCall))]
[assembly: TypeForwardedTo(typeof(InvokableCall<>))]
[assembly: TypeForwardedTo(typeof(InvokableCall<, >))]
[assembly: TypeForwardedTo(typeof(InvokableCall<, , >))]
[assembly: TypeForwardedTo(typeof(InvokableCall<, , , >))]
[assembly: TypeForwardedTo(typeof(CachedInvokableCall<>))]
[assembly: TypeForwardedTo(typeof(UnityEventCallState))]
[assembly: TypeForwardedTo(typeof(PersistentCall))]
[assembly: TypeForwardedTo(typeof(PersistentCallGroup))]
[assembly: TypeForwardedTo(typeof(InvokableCallList))]
[assembly: TypeForwardedTo(typeof(UnityEventBase))]
[assembly: TypeForwardedTo(typeof(UnityEventQueueSystem))]
[assembly: TypeForwardedTo(typeof(UnityAction))]
[assembly: TypeForwardedTo(typeof(UnityEvent))]
[assembly: TypeForwardedTo(typeof(UnityAction<>))]
[assembly: TypeForwardedTo(typeof(UnityEvent<>))]
[assembly: TypeForwardedTo(typeof(UnityAction<, >))]
[assembly: TypeForwardedTo(typeof(UnityEvent<, >))]
[assembly: TypeForwardedTo(typeof(UnityAction<, , >))]
[assembly: TypeForwardedTo(typeof(UnityEvent<, , >))]
[assembly: TypeForwardedTo(typeof(UnityAction<, , , >))]
[assembly: TypeForwardedTo(typeof(UnityEvent<, , , >))]
[assembly: TypeForwardedTo(typeof(UnityLogWriter))]
[assembly: TypeForwardedTo(typeof(UnitySynchronizationContext))]
[assembly: TypeForwardedTo(typeof(Vector2))]
[assembly: TypeForwardedTo(typeof(Vector2Int))]
[assembly: TypeForwardedTo(typeof(Vector3Int))]
[assembly: TypeForwardedTo(typeof(Vector4))]
[assembly: TypeForwardedTo(typeof(WaitForEndOfFrame))]
[assembly: TypeForwardedTo(typeof(WaitForFixedUpdate))]
[assembly: TypeForwardedTo(typeof(WaitForSeconds))]
[assembly: TypeForwardedTo(typeof(WaitForSecondsRealtime))]
[assembly: TypeForwardedTo(typeof(WaitUntil))]
[assembly: TypeForwardedTo(typeof(WaitWhile))]
[assembly: TypeForwardedTo(typeof(YieldInstruction))]
[assembly: TypeForwardedTo(typeof(Assert))]
[assembly: TypeForwardedTo(typeof(AssertionException))]
[assembly: TypeForwardedTo(typeof(AssertionMessageUtil))]
[assembly: TypeForwardedTo(typeof(FloatComparer))]
[assembly: TypeForwardedTo(typeof(MustExtensions))]
[assembly: TypeForwardedTo(typeof(BurstCompilerService))]
[assembly: TypeForwardedTo(typeof(BurstDiscardAttribute))]
[assembly: TypeForwardedTo(typeof(BuiltinRuntimeReflectionSystem))]
[assembly: TypeForwardedTo(typeof(IScriptableRuntimeReflectionSystem))]
[assembly: TypeForwardedTo(typeof(ScriptableRuntimeReflectionSystem))]
[assembly: TypeForwardedTo(typeof(ScriptableRuntimeReflectionSystemSettings))]
[assembly: TypeForwardedTo(typeof(ScriptableRuntimeReflectionSystemWrapper))]
[assembly: TypeForwardedTo(typeof(ReadOnlyAttribute))]
[assembly: TypeForwardedTo(typeof(WriteOnlyAttribute))]
[assembly: TypeForwardedTo(typeof(DeallocateOnJobCompletionAttribute))]
[assembly: TypeForwardedTo(typeof(NativeFixedLengthAttribute))]
[assembly: TypeForwardedTo(typeof(NativeMatchesParallelForLengthAttribute))]
[assembly: TypeForwardedTo(typeof(NativeDisableParallelForRestrictionAttribute))]
[assembly: TypeForwardedTo(typeof(NativeContainerAttribute))]
[assembly: TypeForwardedTo(typeof(NativeContainerIsReadOnlyAttribute))]
[assembly: TypeForwardedTo(typeof(NativeContainerIsAtomicWriteOnlyAttribute))]
[assembly: TypeForwardedTo(typeof(NativeContainerSupportsMinMaxWriteRestrictionAttribute))]
[assembly: TypeForwardedTo(typeof(NativeContainerSupportsDeallocateOnJobCompletionAttribute))]
[assembly: TypeForwardedTo(typeof(NativeContainerSupportsDeferredConvertListToArray))]
[assembly: TypeForwardedTo(typeof(NativeSetThreadIndexAttribute))]
[assembly: TypeForwardedTo(typeof(NativeContainerNeedsThreadIndexAttribute))]
[assembly: TypeForwardedTo(typeof(WriteAccessRequiredAttribute))]
[assembly: TypeForwardedTo(typeof(NativeDisableUnsafePtrRestrictionAttribute))]
[assembly: TypeForwardedTo(typeof(NativeDisableContainerSafetyRestrictionAttribute))]
[assembly: TypeForwardedTo(typeof(NativeSetClassTypeToNullOnScheduleAttribute))]
[assembly: TypeForwardedTo(typeof(Allocator))]
[assembly: TypeForwardedTo(typeof(ForcedCrashCategory))]
[assembly: TypeForwardedTo(typeof(Utils))]
[assembly: TypeForwardedTo(typeof(CameraPlayable))]
[assembly: TypeForwardedTo(typeof(FrameData))]
[assembly: TypeForwardedTo(typeof(INotification))]
[assembly: TypeForwardedTo(typeof(INotificationReceiver))]
[assembly: TypeForwardedTo(typeof(IPlayable))]
[assembly: TypeForwardedTo(typeof(IPlayableBehaviour))]
[assembly: TypeForwardedTo(typeof(IPlayableOutput))]
[assembly: TypeForwardedTo(typeof(MaterialEffectPlayable))]
[assembly: TypeForwardedTo(typeof(Notification))]
[assembly: TypeForwardedTo(typeof(DirectorWrapMode))]
[assembly: TypeForwardedTo(typeof(Playable))]
[assembly: TypeForwardedTo(typeof(IPlayableAsset))]
[assembly: TypeForwardedTo(typeof(PlayableAsset))]
[assembly: TypeForwardedTo(typeof(PlayableBehaviour))]
[assembly: TypeForwardedTo(typeof(DataStreamType))]
[assembly: TypeForwardedTo(typeof(PlayableBinding))]
[assembly: TypeForwardedTo(typeof(PlayableTraversalMode))]
[assembly: TypeForwardedTo(typeof(PlayableExtensions))]
[assembly: TypeForwardedTo(typeof(DirectorUpdateMode))]
[assembly: TypeForwardedTo(typeof(PlayableGraph))]
[assembly: TypeForwardedTo(typeof(PlayState))]
[assembly: TypeForwardedTo(typeof(PlayableHandle))]
[assembly: TypeForwardedTo(typeof(PlayableOutput))]
[assembly: TypeForwardedTo(typeof(PlayableOutputExtensions))]
[assembly: TypeForwardedTo(typeof(PlayableOutputHandle))]
[assembly: TypeForwardedTo(typeof(ScriptPlayable<>))]
[assembly: TypeForwardedTo(typeof(ScriptPlayableBinding))]
[assembly: TypeForwardedTo(typeof(ScriptPlayableOutput))]
[assembly: TypeForwardedTo(typeof(TextureMixerPlayable))]
[assembly: TypeForwardedTo(typeof(TexturePlayableBinding))]
[assembly: TypeForwardedTo(typeof(TexturePlayableGraphExtensions))]
[assembly: TypeForwardedTo(typeof(TexturePlayableOutput))]
[assembly: TypeForwardedTo(typeof(DynamicGI))]
[assembly: TypeForwardedTo(typeof(GITextureType))]
[assembly: TypeForwardedTo(typeof(GIDebugVisualisation))]
[assembly: TypeForwardedTo(typeof(LightType))]
[assembly: TypeForwardedTo(typeof(LightMode))]
[assembly: TypeForwardedTo(typeof(FalloffType))]
[assembly: TypeForwardedTo(typeof(LinearColor))]
[assembly: TypeForwardedTo(typeof(DirectionalLight))]
[assembly: TypeForwardedTo(typeof(PointLight))]
[assembly: TypeForwardedTo(typeof(SpotLight))]
[assembly: TypeForwardedTo(typeof(RectangleLight))]
[assembly: TypeForwardedTo(typeof(DiscLight))]
[assembly: TypeForwardedTo(typeof(LightDataGI))]
[assembly: TypeForwardedTo(typeof(LightmapperUtils))]
[assembly: TypeForwardedTo(typeof(Lightmapping))]
[assembly: TypeForwardedTo(typeof(DefaultValueAttribute))]
[assembly: TypeForwardedTo(typeof(ExcludeFromDocsAttribute))]
[assembly: TypeForwardedTo(typeof(ISubAssetNotDuplicatable))]
[assembly: TypeForwardedTo(typeof(ILogger))]
[assembly: TypeForwardedTo(typeof(ILogHandler))]
[assembly: TypeForwardedTo(typeof(Logger))]
[assembly: TypeForwardedTo(typeof(NativeLeakDetectionMode))]
[assembly: TypeForwardedTo(typeof(NativeLeakDetection))]
[assembly: TypeForwardedTo(typeof(NativeArrayOptions))]
[assembly: TypeForwardedTo(typeof(NativeArray<>))]
[assembly: TypeForwardedTo(typeof(NativeArrayDebugView<>))]
[assembly: TypeForwardedTo(typeof(NativeArrayUnsafeUtility))]
[assembly: TypeForwardedTo(typeof(NativeSliceExtensions))]
[assembly: TypeForwardedTo(typeof(NativeSlice<>))]
[assembly: TypeForwardedTo(typeof(NativeSliceDebugView<>))]
[assembly: TypeForwardedTo(typeof(NativeSliceUnsafeUtility))]
[assembly: TypeForwardedTo(typeof(ConnectionTarget))]
[assembly: TypeForwardedTo(typeof(IConnectionState))]
[assembly: TypeForwardedTo(typeof(MessageEventArgs))]
[assembly: TypeForwardedTo(typeof(IEditorPlayerConnection))]
[assembly: TypeForwardedTo(typeof(PlayerConnection))]
[assembly: TypeForwardedTo(typeof(PlayerEditorConnectionEvents))]
[assembly: TypeForwardedTo(typeof(BlendState))]
[assembly: TypeForwardedTo(typeof(CoreCameraValues))]
[assembly: TypeForwardedTo(typeof(CameraProperties))]
[assembly: TypeForwardedTo(typeof(CullFlag))]
[assembly: TypeForwardedTo(typeof(ScriptableCullingParameters))]
[assembly: TypeForwardedTo(typeof(DepthState))]
[assembly: TypeForwardedTo(typeof(DrawRendererFlags))]
[assembly: TypeForwardedTo(typeof(DrawRendererSortMode))]
[assembly: TypeForwardedTo(typeof(DrawRendererSortSettings))]
[assembly: TypeForwardedTo(typeof(DrawShadowsSettings))]
[assembly: TypeForwardedTo(typeof(FilterRenderersSettings))]
[assembly: TypeForwardedTo(typeof(FilterResults))]
[assembly: TypeForwardedTo(typeof(IRenderPipeline))]
[assembly: TypeForwardedTo(typeof(IRenderPipelineAsset))]
[assembly: TypeForwardedTo(typeof(LODParameters))]
[assembly: TypeForwardedTo(typeof(RasterState))]
[assembly: TypeForwardedTo(typeof(ReflectionProbeSortOptions))]
[assembly: TypeForwardedTo(typeof(RendererConfiguration))]
[assembly: TypeForwardedTo(typeof(RenderPipeline))]
[assembly: TypeForwardedTo(typeof(RenderPipelineAsset))]
[assembly: TypeForwardedTo(typeof(RenderPipelineManager))]
[assembly: TypeForwardedTo(typeof(RenderQueueRange))]
[assembly: TypeForwardedTo(typeof(RenderStateBlock))]
[assembly: TypeForwardedTo(typeof(RenderStateMapping))]
[assembly: TypeForwardedTo(typeof(RenderStateMask))]
[assembly: TypeForwardedTo(typeof(RenderTargetBlendState))]
[assembly: TypeForwardedTo(typeof(ShadowSplitData))]
[assembly: TypeForwardedTo(typeof(SortFlags))]
[assembly: TypeForwardedTo(typeof(StencilState))]
[assembly: TypeForwardedTo(typeof(SupportedRenderingFeatures))]
[assembly: TypeForwardedTo(typeof(VisibleLightFlags))]
[assembly: TypeForwardedTo(typeof(Scene))]
[assembly: TypeForwardedTo(typeof(SceneManagerAPIInternal))]
[assembly: TypeForwardedTo(typeof(SceneManager))]
[assembly: TypeForwardedTo(typeof(LoadSceneMode))]
[assembly: TypeForwardedTo(typeof(LocalPhysicsMode))]
[assembly: TypeForwardedTo(typeof(LoadSceneParameters))]
[assembly: TypeForwardedTo(typeof(CreateSceneParameters))]
[assembly: TypeForwardedTo(typeof(UnloadSceneOptions))]
[assembly: TypeForwardedTo(typeof(SceneUtility))]
[assembly: TypeForwardedTo(typeof(RenderPass))]
[assembly: TypeForwardedTo(typeof(RenderPassAttachment))]
[assembly: TypeForwardedTo(typeof(ShaderPassName))]
[assembly: TypeForwardedTo(typeof(DrawRendererSettings))]
[assembly: TypeForwardedTo(typeof(VisibleLight))]
[assembly: TypeForwardedTo(typeof(VisibleReflectionProbe))]
[assembly: TypeForwardedTo(typeof(CullResults))]
[assembly: TypeForwardedTo(typeof(AlwaysLinkAssemblyAttribute))]
[assembly: TypeForwardedTo(typeof(ExtensionOfNativeClassAttribute))]
[assembly: TypeForwardedTo(typeof(GarbageCollector))]
[assembly: TypeForwardedTo(typeof(PreserveAttribute))]
[assembly: TypeForwardedTo(typeof(ScriptingRuntime))]
[assembly: TypeForwardedTo(typeof(MovedFromAttribute))]
[assembly: TypeForwardedTo(typeof(FormerlySerializedAsAttribute))]
[assembly: TypeForwardedTo(typeof(UnitySurrogateSelector))]
[assembly: TypeForwardedTo(typeof(ListSerializationSurrogate))]
[assembly: TypeForwardedTo(typeof(DictionarySerializationSurrogate<, >))]
[assembly: TypeForwardedTo(typeof(StaticBatchingUtility))]
[assembly: TypeForwardedTo(typeof(InternalStaticBatchingUtility))]
[assembly: TypeForwardedTo(typeof(MeshSubsetCombineUtility))]
[assembly: TypeForwardedTo(typeof(APIUpdaterRuntimeServices))]
[assembly: TypeForwardedTo(typeof(TypeInferenceRules))]
[assembly: TypeForwardedTo(typeof(TypeInferenceRuleAttribute))]
[assembly: TypeForwardedTo(typeof(GenericStack))]
[assembly: TypeForwardedTo(typeof(UnsafeUtility))]
[assembly: TypeForwardedTo(typeof(PhraseRecognitionSystem))]
[assembly: TypeForwardedTo(typeof(PhraseRecognizer))]
[assembly: TypeForwardedTo(typeof(DictationRecognizer))]
[assembly: TypeForwardedTo(typeof(ConfidenceLevel))]
[assembly: TypeForwardedTo(typeof(SpeechSystemStatus))]
[assembly: TypeForwardedTo(typeof(SpeechError))]
[assembly: TypeForwardedTo(typeof(DictationTopicConstraint))]
[assembly: TypeForwardedTo(typeof(DictationCompletionCause))]
[assembly: TypeForwardedTo(typeof(SemanticMeaning))]
[assembly: TypeForwardedTo(typeof(PhraseRecognizedEventArgs))]
[assembly: TypeForwardedTo(typeof(KeywordRecognizer))]
[assembly: TypeForwardedTo(typeof(GrammarRecognizer))]
[assembly: TypeForwardedTo(typeof(CrashReporting))]
[assembly: TypeForwardedTo(typeof(NetFxCoreExtensions))]
[assembly: TypeForwardedTo(typeof(BatchQueryJob<, >))]
[assembly: TypeForwardedTo(typeof(BatchQueryJobStruct<>))]
[assembly: TypeForwardedTo(typeof(IJob))]
[assembly: TypeForwardedTo(typeof(IJobExtensions))]
[assembly: TypeForwardedTo(typeof(IJobParallelFor))]
[assembly: TypeForwardedTo(typeof(IJobParallelForExtensions))]
[assembly: TypeForwardedTo(typeof(IJobParallelForTransform))]
[assembly: TypeForwardedTo(typeof(IJobParallelForTransformExtensions))]
[assembly: TypeForwardedTo(typeof(JobHandle))]
[assembly: TypeForwardedTo(typeof(JobHandleUnsafeUtility))]
[assembly: TypeForwardedTo(typeof(JobProducerTypeAttribute))]
[assembly: TypeForwardedTo(typeof(JobRanges))]
[assembly: TypeForwardedTo(typeof(ScheduleMode))]
[assembly: TypeForwardedTo(typeof(JobType))]
[assembly: TypeForwardedTo(typeof(JobsUtility))]
[assembly: TypeForwardedTo(typeof(CaptureFlags))]
[assembly: TypeForwardedTo(typeof(MetaData))]
[assembly: TypeForwardedTo(typeof(MemoryProfiler))]
[assembly: TypeForwardedTo(typeof(ProfilerArea))]
[assembly: TypeForwardedTo(typeof(Profiler))]
[assembly: TypeForwardedTo(typeof(MarkerFlags))]
[assembly: TypeForwardedTo(typeof(ProfilerMarker))]
[assembly: TypeForwardedTo(typeof(Recorder))]
[assembly: TypeForwardedTo(typeof(Sampler))]
[assembly: TypeForwardedTo(typeof(CustomSampler))]
[assembly: TypeForwardedTo(typeof(DrivenTransformProperties))]
[assembly: TypeForwardedTo(typeof(DrivenRectTransformTracker))]
[assembly: TypeForwardedTo(typeof(RectTransform))]
[assembly: TypeForwardedTo(typeof(RotationOrder))]
[assembly: TypeForwardedTo(typeof(Transform))]
[assembly: TypeForwardedTo(typeof(TransformAccess))]
[assembly: TypeForwardedTo(typeof(TransformAccessArray))]
[assembly: TypeForwardedTo(typeof(PixelPerfectRendering))]
[assembly: TypeForwardedTo(typeof(SpriteBone))]
[assembly: TypeForwardedTo(typeof(SpriteChannelInfo))]
[assembly: TypeForwardedTo(typeof(SpriteDataAccessExtensions))]
[assembly: TypeForwardedTo(typeof(SpriteRendererDataAccessExtensions))]
[assembly: TypeForwardedTo(typeof(DataUtility))]
[assembly: TypeForwardedTo(typeof(SpriteDrawMode))]
[assembly: TypeForwardedTo(typeof(SpriteTileMode))]
[assembly: TypeForwardedTo(typeof(SpriteMaskInteraction))]
[assembly: TypeForwardedTo(typeof(SpriteRenderer))]
[assembly: TypeForwardedTo(typeof(SpriteMeshType))]
[assembly: TypeForwardedTo(typeof(SpriteAlignment))]
[assembly: TypeForwardedTo(typeof(SpritePackingMode))]
[assembly: TypeForwardedTo(typeof(SpritePackingRotation))]
[assembly: TypeForwardedTo(typeof(SpriteSortPoint))]
[assembly: TypeForwardedTo(typeof(Sprite))]
[assembly: TypeForwardedTo(typeof(SortingGroup))]
[assembly: TypeForwardedTo(typeof(SpriteAtlasManager))]
[assembly: TypeForwardedTo(typeof(SpriteAtlas))]
[assembly: TypeForwardedTo(typeof(ParticleSystemEmissionType))]
[assembly: TypeForwardedTo(typeof(ParticleSystem))]
[assembly: TypeForwardedTo(typeof(ParticlePhysicsExtensions))]
[assembly: TypeForwardedTo(typeof(ParticleSystemVertexStreams))]
[assembly: TypeForwardedTo(typeof(ParticleSystemRenderer))]
[assembly: TypeForwardedTo(typeof(ParticleSystemRenderMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemSortMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemCollisionQuality))]
[assembly: TypeForwardedTo(typeof(ParticleSystemRenderSpace))]
[assembly: TypeForwardedTo(typeof(ParticleSystemCurveMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemGradientMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemShapeType))]
[assembly: TypeForwardedTo(typeof(ParticleSystemMeshShapeType))]
[assembly: TypeForwardedTo(typeof(ParticleSystemShapeTextureChannel))]
[assembly: TypeForwardedTo(typeof(ParticleSystemAnimationMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemAnimationTimeMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemAnimationType))]
[assembly: TypeForwardedTo(typeof(ParticleSystemCollisionType))]
[assembly: TypeForwardedTo(typeof(ParticleSystemCollisionMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemOverlapAction))]
[assembly: TypeForwardedTo(typeof(ParticleSystemSimulationSpace))]
[assembly: TypeForwardedTo(typeof(ParticleSystemStopBehavior))]
[assembly: TypeForwardedTo(typeof(ParticleSystemScalingMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemStopAction))]
[assembly: TypeForwardedTo(typeof(ParticleSystemCullingMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemEmitterVelocityMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemInheritVelocityMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemTriggerEventType))]
[assembly: TypeForwardedTo(typeof(ParticleSystemVertexStream))]
[assembly: TypeForwardedTo(typeof(ParticleSystemCustomData))]
[assembly: TypeForwardedTo(typeof(ParticleSystemCustomDataMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemNoiseQuality))]
[assembly: TypeForwardedTo(typeof(ParticleSystemSubEmitterType))]
[assembly: TypeForwardedTo(typeof(ParticleSystemSubEmitterProperties))]
[assembly: TypeForwardedTo(typeof(ParticleSystemTrailMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemTrailTextureMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemShapeMultiModeValue))]
[assembly: TypeForwardedTo(typeof(ParticleSystemRingBufferMode))]
[assembly: TypeForwardedTo(typeof(ParticleSystemGameObjectFilter))]
[assembly: TypeForwardedTo(typeof(ParticleSystemForceFieldShape))]
[assembly: TypeForwardedTo(typeof(UVChannelFlags))]
[assembly: TypeForwardedTo(typeof(ParticleSystemForceField))]
[assembly: TypeForwardedTo(typeof(ParticleCollisionEvent))]
[assembly: TypeForwardedTo(typeof(ParticleSystemExtensionsImpl))]
[assembly: TypeForwardedTo(typeof(RigidbodyConstraints))]
[assembly: TypeForwardedTo(typeof(ForceMode))]
[assembly: TypeForwardedTo(typeof(JointDriveMode))]
[assembly: TypeForwardedTo(typeof(JointProjectionMode))]
[assembly: TypeForwardedTo(typeof(MeshColliderCookingOptions))]
[assembly: TypeForwardedTo(typeof(WheelFrictionCurve))]
[assembly: TypeForwardedTo(typeof(SoftJointLimit))]
[assembly: TypeForwardedTo(typeof(SoftJointLimitSpring))]
[assembly: TypeForwardedTo(typeof(JointDrive))]
[assembly: TypeForwardedTo(typeof(RigidbodyInterpolation))]
[assembly: TypeForwardedTo(typeof(JointMotor))]
[assembly: TypeForwardedTo(typeof(JointSpring))]
[assembly: TypeForwardedTo(typeof(JointLimits))]
[assembly: TypeForwardedTo(typeof(ControllerColliderHit))]
[assembly: TypeForwardedTo(typeof(PhysicMaterialCombine))]
[assembly: TypeForwardedTo(typeof(Collision))]
[assembly: TypeForwardedTo(typeof(CollisionFlags))]
[assembly: TypeForwardedTo(typeof(QueryTriggerInteraction))]
[assembly: TypeForwardedTo(typeof(CollisionDetectionMode))]
[assembly: TypeForwardedTo(typeof(ConfigurableJointMotion))]
[assembly: TypeForwardedTo(typeof(RotationDriveMode))]
[assembly: TypeForwardedTo(typeof(PhysicMaterial))]
[assembly: TypeForwardedTo(typeof(RaycastHit))]
[assembly: TypeForwardedTo(typeof(Rigidbody))]
[assembly: TypeForwardedTo(typeof(Collider))]
[assembly: TypeForwardedTo(typeof(CharacterController))]
[assembly: TypeForwardedTo(typeof(MeshCollider))]
[assembly: TypeForwardedTo(typeof(CapsuleCollider))]
[assembly: TypeForwardedTo(typeof(BoxCollider))]
[assembly: TypeForwardedTo(typeof(SphereCollider))]
[assembly: TypeForwardedTo(typeof(ConstantForce))]
[assembly: TypeForwardedTo(typeof(Joint))]
[assembly: TypeForwardedTo(typeof(HingeJoint))]
[assembly: TypeForwardedTo(typeof(SpringJoint))]
[assembly: TypeForwardedTo(typeof(FixedJoint))]
[assembly: TypeForwardedTo(typeof(CharacterJoint))]
[assembly: TypeForwardedTo(typeof(ConfigurableJoint))]
[assembly: TypeForwardedTo(typeof(ContactPoint))]
[assembly: TypeForwardedTo(typeof(PhysicsScene))]
[assembly: TypeForwardedTo(typeof(PhysicsSceneExtensions))]
[assembly: TypeForwardedTo(typeof(Physics))]
[assembly: TypeForwardedTo(typeof(RaycastCommand))]
[assembly: TypeForwardedTo(typeof(SpherecastCommand))]
[assembly: TypeForwardedTo(typeof(CapsulecastCommand))]
[assembly: TypeForwardedTo(typeof(BoxcastCommand))]
[assembly: TypeForwardedTo(typeof(WheelHit))]
[assembly: TypeForwardedTo(typeof(WheelCollider))]
[assembly: TypeForwardedTo(typeof(Cloth))]
[assembly: TypeForwardedTo(typeof(ClothSkinningCoefficient))]
[assembly: TypeForwardedTo(typeof(ClothSphereColliderPair))]
[assembly: TypeForwardedTo(typeof(AnimationPlayableBinding))]
[assembly: TypeForwardedTo(typeof(AnimationPlayableUtilities))]
[assembly: TypeForwardedTo(typeof(IAnimationClipSource))]
[assembly: TypeForwardedTo(typeof(IAnimationJob))]
[assembly: TypeForwardedTo(typeof(IAnimationJobPlayable))]
[assembly: TypeForwardedTo(typeof(ProcessAnimationJobStruct<>))]
[assembly: TypeForwardedTo(typeof(SharedBetweenAnimatorsAttribute))]
[assembly: TypeForwardedTo(typeof(StateMachineBehaviour))]
[assembly: TypeForwardedTo(typeof(AimConstraint))]
[assembly: TypeForwardedTo(typeof(AnimationClip))]
[assembly: TypeForwardedTo(typeof(AnimationClipPlayable))]
[assembly: TypeForwardedTo(typeof(AnimationHumanStream))]
[assembly: TypeForwardedTo(typeof(AnimationLayerMixerPlayable))]
[assembly: TypeForwardedTo(typeof(AnimationMixerPlayable))]
[assembly: TypeForwardedTo(typeof(AnimationMotionXToDeltaPlayable))]
[assembly: TypeForwardedTo(typeof(AnimationOffsetPlayable))]
[assembly: TypeForwardedTo(typeof(AnimationPlayableExtensions))]
[assembly: TypeForwardedTo(typeof(AnimationPlayableGraphExtensions))]
[assembly: TypeForwardedTo(typeof(AnimationPlayableOutput))]
[assembly: TypeForwardedTo(typeof(AnimationPosePlayable))]
[assembly: TypeForwardedTo(typeof(AnimationRemoveScalePlayable))]
[assembly: TypeForwardedTo(typeof(AnimationScriptPlayable))]
[assembly: TypeForwardedTo(typeof(AnimatorBindingsVersion))]
[assembly: TypeForwardedTo(typeof(AnimationStream))]
[assembly: TypeForwardedTo(typeof(BindType))]
[assembly: TypeForwardedTo(typeof(TransformStreamHandle))]
[assembly: TypeForwardedTo(typeof(PropertyStreamHandle))]
[assembly: TypeForwardedTo(typeof(TransformSceneHandle))]
[assembly: TypeForwardedTo(typeof(PropertySceneHandle))]
[assembly: TypeForwardedTo(typeof(AvatarTarget))]
[assembly: TypeForwardedTo(typeof(AvatarIKGoal))]
[assembly: TypeForwardedTo(typeof(AvatarIKHint))]
[assembly: TypeForwardedTo(typeof(AnimatorControllerParameterType))]
[assembly: TypeForwardedTo(typeof(TransitionType))]
[assembly: TypeForwardedTo(typeof(StateInfoIndex))]
[assembly: TypeForwardedTo(typeof(AnimatorRecorderMode))]
[assembly: TypeForwardedTo(typeof(DurationUnit))]
[assembly: TypeForwardedTo(typeof(AnimatorCullingMode))]
[assembly: TypeForwardedTo(typeof(AnimatorUpdateMode))]
[assembly: TypeForwardedTo(typeof(AnimatorClipInfo))]
[assembly: TypeForwardedTo(typeof(AnimatorStateInfo))]
[assembly: TypeForwardedTo(typeof(AnimatorTransitionInfo))]
[assembly: TypeForwardedTo(typeof(MatchTargetWeightMask))]
[assembly: TypeForwardedTo(typeof(Animator))]
[assembly: TypeForwardedTo(typeof(AnimatorControllerParameter))]
[assembly: TypeForwardedTo(typeof(AnimatorControllerPlayable))]
[assembly: TypeForwardedTo(typeof(AnimatorJobExtensions))]
[assembly: TypeForwardedTo(typeof(AnimationClipPair))]
[assembly: TypeForwardedTo(typeof(AnimatorOverrideController))]
[assembly: TypeForwardedTo(typeof(AnimatorUtility))]
[assembly: TypeForwardedTo(typeof(BodyDof))]
[assembly: TypeForwardedTo(typeof(HeadDof))]
[assembly: TypeForwardedTo(typeof(LegDof))]
[assembly: TypeForwardedTo(typeof(ArmDof))]
[assembly: TypeForwardedTo(typeof(FingerDof))]
[assembly: TypeForwardedTo(typeof(HumanPartDof))]
[assembly: TypeForwardedTo(typeof(Dof))]
[assembly: TypeForwardedTo(typeof(HumanBodyBones))]
[assembly: TypeForwardedTo(typeof(HumanParameter))]
[assembly: TypeForwardedTo(typeof(Avatar))]
[assembly: TypeForwardedTo(typeof(SkeletonBone))]
[assembly: TypeForwardedTo(typeof(HumanLimit))]
[assembly: TypeForwardedTo(typeof(HumanBone))]
[assembly: TypeForwardedTo(typeof(HumanDescription))]
[assembly: TypeForwardedTo(typeof(AvatarBuilder))]
[assembly: TypeForwardedTo(typeof(AvatarMaskBodyPart))]
[assembly: TypeForwardedTo(typeof(AvatarMask))]
[assembly: TypeForwardedTo(typeof(Axis))]
[assembly: TypeForwardedTo(typeof(ConstraintSource))]
[assembly: TypeForwardedTo(typeof(IConstraint))]
[assembly: TypeForwardedTo(typeof(IConstraintInternal))]
[assembly: TypeForwardedTo(typeof(PositionConstraint))]
[assembly: TypeForwardedTo(typeof(RotationConstraint))]
[assembly: TypeForwardedTo(typeof(ScaleConstraint))]
[assembly: TypeForwardedTo(typeof(HumanPose))]
[assembly: TypeForwardedTo(typeof(HumanPoseHandler))]
[assembly: TypeForwardedTo(typeof(HumanTrait))]
[assembly: TypeForwardedTo(typeof(LookAtConstraint))]
[assembly: TypeForwardedTo(typeof(Motion))]
[assembly: TypeForwardedTo(typeof(MuscleHandle))]
[assembly: TypeForwardedTo(typeof(ParentConstraint))]
[assembly: TypeForwardedTo(typeof(RuntimeAnimatorController))]
[assembly: TypeForwardedTo(typeof(AnimationEventSource))]
[assembly: TypeForwardedTo(typeof(AnimationEvent))]
[assembly: TypeForwardedTo(typeof(PlayMode))]
[assembly: TypeForwardedTo(typeof(QueueMode))]
[assembly: TypeForwardedTo(typeof(AnimationBlendMode))]
[assembly: TypeForwardedTo(typeof(AnimationPlayMode))]
[assembly: TypeForwardedTo(typeof(AnimationCullingType))]
[assembly: TypeForwardedTo(typeof(Animation))]
[assembly: TypeForwardedTo(typeof(AnimationState))]
[assembly: TypeForwardedTo(typeof(VisionUtility))]
[assembly: TypeForwardedTo(typeof(PolygonId))]
[assembly: TypeForwardedTo(typeof(NavMeshLocation))]
[assembly: TypeForwardedTo(typeof(PathQueryStatus))]
[assembly: TypeForwardedTo(typeof(NavMeshPolyTypes))]
[assembly: TypeForwardedTo(typeof(NavMeshWorld))]
[assembly: TypeForwardedTo(typeof(NavMeshQuery))]
[assembly: TypeForwardedTo(typeof(NavMeshBuilder))]
[assembly: TypeForwardedTo(typeof(NavMesh))]
[assembly: TypeForwardedTo(typeof(NavMeshBuildDebugFlags))]
[assembly: TypeForwardedTo(typeof(NavMeshBuildSourceShape))]
[assembly: TypeForwardedTo(typeof(NavMeshCollectGeometry))]
[assembly: TypeForwardedTo(typeof(NavMeshBuildSource))]
[assembly: TypeForwardedTo(typeof(NavMeshBuildMarkup))]
[assembly: TypeForwardedTo(typeof(NavMeshBuildSettings))]
[assembly: TypeForwardedTo(typeof(NavMeshBuildDebugSettings))]
[assembly: TypeForwardedTo(typeof(NavMeshPathStatus))]
[assembly: TypeForwardedTo(typeof(NavMeshPath))]
[assembly: TypeForwardedTo(typeof(ObstacleAvoidanceType))]
[assembly: TypeForwardedTo(typeof(NavMeshAgent))]
[assembly: TypeForwardedTo(typeof(NavMeshObstacleShape))]
[assembly: TypeForwardedTo(typeof(NavMeshObstacle))]
[assembly: TypeForwardedTo(typeof(OffMeshLinkType))]
[assembly: TypeForwardedTo(typeof(OffMeshLinkData))]
[assembly: TypeForwardedTo(typeof(OffMeshLink))]
[assembly: TypeForwardedTo(typeof(NavMeshHit))]
[assembly: TypeForwardedTo(typeof(NavMeshTriangulation))]
[assembly: TypeForwardedTo(typeof(NavMeshData))]
[assembly: TypeForwardedTo(typeof(NavMeshDataInstance))]
[assembly: TypeForwardedTo(typeof(NavMeshLinkData))]
[assembly: TypeForwardedTo(typeof(NavMeshLinkInstance))]
[assembly: TypeForwardedTo(typeof(NavMeshQueryFilter))]
[assembly: TypeForwardedTo(typeof(AudioExtensionDefinition))]
[assembly: TypeForwardedTo(typeof(AudioSpatializerExtensionDefinition))]
[assembly: TypeForwardedTo(typeof(AudioAmbisonicExtensionDefinition))]
[assembly: TypeForwardedTo(typeof(AudioListenerExtension))]
[assembly: TypeForwardedTo(typeof(AudioSourceExtension))]
[assembly: TypeForwardedTo(typeof(AudioExtensionManager))]
[assembly: TypeForwardedTo(typeof(AudioPlayableOutput))]
[assembly: TypeForwardedTo(typeof(AudioClipPlayable))]
[assembly: TypeForwardedTo(typeof(AudioMixerPlayable))]
[assembly: TypeForwardedTo(typeof(AudioPlayableGraphExtensions))]
[assembly: TypeForwardedTo(typeof(AudioRenderer))]
[assembly: TypeForwardedTo(typeof(AudioSampleProvider))]
[assembly: TypeForwardedTo(typeof(AudioPlayableBinding))]
[assembly: TypeForwardedTo(typeof(WebCamFlags))]
[assembly: TypeForwardedTo(typeof(WebCamKind))]
[assembly: TypeForwardedTo(typeof(WebCamDevice))]
[assembly: TypeForwardedTo(typeof(WebCamTexture))]
[assembly: TypeForwardedTo(typeof(AudioSpeakerMode))]
[assembly: TypeForwardedTo(typeof(AudioDataLoadState))]
[assembly: TypeForwardedTo(typeof(AudioConfiguration))]
[assembly: TypeForwardedTo(typeof(AudioSettings))]
[assembly: TypeForwardedTo(typeof(AudioCompressionFormat))]
[assembly: TypeForwardedTo(typeof(AudioClipLoadType))]
[assembly: TypeForwardedTo(typeof(AudioClip))]
[assembly: TypeForwardedTo(typeof(AudioVelocityUpdateMode))]
[assembly: TypeForwardedTo(typeof(AudioBehaviour))]
[assembly: TypeForwardedTo(typeof(AudioListener))]
[assembly: TypeForwardedTo(typeof(FFTWindow))]
[assembly: TypeForwardedTo(typeof(AudioRolloffMode))]
[assembly: TypeForwardedTo(typeof(AudioSourceCurveType))]
[assembly: TypeForwardedTo(typeof(AudioSource))]
[assembly: TypeForwardedTo(typeof(AudioReverbPreset))]
[assembly: TypeForwardedTo(typeof(AudioReverbZone))]
[assembly: TypeForwardedTo(typeof(AudioLowPassFilter))]
[assembly: TypeForwardedTo(typeof(AudioHighPassFilter))]
[assembly: TypeForwardedTo(typeof(AudioDistortionFilter))]
[assembly: TypeForwardedTo(typeof(AudioEchoFilter))]
[assembly: TypeForwardedTo(typeof(AudioChorusFilter))]
[assembly: TypeForwardedTo(typeof(AudioReverbFilter))]
[assembly: TypeForwardedTo(typeof(Microphone))]
[assembly: TypeForwardedTo(typeof(AudioMixerUpdateMode))]
[assembly: TypeForwardedTo(typeof(AudioMixer))]
[assembly: TypeForwardedTo(typeof(AudioMixerSnapshot))]
[assembly: TypeForwardedTo(typeof(AudioMixerGroup))]
[assembly: TypeForwardedTo(typeof(MovieTexture))]
[assembly: TypeForwardedTo(typeof(ClusterInputType))]
[assembly: TypeForwardedTo(typeof(ClusterInput))]
[assembly: TypeForwardedTo(typeof(ClusterNetwork))]
[assembly: TypeForwardedTo(typeof(PlayableDirector))]
[assembly: TypeForwardedTo(typeof(Grid))]
[assembly: TypeForwardedTo(typeof(GridLayout))]
[assembly: TypeForwardedTo(typeof(ImageConversion))]
[assembly: TypeForwardedTo(typeof(JsonUtility))]
[assembly: TypeForwardedTo(typeof(LocalizationAsset))]
[assembly: TypeForwardedTo(typeof(PhysicsScene2D))]
[assembly: TypeForwardedTo(typeof(PhysicsSceneExtensions2D))]
[assembly: TypeForwardedTo(typeof(Physics2D))]
[assembly: TypeForwardedTo(typeof(CapsuleDirection2D))]
[assembly: TypeForwardedTo(typeof(RigidbodyConstraints2D))]
[assembly: TypeForwardedTo(typeof(RigidbodyInterpolation2D))]
[assembly: TypeForwardedTo(typeof(RigidbodySleepMode2D))]
[assembly: TypeForwardedTo(typeof(CollisionDetectionMode2D))]
[assembly: TypeForwardedTo(typeof(RigidbodyType2D))]
[assembly: TypeForwardedTo(typeof(ForceMode2D))]
[assembly: TypeForwardedTo(typeof(ColliderErrorState2D))]
[assembly: TypeForwardedTo(typeof(JointLimitState2D))]
[assembly: TypeForwardedTo(typeof(EffectorSelection2D))]
[assembly: TypeForwardedTo(typeof(EffectorForceMode2D))]
[assembly: TypeForwardedTo(typeof(ColliderDistance2D))]
[assembly: TypeForwardedTo(typeof(ContactFilter2D))]
[assembly: TypeForwardedTo(typeof(Collision2D))]
[assembly: TypeForwardedTo(typeof(ContactPoint2D))]
[assembly: TypeForwardedTo(typeof(JointAngleLimits2D))]
[assembly: TypeForwardedTo(typeof(JointTranslationLimits2D))]
[assembly: TypeForwardedTo(typeof(JointMotor2D))]
[assembly: TypeForwardedTo(typeof(JointSuspension2D))]
[assembly: TypeForwardedTo(typeof(RaycastHit2D))]
[assembly: TypeForwardedTo(typeof(PhysicsJobOptions2D))]
[assembly: TypeForwardedTo(typeof(Rigidbody2D))]
[assembly: TypeForwardedTo(typeof(Collider2D))]
[assembly: TypeForwardedTo(typeof(CircleCollider2D))]
[assembly: TypeForwardedTo(typeof(CapsuleCollider2D))]
[assembly: TypeForwardedTo(typeof(EdgeCollider2D))]
[assembly: TypeForwardedTo(typeof(BoxCollider2D))]
[assembly: TypeForwardedTo(typeof(PolygonCollider2D))]
[assembly: TypeForwardedTo(typeof(CompositeCollider2D))]
[assembly: TypeForwardedTo(typeof(Joint2D))]
[assembly: TypeForwardedTo(typeof(AnchoredJoint2D))]
[assembly: TypeForwardedTo(typeof(SpringJoint2D))]
[assembly: TypeForwardedTo(typeof(DistanceJoint2D))]
[assembly: TypeForwardedTo(typeof(FrictionJoint2D))]
[assembly: TypeForwardedTo(typeof(HingeJoint2D))]
[assembly: TypeForwardedTo(typeof(RelativeJoint2D))]
[assembly: TypeForwardedTo(typeof(SliderJoint2D))]
[assembly: TypeForwardedTo(typeof(TargetJoint2D))]
[assembly: TypeForwardedTo(typeof(FixedJoint2D))]
[assembly: TypeForwardedTo(typeof(WheelJoint2D))]
[assembly: TypeForwardedTo(typeof(Effector2D))]
[assembly: TypeForwardedTo(typeof(AreaEffector2D))]
[assembly: TypeForwardedTo(typeof(BuoyancyEffector2D))]
[assembly: TypeForwardedTo(typeof(PointEffector2D))]
[assembly: TypeForwardedTo(typeof(PlatformEffector2D))]
[assembly: TypeForwardedTo(typeof(SurfaceEffector2D))]
[assembly: TypeForwardedTo(typeof(PhysicsUpdateBehaviour2D))]
[assembly: TypeForwardedTo(typeof(ConstantForce2D))]
[assembly: TypeForwardedTo(typeof(PhysicsMaterial2D))]
[assembly: TypeForwardedTo(typeof(ScreenCapture))]
[assembly: TypeForwardedTo(typeof(SpriteMask))]
[assembly: TypeForwardedTo(typeof(SpriteShapeParameters))]
[assembly: TypeForwardedTo(typeof(SpriteShapeMetaData))]
[assembly: TypeForwardedTo(typeof(ShapeControlPoint))]
[assembly: TypeForwardedTo(typeof(AngleRangeInfo))]
[assembly: TypeForwardedTo(typeof(SpriteShapeRenderer))]
[assembly: TypeForwardedTo(typeof(SpriteShapeUtility))]
[assembly: TypeForwardedTo(typeof(StreamingController))]
[assembly: TypeForwardedTo(typeof(StyleComplexSelector))]
[assembly: TypeForwardedTo(typeof(StyleProperty))]
[assembly: TypeForwardedTo(typeof(StyleRule))]
[assembly: TypeForwardedTo(typeof(StyleSelector))]
[assembly: TypeForwardedTo(typeof(StyleSelectorPart))]
[assembly: TypeForwardedTo(typeof(StyleSelectorRelationship))]
[assembly: TypeForwardedTo(typeof(StyleSelectorType))]
[assembly: TypeForwardedTo(typeof(StyleSheet))]
[assembly: TypeForwardedTo(typeof(StyleValueHandle))]
[assembly: TypeForwardedTo(typeof(StyleValueKeyword))]
[assembly: TypeForwardedTo(typeof(StyleValueType))]
[assembly: TypeForwardedTo(typeof(BrushTransform))]
[assembly: TypeForwardedTo(typeof(PaintContext))]
[assembly: TypeForwardedTo(typeof(TerrainChangedFlags))]
[assembly: TypeForwardedTo(typeof(TerrainRenderFlags))]
[assembly: TypeForwardedTo(typeof(Terrain))]
[assembly: TypeForwardedTo(typeof(TerrainExtensions))]
[assembly: TypeForwardedTo(typeof(Tree))]
[assembly: TypeForwardedTo(typeof(SpeedTreeWindAsset))]
[assembly: TypeForwardedTo(typeof(TreePrototype))]
[assembly: TypeForwardedTo(typeof(DetailRenderMode))]
[assembly: TypeForwardedTo(typeof(DetailPrototype))]
[assembly: TypeForwardedTo(typeof(SplatPrototype))]
[assembly: TypeForwardedTo(typeof(TreeInstance))]
[assembly: TypeForwardedTo(typeof(PatchExtents))]
[assembly: TypeForwardedTo(typeof(TerrainData))]
[assembly: TypeForwardedTo(typeof(TerrainLayer))]
[assembly: TypeForwardedTo(typeof(TerrainPaintUtility))]
[assembly: TypeForwardedTo(typeof(TerrainUtility))]
[assembly: TypeForwardedTo(typeof(FontStyle))]
[assembly: TypeForwardedTo(typeof(TextGenerationError))]
[assembly: TypeForwardedTo(typeof(TextGenerationSettings))]
[assembly: TypeForwardedTo(typeof(TextGenerator))]
[assembly: TypeForwardedTo(typeof(TextAlignment))]
[assembly: TypeForwardedTo(typeof(TextAnchor))]
[assembly: TypeForwardedTo(typeof(HorizontalWrapMode))]
[assembly: TypeForwardedTo(typeof(VerticalWrapMode))]
[assembly: TypeForwardedTo(typeof(GUIText))]
[assembly: TypeForwardedTo(typeof(TextMesh))]
[assembly: TypeForwardedTo(typeof(CharacterInfo))]
[assembly: TypeForwardedTo(typeof(UICharInfo))]
[assembly: TypeForwardedTo(typeof(UILineInfo))]
[assembly: TypeForwardedTo(typeof(UIVertex))]
[assembly: TypeForwardedTo(typeof(Font))]
[assembly: TypeForwardedTo(typeof(CustomGridBrushAttribute))]
[assembly: TypeForwardedTo(typeof(GridBrushBase))]
[assembly: TypeForwardedTo(typeof(ITilemap))]
[assembly: TypeForwardedTo(typeof(Tile))]
[assembly: TypeForwardedTo(typeof(TileBase))]
[assembly: TypeForwardedTo(typeof(Tilemap))]
[assembly: TypeForwardedTo(typeof(TileFlags))]
[assembly: TypeForwardedTo(typeof(TilemapRenderer))]
[assembly: TypeForwardedTo(typeof(TileData))]
[assembly: TypeForwardedTo(typeof(TileAnimationData))]
[assembly: TypeForwardedTo(typeof(TilemapCollider2D))]
[assembly: TypeForwardedTo(typeof(UnityConnectSettings))]
[assembly: TypeForwardedTo(typeof(UnityAdsSettings))]
[assembly: TypeForwardedTo(typeof(IMultipartFormSection))]
[assembly: TypeForwardedTo(typeof(MultipartFormDataSection))]
[assembly: TypeForwardedTo(typeof(MultipartFormFileSection))]
[assembly: TypeForwardedTo(typeof(UnityWebRequestAsyncOperation))]
[assembly: TypeForwardedTo(typeof(UnityWebRequest))]
[assembly: TypeForwardedTo(typeof(WWWForm))]
[assembly: TypeForwardedTo(typeof(WWWTranscoder))]
[assembly: TypeForwardedTo(typeof(WebRequestUtils))]
[assembly: TypeForwardedTo(typeof(CertificateHandler))]
[assembly: TypeForwardedTo(typeof(DownloadHandler))]
[assembly: TypeForwardedTo(typeof(DownloadHandlerBuffer))]
[assembly: TypeForwardedTo(typeof(DownloadHandlerScript))]
[assembly: TypeForwardedTo(typeof(DownloadHandlerFile))]
[assembly: TypeForwardedTo(typeof(UploadHandler))]
[assembly: TypeForwardedTo(typeof(UploadHandlerRaw))]
[assembly: TypeForwardedTo(typeof(UploadHandlerFile))]
[assembly: TypeForwardedTo(typeof(UnityWebRequestMultimedia))]
[assembly: TypeForwardedTo(typeof(DownloadHandlerAudioClip))]
[assembly: TypeForwardedTo(typeof(DownloadHandlerMovieTexture))]
[assembly: TypeForwardedTo(typeof(UnityWebRequestTexture))]
[assembly: TypeForwardedTo(typeof(DownloadHandlerTexture))]
[assembly: TypeForwardedTo(typeof(VFXCullingFlags))]
[assembly: TypeForwardedTo(typeof(VFXExpressionOperation))]
[assembly: TypeForwardedTo(typeof(VFXValueType))]
[assembly: TypeForwardedTo(typeof(VFXTaskType))]
[assembly: TypeForwardedTo(typeof(VFXSystemType))]
[assembly: TypeForwardedTo(typeof(VFXSystemFlag))]
[assembly: TypeForwardedTo(typeof(VFXUpdateMode))]
[assembly: TypeForwardedTo(typeof(VFXEventAttribute))]
[assembly: TypeForwardedTo(typeof(VFXExpressionValues))]
[assembly: TypeForwardedTo(typeof(VFXManager))]
[assembly: TypeForwardedTo(typeof(VFXSpawnerCallbacks))]
[assembly: TypeForwardedTo(typeof(VFXSpawnerState))]
[assembly: TypeForwardedTo(typeof(VisualEffectAsset))]
[assembly: TypeForwardedTo(typeof(VisualEffect))]
[assembly: TypeForwardedTo(typeof(VFXRenderer))]
[assembly: TypeForwardedTo(typeof(VideoError))]
[assembly: TypeForwardedTo(typeof(VideoPixelFormat))]
[assembly: TypeForwardedTo(typeof(VideoPlayback))]
[assembly: TypeForwardedTo(typeof(VideoClip))]
[assembly: TypeForwardedTo(typeof(VideoClipPlayable))]
[assembly: TypeForwardedTo(typeof(VideoPlaybackMgr))]
[assembly: TypeForwardedTo(typeof(VideoRenderMode))]
[assembly: TypeForwardedTo(typeof(Video3DLayout))]
[assembly: TypeForwardedTo(typeof(VideoAspectRatio))]
[assembly: TypeForwardedTo(typeof(VideoTimeSource))]
[assembly: TypeForwardedTo(typeof(VideoTimeReference))]
[assembly: TypeForwardedTo(typeof(VideoSource))]
[assembly: TypeForwardedTo(typeof(VideoAudioOutputMode))]
[assembly: TypeForwardedTo(typeof(VideoPlayer))]
[assembly: TypeForwardedTo(typeof(VideoPlayerExtensions))]
[assembly: TypeForwardedTo(typeof(WindZoneMode))]
[assembly: TypeForwardedTo(typeof(WindZone))]
[assembly: TypeForwardedTo(typeof(RenderMode))]
[assembly: TypeForwardedTo(typeof(AdditionalCanvasShaderChannels))]
[assembly: TypeForwardedTo(typeof(Canvas))]
[assembly: TypeForwardedTo(typeof(UISystemProfilerApi))]
[assembly: TypeForwardedTo(typeof(ICanvasRaycastFilter))]
[assembly: TypeForwardedTo(typeof(CanvasGroup))]
[assembly: TypeForwardedTo(typeof(CanvasRenderer))]
[assembly: TypeForwardedTo(typeof(RectTransformUtility))]
[assembly: TypeForwardedTo(typeof(TerrainCollider))]
[assembly: TypeForwardedTo(typeof(Request))]
[assembly: TypeForwardedTo(typeof(IResponse))]
[assembly: TypeForwardedTo(typeof(Response))]
[assembly: TypeForwardedTo(typeof(BasicResponse))]
[assembly: TypeForwardedTo(typeof(CreateMatchRequest))]
[assembly: TypeForwardedTo(typeof(CreateMatchResponse))]
[assembly: TypeForwardedTo(typeof(JoinMatchRequest))]
[assembly: TypeForwardedTo(typeof(JoinMatchResponse))]
[assembly: TypeForwardedTo(typeof(DestroyMatchRequest))]
[assembly: TypeForwardedTo(typeof(DropConnectionRequest))]
[assembly: TypeForwardedTo(typeof(DropConnectionResponse))]
[assembly: TypeForwardedTo(typeof(ListMatchRequest))]
[assembly: TypeForwardedTo(typeof(MatchDirectConnectInfo))]
[assembly: TypeForwardedTo(typeof(MatchDesc))]
[assembly: TypeForwardedTo(typeof(ListMatchResponse))]
[assembly: TypeForwardedTo(typeof(CreateOrJoinMatchRequest))]
[assembly: TypeForwardedTo(typeof(SetMatchAttributesRequest))]
[assembly: TypeForwardedTo(typeof(NetworkAccessLevel))]
[assembly: TypeForwardedTo(typeof(AppID))]
[assembly: TypeForwardedTo(typeof(SourceID))]
[assembly: TypeForwardedTo(typeof(NetworkID))]
[assembly: TypeForwardedTo(typeof(NodeID))]
[assembly: TypeForwardedTo(typeof(HostPriority))]
[assembly: TypeForwardedTo(typeof(NetworkAccessToken))]
[assembly: TypeForwardedTo(typeof(Utility))]
[assembly: TypeForwardedTo(typeof(MatchInfo))]
[assembly: TypeForwardedTo(typeof(MatchInfoSnapshot))]
[assembly: TypeForwardedTo(typeof(NetworkMatch))]
[assembly: TypeForwardedTo(typeof(NetworkTransport))]
[assembly: TypeForwardedTo(typeof(NetworkEventType))]
[assembly: TypeForwardedTo(typeof(QosType))]
[assembly: TypeForwardedTo(typeof(NetworkError))]
[assembly: TypeForwardedTo(typeof(ReactorModel))]
[assembly: TypeForwardedTo(typeof(ConnectionAcksType))]
[assembly: TypeForwardedTo(typeof(ChannelQOS))]
[assembly: TypeForwardedTo(typeof(ConnectionConfig))]
[assembly: TypeForwardedTo(typeof(HostTopology))]
[assembly: TypeForwardedTo(typeof(GlobalConfig))]
[assembly: TypeForwardedTo(typeof(ConnectionSimulatorConfig))]
[assembly: TypeForwardedTo(typeof(ConnectionConfigInternal))]
[assembly: TypeForwardedTo(typeof(HostTopologyInternal))]
[assembly: TypeForwardedTo(typeof(ConnectionSimulatorConfigInternal))]
[assembly: TypeForwardedTo(typeof(GlobalConfigInternal))]
[assembly: TypeForwardedTo(typeof(AssetBundleLoadResult))]
[assembly: TypeForwardedTo(typeof(AssetBundle))]
[assembly: TypeForwardedTo(typeof(AssetBundleCreateRequest))]
[assembly: TypeForwardedTo(typeof(AssetBundleManifest))]
[assembly: TypeForwardedTo(typeof(AssetBundleRecompressOperation))]
[assembly: TypeForwardedTo(typeof(AssetBundleRequest))]
[assembly: TypeForwardedTo(typeof(AssetBundleUtility))]
[assembly: TypeForwardedTo(typeof(CompressionType))]
[assembly: TypeForwardedTo(typeof(CompressionLevel))]
[assembly: TypeForwardedTo(typeof(BuildCompression))]
[assembly: TypeForwardedTo(typeof(LocalUser))]
[assembly: TypeForwardedTo(typeof(UserProfile))]
[assembly: TypeForwardedTo(typeof(Achievement))]
[assembly: TypeForwardedTo(typeof(AchievementDescription))]
[assembly: TypeForwardedTo(typeof(Score))]
[assembly: TypeForwardedTo(typeof(Leaderboard))]
[assembly: TypeForwardedTo(typeof(Local))]
[assembly: TypeForwardedTo(typeof(Social))]
[assembly: TypeForwardedTo(typeof(ActivePlatform))]
[assembly: TypeForwardedTo(typeof(ISocialPlatform))]
[assembly: TypeForwardedTo(typeof(ILocalUser))]
[assembly: TypeForwardedTo(typeof(UserState))]
[assembly: TypeForwardedTo(typeof(IUserProfile))]
[assembly: TypeForwardedTo(typeof(IAchievement))]
[assembly: TypeForwardedTo(typeof(IAchievementDescription))]
[assembly: TypeForwardedTo(typeof(IScore))]
[assembly: TypeForwardedTo(typeof(UserScope))]
[assembly: TypeForwardedTo(typeof(TimeScope))]
[assembly: TypeForwardedTo(typeof(Range))]
[assembly: TypeForwardedTo(typeof(ILeaderboard))]
[assembly: TypeForwardedTo(typeof(Event))]
[assembly: TypeForwardedTo(typeof(EventCommandNames))]
[assembly: TypeForwardedTo(typeof(EventType))]
[assembly: TypeForwardedTo(typeof(EventModifiers))]
[assembly: TypeForwardedTo(typeof(EventInterests))]
[assembly: TypeForwardedTo(typeof(GUI))]
[assembly: TypeForwardedTo(typeof(GUIClip))]
[assembly: TypeForwardedTo(typeof(GUIContent))]
[assembly: TypeForwardedTo(typeof(GUIDebugger))]
[assembly: TypeForwardedTo(typeof(ScaleMode))]
[assembly: TypeForwardedTo(typeof(FocusType))]
[assembly: TypeForwardedTo(typeof(GUILayout))]
[assembly: TypeForwardedTo(typeof(GUILayoutOption))]
[assembly: TypeForwardedTo(typeof(GUILayoutUtility))]
[assembly: TypeForwardedTo(typeof(GUISettings))]
[assembly: TypeForwardedTo(typeof(PlatformSelection))]
[assembly: TypeForwardedTo(typeof(GUISkin))]
[assembly: TypeForwardedTo(typeof(GUIStateObjects))]
[assembly: TypeForwardedTo(typeof(GUIStyleState))]
[assembly: TypeForwardedTo(typeof(GUIStyle))]
[assembly: TypeForwardedTo(typeof(ImagePosition))]
[assembly: TypeForwardedTo(typeof(TextClipping))]
[assembly: TypeForwardedTo(typeof(GUITargetAttribute))]
[assembly: TypeForwardedTo(typeof(GUIUtility))]
[assembly: TypeForwardedTo(typeof(ExitGUIException))]
[assembly: TypeForwardedTo(typeof(GUILayoutEntry))]
[assembly: TypeForwardedTo(typeof(GUIAspectSizer))]
[assembly: TypeForwardedTo(typeof(GUIGridSizer))]
[assembly: TypeForwardedTo(typeof(GUIWordWrapSizer))]
[assembly: TypeForwardedTo(typeof(GUILayoutGroup))]
[assembly: TypeForwardedTo(typeof(GUIScrollGroup))]
[assembly: TypeForwardedTo(typeof(ObjectGUIState))]
[assembly: TypeForwardedTo(typeof(ScrollViewState))]
[assembly: TypeForwardedTo(typeof(SliderState))]
[assembly: TypeForwardedTo(typeof(SliderHandler))]
[assembly: TypeForwardedTo(typeof(TextEditor))]
[assembly: TypeForwardedTo(typeof(NativeUpdateCallback))]
[assembly: TypeForwardedTo(typeof(NativeInputEventType))]
[assembly: TypeForwardedTo(typeof(NativeInputEventBuffer))]
[assembly: TypeForwardedTo(typeof(NativeInputEvent))]
[assembly: TypeForwardedTo(typeof(NativeInputUpdateType))]
[assembly: TypeForwardedTo(typeof(NativeInputSystem))]
[assembly: TypeForwardedTo(typeof(FaceInfo))]
[assembly: TypeForwardedTo(typeof(GlyphRect))]
[assembly: TypeForwardedTo(typeof(GlyphMetrics))]
[assembly: TypeForwardedTo(typeof(Glyph))]
[assembly: TypeForwardedTo(typeof(GlyphValueRecord))]
[assembly: TypeForwardedTo(typeof(GlyphAdjustmentRecord))]
[assembly: TypeForwardedTo(typeof(GlyphPairAdjustmentRecord))]
[assembly: TypeForwardedTo(typeof(GlyphLoadFlags))]
[assembly: TypeForwardedTo(typeof(GlyphRasterModes))]
[assembly: TypeForwardedTo(typeof(FontEngineError))]
[assembly: TypeForwardedTo(typeof(GlyphRenderMode))]
[assembly: TypeForwardedTo(typeof(GlyphPackingMode))]
[assembly: TypeForwardedTo(typeof(FontEngine))]
[assembly: TypeForwardedTo(typeof(FontEngineUtilities))]
[assembly: TypeForwardedTo(typeof(GlyphMarshallingStruct))]
[assembly: TypeForwardedTo(typeof(BaseField<>))]
[assembly: TypeForwardedTo(typeof(SliderDirection))]
[assembly: TypeForwardedTo(typeof(BaseSlider<>))]
[assembly: TypeForwardedTo(typeof(BindableElement))]
[assembly: TypeForwardedTo(typeof(Box))]
[assembly: TypeForwardedTo(typeof(Button))]
[assembly: TypeForwardedTo(typeof(ClampedDragger<>))]
[assembly: TypeForwardedTo(typeof(Clickable))]
[assembly: TypeForwardedTo(typeof(ContextualMenuManager))]
[assembly: TypeForwardedTo(typeof(ContextualMenuManipulator))]
[assembly: TypeForwardedTo(typeof(CursorStyle))]
[assembly: TypeForwardedTo(typeof(ICursorManager))]
[assembly: TypeForwardedTo(typeof(CursorManager))]
[assembly: TypeForwardedTo(typeof(DisposeHelper))]
[assembly: TypeForwardedTo(typeof(DropdownMenu))]
[assembly: TypeForwardedTo(typeof(EventPropagation))]
[assembly: TypeForwardedTo(typeof(PropagationPhase))]
[assembly: TypeForwardedTo(typeof(DispatchMode))]
[assembly: TypeForwardedTo(typeof(EventDispatcher))]
[assembly: TypeForwardedTo(typeof(Focusable))]
[assembly: TypeForwardedTo(typeof(FocusChangeDirection))]
[assembly: TypeForwardedTo(typeof(IFocusRing))]
[assembly: TypeForwardedTo(typeof(FocusController))]
[assembly: TypeForwardedTo(typeof(Foldout))]
[assembly: TypeForwardedTo(typeof(HierarchyTraversal))]
[assembly: TypeForwardedTo(typeof(IDataWatchHandle))]
[assembly: TypeForwardedTo(typeof(IDataWatchService))]
[assembly: TypeForwardedTo(typeof(Image))]
[assembly: TypeForwardedTo(typeof(IMGUIContainer))]
[assembly: TypeForwardedTo(typeof(ImmediateStylePainter))]
[assembly: TypeForwardedTo(typeof(SelectionType))]
[assembly: TypeForwardedTo(typeof(ISerializableJsonDictionary))]
[assembly: TypeForwardedTo(typeof(IStyle))]
[assembly: TypeForwardedTo(typeof(ITransform))]
[assembly: TypeForwardedTo(typeof(Label))]
[assembly: TypeForwardedTo(typeof(ListView))]
[assembly: TypeForwardedTo(typeof(ManipulatorActivationFilter))]
[assembly: TypeForwardedTo(typeof(IManipulator))]
[assembly: TypeForwardedTo(typeof(Manipulator))]
[assembly: TypeForwardedTo(typeof(MinMaxSlider))]
[assembly: TypeForwardedTo(typeof(MouseButton))]
[assembly: TypeForwardedTo(typeof(MouseCaptureController))]
[assembly: TypeForwardedTo(typeof(MouseManipulator))]
[assembly: TypeForwardedTo(typeof(ObjectPool<>))]
[assembly: TypeForwardedTo(typeof(ContextType))]
[assembly: TypeForwardedTo(typeof(ChangeType))]
[assembly: TypeForwardedTo(typeof(VersionChangeType))]
[assembly: TypeForwardedTo(typeof(RepaintData))]
[assembly: TypeForwardedTo(typeof(IPanel))]
[assembly: TypeForwardedTo(typeof(BaseVisualElementPanel))]
[assembly: TypeForwardedTo(typeof(LoadResourceFunction))]
[assembly: TypeForwardedTo(typeof(TimeMsFunction))]
[assembly: TypeForwardedTo(typeof(GetViewDataDictionary))]
[assembly: TypeForwardedTo(typeof(SavePersistentViewData))]
[assembly: TypeForwardedTo(typeof(Panel))]
[assembly: TypeForwardedTo(typeof(RenderData))]
[assembly: TypeForwardedTo(typeof(PanelWrapper))]
[assembly: TypeForwardedTo(typeof(UIRRepaintUpdater))]
[assembly: TypeForwardedTo(typeof(UIRPainter))]
[assembly: TypeForwardedTo(typeof(PopupWindow))]
[assembly: TypeForwardedTo(typeof(RepeatButton))]
[assembly: TypeForwardedTo(typeof(TimerState))]
[assembly: TypeForwardedTo(typeof(IScheduledItem))]
[assembly: TypeForwardedTo(typeof(IScheduler))]
[assembly: TypeForwardedTo(typeof(ScheduledItem))]
[assembly: TypeForwardedTo(typeof(TimerEventScheduler))]
[assembly: TypeForwardedTo(typeof(ScrollerButton))]
[assembly: TypeForwardedTo(typeof(Scroller))]
[assembly: TypeForwardedTo(typeof(ScrollView))]
[assembly: TypeForwardedTo(typeof(Slider))]
[assembly: TypeForwardedTo(typeof(SliderInt))]
[assembly: TypeForwardedTo(typeof(Spacing))]
[assembly: TypeForwardedTo(typeof(Position))]
[assembly: TypeForwardedTo(typeof(PositionType))]
[assembly: TypeForwardedTo(typeof(Overflow))]
[assembly: TypeForwardedTo(typeof(FlexDirection))]
[assembly: TypeForwardedTo(typeof(Wrap))]
[assembly: TypeForwardedTo(typeof(Align))]
[assembly: TypeForwardedTo(typeof(Justify))]
[assembly: TypeForwardedTo(typeof(ImageScaleMode))]
[assembly: TypeForwardedTo(typeof(Visibility))]
[assembly: TypeForwardedTo(typeof(IStylePainter))]
[assembly: TypeForwardedTo(typeof(IStylePainterInternal))]
[assembly: TypeForwardedTo(typeof(BorderParameters))]
[assembly: TypeForwardedTo(typeof(TextureStylePainterParameters))]
[assembly: TypeForwardedTo(typeof(RectStylePainterParameters))]
[assembly: TypeForwardedTo(typeof(TextStylePainterParameters))]
[assembly: TypeForwardedTo(typeof(MeshStylePainterParameters))]
[assembly: TypeForwardedTo(typeof(CursorPositionStylePainterParameters))]
[assembly: TypeForwardedTo(typeof(TemplateContainer))]
[assembly: TypeForwardedTo(typeof(ITextElement))]
[assembly: TypeForwardedTo(typeof(TextElement))]
[assembly: TypeForwardedTo(typeof(TextNativeSettings))]
[assembly: TypeForwardedTo(typeof(TextVertex))]
[assembly: TypeForwardedTo(typeof(TextNative))]
[assembly: TypeForwardedTo(typeof(UIElementsUtility))]
[assembly: TypeForwardedTo(typeof(RuleMatcher))]
[assembly: TypeForwardedTo(typeof(UQuery))]
[assembly: TypeForwardedTo(typeof(UQueryExtensions))]
[assembly: TypeForwardedTo(typeof(VisualContainer))]
[assembly: TypeForwardedTo(typeof(OnStylesResolved))]
[assembly: TypeForwardedTo(typeof(PseudoStates))]
[assembly: TypeForwardedTo(typeof(PickingMode))]
[assembly: TypeForwardedTo(typeof(VisualElementListPool))]
[assembly: TypeForwardedTo(typeof(VisualElement))]
[assembly: TypeForwardedTo(typeof(VisualElementExtensions))]
[assembly: TypeForwardedTo(typeof(IUIElementDataWatchRequest))]
[assembly: TypeForwardedTo(typeof(IUIElementDataWatch))]
[assembly: TypeForwardedTo(typeof(VisualElementFocusChangeDirection))]
[assembly: TypeForwardedTo(typeof(VisualElementFocusRing))]
[assembly: TypeForwardedTo(typeof(IVisualElementScheduledItem))]
[assembly: TypeForwardedTo(typeof(IVisualElementScheduler))]
[assembly: TypeForwardedTo(typeof(IVisualElementPanelActivatable))]
[assembly: TypeForwardedTo(typeof(VisualElementPanelActivator))]
[assembly: TypeForwardedTo(typeof(Flex))]
[assembly: TypeForwardedTo(typeof(VisualElementUtils))]
[assembly: TypeForwardedTo(typeof(HierarchyChangeType))]
[assembly: TypeForwardedTo(typeof(BaseVisualTreeHierarchyTrackerUpdater))]
[assembly: TypeForwardedTo(typeof(VisualTreeLayoutUpdater))]
[assembly: TypeForwardedTo(typeof(VisualTreePersistentDataUpdater))]
[assembly: TypeForwardedTo(typeof(VisualTreeRepaintUpdater))]
[assembly: TypeForwardedTo(typeof(StyleCache))]
[assembly: TypeForwardedTo(typeof(VisualTreeStyleUpdater))]
[assembly: TypeForwardedTo(typeof(StyleMatchingContext))]
[assembly: TypeForwardedTo(typeof(VisualTreeStyleUpdaterTraversal))]
[assembly: TypeForwardedTo(typeof(VisualTreeTransformClipUpdater))]
[assembly: TypeForwardedTo(typeof(VisualTreeUpdatePhase))]
[assembly: TypeForwardedTo(typeof(VisualTreeUpdater))]
[assembly: TypeForwardedTo(typeof(IVisualTreeUpdater))]
[assembly: TypeForwardedTo(typeof(BaseVisualTreeUpdater))]
[assembly: TypeForwardedTo(typeof(GfxUpdateBufferRange))]
[assembly: TypeForwardedTo(typeof(DrawBufferRange))]
[assembly: TypeForwardedTo(typeof(Utility))]
[assembly: TypeForwardedTo(typeof(IBindable))]
[assembly: TypeForwardedTo(typeof(IBinding))]
[assembly: TypeForwardedTo(typeof(IBindingExtensions))]
[assembly: TypeForwardedTo(typeof(INotifyValueChanged<>))]
[assembly: TypeForwardedTo(typeof(KeyboardTextEditorEventHandler))]
[assembly: TypeForwardedTo(typeof(TextEditorEventHandler))]
[assembly: TypeForwardedTo(typeof(TextEditorEngine))]
[assembly: TypeForwardedTo(typeof(TextField))]
[assembly: TypeForwardedTo(typeof(ITextInputField))]
[assembly: TypeForwardedTo(typeof(TextInputFieldBase<>))]
[assembly: TypeForwardedTo(typeof(Toggle))]
[assembly: TypeForwardedTo(typeof(TouchScreenTextEditorEventHandler))]
[assembly: TypeForwardedTo(typeof(VisualTreeBindingsUpdater))]
[assembly: TypeForwardedTo(typeof(IMouseCaptureEvent))]
[assembly: TypeForwardedTo(typeof(MouseCaptureEventBase<>))]
[assembly: TypeForwardedTo(typeof(MouseCaptureOutEvent))]
[assembly: TypeForwardedTo(typeof(MouseCaptureEvent))]
[assembly: TypeForwardedTo(typeof(IChangeEvent))]
[assembly: TypeForwardedTo(typeof(ChangeEvent<>))]
[assembly: TypeForwardedTo(typeof(ICommandEvent))]
[assembly: TypeForwardedTo(typeof(CommandEventBase<>))]
[assembly: TypeForwardedTo(typeof(ValidateCommandEvent))]
[assembly: TypeForwardedTo(typeof(ExecuteCommandEvent))]
[assembly: TypeForwardedTo(typeof(IDragAndDropEvent))]
[assembly: TypeForwardedTo(typeof(DragAndDropEventBase<>))]
[assembly: TypeForwardedTo(typeof(DragExitedEvent))]
[assembly: TypeForwardedTo(typeof(DragEnterEvent))]
[assembly: TypeForwardedTo(typeof(DragLeaveEvent))]
[assembly: TypeForwardedTo(typeof(DragUpdatedEvent))]
[assembly: TypeForwardedTo(typeof(DragPerformEvent))]
[assembly: TypeForwardedTo(typeof(EventBase))]
[assembly: TypeForwardedTo(typeof(EventBase<>))]
[assembly: TypeForwardedTo(typeof(IPropagatableEvent))]
[assembly: TypeForwardedTo(typeof(EventCallback<>))]
[assembly: TypeForwardedTo(typeof(EventCallback<, >))]
[assembly: TypeForwardedTo(typeof(EventCallbackFunctorBase))]
[assembly: TypeForwardedTo(typeof(EventCallbackFunctor<>))]
[assembly: TypeForwardedTo(typeof(EventCallbackFunctor<, >))]
[assembly: TypeForwardedTo(typeof(Capture))]
[assembly: TypeForwardedTo(typeof(TrickleDown))]
[assembly: TypeForwardedTo(typeof(CallbackPhase))]
[assembly: TypeForwardedTo(typeof(EventCallbackListPool))]
[assembly: TypeForwardedTo(typeof(EventCallbackList))]
[assembly: TypeForwardedTo(typeof(EventCallbackRegistry))]
[assembly: TypeForwardedTo(typeof(IEventHandler))]
[assembly: TypeForwardedTo(typeof(CallbackEventHandler))]
[assembly: TypeForwardedTo(typeof(EventPool<>))]
[assembly: TypeForwardedTo(typeof(IFocusEvent))]
[assembly: TypeForwardedTo(typeof(FocusEventBase<>))]
[assembly: TypeForwardedTo(typeof(FocusOutEvent))]
[assembly: TypeForwardedTo(typeof(BlurEvent))]
[assembly: TypeForwardedTo(typeof(FocusInEvent))]
[assembly: TypeForwardedTo(typeof(FocusEvent))]
[assembly: TypeForwardedTo(typeof(InputEvent))]
[assembly: TypeForwardedTo(typeof(IKeyboardEvent))]
[assembly: TypeForwardedTo(typeof(KeyboardEventBase<>))]
[assembly: TypeForwardedTo(typeof(KeyDownEvent))]
[assembly: TypeForwardedTo(typeof(KeyUpEvent))]
[assembly: TypeForwardedTo(typeof(GeometryChangedEvent))]
[assembly: TypeForwardedTo(typeof(IMouseEvent))]
[assembly: TypeForwardedTo(typeof(IMouseEventInternal))]
[assembly: TypeForwardedTo(typeof(MouseEventBase<>))]
[assembly: TypeForwardedTo(typeof(MouseDownEvent))]
[assembly: TypeForwardedTo(typeof(MouseUpEvent))]
[assembly: TypeForwardedTo(typeof(MouseMoveEvent))]
[assembly: TypeForwardedTo(typeof(ContextClickEvent))]
[assembly: TypeForwardedTo(typeof(WheelEvent))]
[assembly: TypeForwardedTo(typeof(MouseEnterEvent))]
[assembly: TypeForwardedTo(typeof(MouseLeaveEvent))]
[assembly: TypeForwardedTo(typeof(MouseEnterWindowEvent))]
[assembly: TypeForwardedTo(typeof(MouseLeaveWindowEvent))]
[assembly: TypeForwardedTo(typeof(MouseOverEvent))]
[assembly: TypeForwardedTo(typeof(MouseOutEvent))]
[assembly: TypeForwardedTo(typeof(ContextualMenuPopulateEvent))]
[assembly: TypeForwardedTo(typeof(IPanelChangedEvent))]
[assembly: TypeForwardedTo(typeof(PanelChangedEventBase<>))]
[assembly: TypeForwardedTo(typeof(AttachToPanelEvent))]
[assembly: TypeForwardedTo(typeof(DetachFromPanelEvent))]
[assembly: TypeForwardedTo(typeof(TooltipEvent))]
[assembly: TypeForwardedTo(typeof(IMGUIEvent))]
[assembly: TypeForwardedTo(typeof(StyleComplexSelectorExtensions))]
[assembly: TypeForwardedTo(typeof(MatchResultInfo))]
[assembly: TypeForwardedTo(typeof(SelectorMatchRecord))]
[assembly: TypeForwardedTo(typeof(StyleSelectorHelper))]
[assembly: TypeForwardedTo(typeof(FloatOrKeyword))]
[assembly: TypeForwardedTo(typeof(StyleSheetApplicator))]
[assembly: TypeForwardedTo(typeof(StyleSheetCache))]
[assembly: TypeForwardedTo(typeof(HandlesApplicatorFunction<>))]
[assembly: TypeForwardedTo(typeof(ShorthandApplicatorFunction))]
[assembly: TypeForwardedTo(typeof(StyleSheetExtensions))]
[assembly: TypeForwardedTo(typeof(StylePropertyID))]
[assembly: TypeForwardedTo(typeof(StylePropertyApplyMode))]
[assembly: TypeForwardedTo(typeof(StyleValue<>))]
[assembly: TypeForwardedTo(typeof(StyleValueUtils))]
[assembly: TypeForwardedTo(typeof(CustomProperty))]
[assembly: TypeForwardedTo(typeof(ICustomStyle))]
[assembly: TypeForwardedTo(typeof(VisualElementStylesData))]
[assembly: TypeForwardedTo(typeof(IUxmlAttributes))]
[assembly: TypeForwardedTo(typeof(TemplateAsset))]
[assembly: TypeForwardedTo(typeof(UxmlAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlStringAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlFloatAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlDoubleAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlIntAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlLongAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlBoolAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlColorAttributeDescription))]
[assembly: TypeForwardedTo(typeof(UxmlEnumAttributeDescription<>))]
[assembly: TypeForwardedTo(typeof(UxmlChildElementDescription))]
[assembly: TypeForwardedTo(typeof(UxmlTraits))]
[assembly: TypeForwardedTo(typeof(IUxmlFactory))]
[assembly: TypeForwardedTo(typeof(UxmlFactory<, >))]
[assembly: TypeForwardedTo(typeof(UxmlFactory<>))]
[assembly: TypeForwardedTo(typeof(UxmlRootElementFactory))]
[assembly: TypeForwardedTo(typeof(UxmlRootElementTraits))]
[assembly: TypeForwardedTo(typeof(UxmlTypeRestriction))]
[assembly: TypeForwardedTo(typeof(UxmlValueMatches))]
[assembly: TypeForwardedTo(typeof(UxmlValueBounds))]
[assembly: TypeForwardedTo(typeof(UxmlEnumeration))]
[assembly: TypeForwardedTo(typeof(VisualElementAsset))]
[assembly: TypeForwardedTo(typeof(VisualElementFactoryRegistry))]
[assembly: TypeForwardedTo(typeof(VisualTreeAsset))]
[assembly: TypeForwardedTo(typeof(CreationContext))]
[assembly: TypeForwardedTo(typeof(BaselineFunction))]
[assembly: TypeForwardedTo(typeof(Logger))]
[assembly: TypeForwardedTo(typeof(MeasureFunction))]
[assembly: TypeForwardedTo(typeof(MeasureOutput))]
[assembly: TypeForwardedTo(typeof(YogaAlign))]
[assembly: TypeForwardedTo(typeof(YogaBaselineFunc))]
[assembly: TypeForwardedTo(typeof(YogaConfig))]
[assembly: TypeForwardedTo(typeof(YogaConstants))]
[assembly: TypeForwardedTo(typeof(YogaDimension))]
[assembly: TypeForwardedTo(typeof(YogaDirection))]
[assembly: TypeForwardedTo(typeof(YogaDisplay))]
[assembly: TypeForwardedTo(typeof(YogaEdge))]
[assembly: TypeForwardedTo(typeof(YogaExperimentalFeature))]
[assembly: TypeForwardedTo(typeof(YogaFlexDirection))]
[assembly: TypeForwardedTo(typeof(YogaJustify))]
[assembly: TypeForwardedTo(typeof(YogaLogger))]
[assembly: TypeForwardedTo(typeof(YogaLogLevel))]
[assembly: TypeForwardedTo(typeof(YogaMeasureFunc))]
[assembly: TypeForwardedTo(typeof(YogaMeasureMode))]
[assembly: TypeForwardedTo(typeof(Native))]
[assembly: TypeForwardedTo(typeof(YogaNode))]
[assembly: TypeForwardedTo(typeof(YogaNodeType))]
[assembly: TypeForwardedTo(typeof(YogaOverflow))]
[assembly: TypeForwardedTo(typeof(YogaPositionType))]
[assembly: TypeForwardedTo(typeof(YogaPrintOptions))]
[assembly: TypeForwardedTo(typeof(YogaSize))]
[assembly: TypeForwardedTo(typeof(YogaUnit))]
[assembly: TypeForwardedTo(typeof(YogaValue))]
[assembly: TypeForwardedTo(typeof(YogaValueExtensions))]
[assembly: TypeForwardedTo(typeof(YogaWrap))]
[assembly: TypeForwardedTo(typeof(ContinuousEvent))]
[assembly: TypeForwardedTo(typeof(AnalyticsSessionState))]
[assembly: TypeForwardedTo(typeof(AnalyticsSessionInfo))]
[assembly: TypeForwardedTo(typeof(Analytics))]
[assembly: TypeForwardedTo(typeof(Gender))]
[assembly: TypeForwardedTo(typeof(AnalyticsResult))]
[assembly: TypeForwardedTo(typeof(CustomEventData))]
[assembly: TypeForwardedTo(typeof(RemoteSettings))]
[assembly: TypeForwardedTo(typeof(RemoteConfigSettings))]
[assembly: TypeForwardedTo(typeof(UnityWebRequestAssetBundle))]
[assembly: TypeForwardedTo(typeof(DownloadHandlerAssetBundle))]
[assembly: TypeForwardedTo(typeof(WebRequestWWW))]
[assembly: TypeForwardedTo(typeof(WWW))]
[assembly: TypeForwardedTo(typeof(WWWAudioExtensions))]
[assembly: TypeForwardedTo(typeof(DotNetHelper))]
[assembly: TypeForwardedTo(typeof(TrackableId))]
[assembly: TypeForwardedTo(typeof(ISubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(ISubsystemDescriptorImpl))]
[assembly: TypeForwardedTo(typeof(IntegratedSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(SubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(IntegratedSubsystemDescriptor<>))]
[assembly: TypeForwardedTo(typeof(SubsystemDescriptor<>))]
[assembly: TypeForwardedTo(typeof(Internal_SubsystemInstances))]
[assembly: TypeForwardedTo(typeof(Internal_SubsystemDescriptors))]
[assembly: TypeForwardedTo(typeof(SubsystemManager))]
[assembly: TypeForwardedTo(typeof(ISubsystem))]
[assembly: TypeForwardedTo(typeof(IntegratedSubsystem))]
[assembly: TypeForwardedTo(typeof(IntegratedSubsystem<>))]
[assembly: TypeForwardedTo(typeof(Subsystem))]
[assembly: TypeForwardedTo(typeof(Subsystem<>))]
[assembly: TypeForwardedTo(typeof(InputTracking))]
[assembly: TypeForwardedTo(typeof(XRNode))]
[assembly: TypeForwardedTo(typeof(AvailableTrackingData))]
[assembly: TypeForwardedTo(typeof(XRNodeState))]
[assembly: TypeForwardedTo(typeof(HapticCapabilities))]
[assembly: TypeForwardedTo(typeof(InputDevice))]
[assembly: TypeForwardedTo(typeof(InputDevices))]
[assembly: TypeForwardedTo(typeof(FrameReceivedEventArgs))]
[assembly: TypeForwardedTo(typeof(XRCameraSubsystem))]
[assembly: TypeForwardedTo(typeof(XRCameraSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(PointCloudUpdatedEventArgs))]
[assembly: TypeForwardedTo(typeof(XRDepthSubsystem))]
[assembly: TypeForwardedTo(typeof(XRDepthSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(XRDisplaySubsystem))]
[assembly: TypeForwardedTo(typeof(XRDisplaySubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(XRExampleSubsystem))]
[assembly: TypeForwardedTo(typeof(XRExampleSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(XRInputSubsystem))]
[assembly: TypeForwardedTo(typeof(XRInputSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(MeshGenerationStatus))]
[assembly: TypeForwardedTo(typeof(HashCodeHelper))]
[assembly: TypeForwardedTo(typeof(MeshGenerationResult))]
[assembly: TypeForwardedTo(typeof(MeshVertexAttributes))]
[assembly: TypeForwardedTo(typeof(MeshChangeState))]
[assembly: TypeForwardedTo(typeof(MeshInfo))]
[assembly: TypeForwardedTo(typeof(XRMeshSubsystem))]
[assembly: TypeForwardedTo(typeof(XRMeshSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(PlaneAlignment))]
[assembly: TypeForwardedTo(typeof(BoundedPlane))]
[assembly: TypeForwardedTo(typeof(PlaneAddedEventArgs))]
[assembly: TypeForwardedTo(typeof(PlaneUpdatedEventArgs))]
[assembly: TypeForwardedTo(typeof(PlaneRemovedEventArgs))]
[assembly: TypeForwardedTo(typeof(XRPlaneSubsystem))]
[assembly: TypeForwardedTo(typeof(XRPlaneSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(TrackableType))]
[assembly: TypeForwardedTo(typeof(XRRaycastHit))]
[assembly: TypeForwardedTo(typeof(XRRaycastSubsystem))]
[assembly: TypeForwardedTo(typeof(XRRaycastSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(ReferencePoint))]
[assembly: TypeForwardedTo(typeof(ReferencePointUpdatedEventArgs))]
[assembly: TypeForwardedTo(typeof(XRReferencePointSubsystem))]
[assembly: TypeForwardedTo(typeof(XRReferencePointSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(TrackingState))]
[assembly: TypeForwardedTo(typeof(SessionTrackingStateChangedEventArgs))]
[assembly: TypeForwardedTo(typeof(XRSessionSubsystem))]
[assembly: TypeForwardedTo(typeof(XRSessionSubsystemDescriptor))]
[assembly: TypeForwardedTo(typeof(PoseStatus))]
[assembly: TypeForwardedTo(typeof(PoseData))]
[assembly: TypeForwardedTo(typeof(TangoInputTracking))]
[assembly: TypeForwardedTo(typeof(ARRenderMode))]
[assembly: TypeForwardedTo(typeof(ARBackgroundRenderer))]
[assembly: TypeForwardedTo(typeof(GameViewRenderMode))]
[assembly: TypeForwardedTo(typeof(TrackingOriginMode))]
[assembly: TypeForwardedTo(typeof(XRSettings))]
[assembly: TypeForwardedTo(typeof(UserPresenceState))]
[assembly: TypeForwardedTo(typeof(TrackingSpaceType))]
[assembly: TypeForwardedTo(typeof(XRDevice))]
[assembly: TypeForwardedTo(typeof(XRStats))]
[assembly: TypeForwardedTo(typeof(Boundary))]
[assembly: TypeForwardedTo(typeof(GestureHand))]
[assembly: TypeForwardedTo(typeof(SimulatedGesture))]
[assembly: TypeForwardedTo(typeof(HolographicAutomation))]
[assembly: TypeForwardedTo(typeof(SimulatedBody))]
[assembly: TypeForwardedTo(typeof(SimulatedHead))]
[assembly: TypeForwardedTo(typeof(SimulatedHand))]
[assembly: TypeForwardedTo(typeof(HolographicEmulationHelpers))]
[assembly: TypeForwardedTo(typeof(HolographicStreamerConnectionState))]
[assembly: TypeForwardedTo(typeof(HolographicStreamerConnectionFailureReason))]
[assembly: TypeForwardedTo(typeof(EmulationMode))]
[assembly: TypeForwardedTo(typeof(RemoteDeviceVersion))]
[assembly: TypeForwardedTo(typeof(HolographicEmulationHelper))]
[assembly: TypeForwardedTo(typeof(PerceptionRemoting))]
[assembly: TypeForwardedTo(typeof(HolographicSettings))]
[assembly: TypeForwardedTo(typeof(WorldAnchor))]
[assembly: TypeForwardedTo(typeof(HolographicRemoting))]
[assembly: TypeForwardedTo(typeof(VRTestMock))]
[assembly: TypeForwardedTo(typeof(CrashReportHandler))]
[assembly: TypeForwardedTo(typeof(PerformanceReporting))]
namespace UnityEngine
{
	internal class ProceduralMaterial
	{
	}
	internal enum ProceduralProcessorUsage
	{

	}
	internal enum ProceduralCacheSize
	{

	}
	internal enum ProceduralLoadingBehavior
	{

	}
	internal enum ProceduralPropertyType
	{

	}
	internal enum ProceduralOutputType
	{

	}
	internal class ProceduralPropertyDescription
	{
	}
	internal class ProceduralTexture
	{
	}
}
namespace UnityEngine.Experimental.UIElements
{
	internal class ContextualMenu
	{
	}
}
namespace UnityEngine.VR
{
	internal enum VRDeviceType
	{

	}
	internal enum TrackingSpaceType
	{

	}
	internal enum UserPresenceState
	{

	}
	internal class VRSettings
	{
	}
	internal class VRDevice
	{
	}
	internal class VRStats
	{
	}
	internal class InputTracking
	{
	}
	internal enum VRNode
	{

	}
	internal class VRNodeState
	{
	}
}

BestMod/obj/Debug/BestMod.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BestMod.Cards;
using HarmonyLib;
using UnboundLib.Cards;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("BestMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("BestMod")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9cd7e498-5d14-469a-870c-e17ccbf03a30")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BestMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.My.Mod.Id", "Best Mod", "1.1.0")]
	[BepInProcess("Rounds.exe")]
	public class BestMod : BaseUnityPlugin
	{
		private const string ModId = "com.My.Mod.Id";

		private const string ModName = "Best Mod";

		public const string Version = "1.1.0";

		public const string ModInitials = "BM";

		public static BestMod instance { get; private set; }

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.My.Mod.Id");
			val.PatchAll();
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<InfiniteJumps>();
			CustomCard.BuildCard<Heavy>();
			CustomCard.BuildCard<Floaty>();
			CustomCard.BuildCard<ZeroGravity>();
			CustomCard.BuildCard<NegGravity>();
			CustomCard.BuildCard<LazerOfDEATH>();
			CustomCard.BuildCard<EyeDestroyer>();
		}
	}
}
namespace BestMod.Cards
{
	internal class Floaty : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = 0.5f;
			statModifiers.health = 0.5f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Floaty";
		}

		protected override string GetDescription()
		{
			return "You have less gravity, but you have less health.";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Gravity",
					amount = "Less",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "Also Less",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class Heavy : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = 10f;
			statModifiers.health = 10f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Heavy";
		}

		protected override string GetDescription()
		{
			return "You have a lot of gravity, but also a lot of health.";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Gravity",
					amount = "A whole lot",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "Also a whole lot",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)6;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class InfiniteJumps : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.numberOfJumps = 999999;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Infinite Jumps!";
		}

		protected override string GetDescription()
		{
			return "Yes yes yes yes why isnt this a thing in normal rounds its so fun i think idk i havent tested it yet lol but yeah i think its cool";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Jumps",
					amount = "Way too many",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)0;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class EyeDestroyer : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.shake = 500f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Eye Destroyer";
		}

		protected override string GetDescription()
		{
			return "DO NOT PICK THIS CARD IF YOU DONT WANT TO LOSE FRIENDS";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Eyesores",
					amount = "A lot of",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)4;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class LazerOfDEATH : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.projectileSpeed = 100f;
			gun.attackSpeed = 100f;
			gun.reloadTime = 0f;
			gun.reflects = 1;
			gun.spread = 0f;
			gun.timeBetweenBullets = 0f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Lazer Of DEATH";
		}

		protected override string GetDescription()
		{
			return "Uh yeah uh oh";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Lazerness",
					amount = "A whole lot of epic",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class Template : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "CardName";
		}

		protected override string GetDescription()
		{
			return "CardDescription";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Effect",
					amount = "No",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class NegGravity : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = -1f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Negitive Gravity";
		}

		protected override string GetDescription()
		{
			return "How does this even work?!?!?!?!!!";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Gravity",
					amount = "Opposite",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)4;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
	internal class ZeroGravity : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.gravity = 0f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Zero Gravity";
		}

		protected override string GetDescription()
		{
			return "Who needs gravity when you got... not gravity!";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Gravity",
					amount = "Basically No",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)3;
		}

		public override string GetModName()
		{
			return "BestMod";
		}
	}
}